Deploying a Tracardi App
Introduction
Tracardi is an open-source customer data and journey automation platform built on FastAPI. This guide covers building a Docker image, wiring it to Elasticsearch (and optional Redis), securing admin access, and deploying to Klutch.sh over HTTP.
Prerequisites
- GitHub repository containing your Dockerfile.
- Managed Elasticsearch/OpenSearch endpoint (or a separately deployed cluster).
- Optional Redis instance for queues and caching.
- Klutch.sh project ready in klutch.sh/app.
Project structure
.└── DockerfileSample Dockerfile
FROM tracardi/tracardi-api:latest
# Default Tracardi portENV TRACARDI_HOST=0.0.0.0 \ TRACARDI_PORT=8686
EXPOSE 8686CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8686"]Required environment variables
ELASTIC_HOST– Elasticsearch host (no protocol).ELASTIC_PORT– e.g.,9200.ELASTIC_SCHEME–httporhttps.ELASTIC_USERandELASTIC_PASSWORD– if security is enabled.ADMIN_USERandADMIN_PASSWORD– credentials for the admin UI.SECRET_KEY– secure random string for JWT/session signing.
Optional environment variables
REDIS_HOST/REDIS_PORT/REDIS_PASSWORD– if using Redis for queues/caching.TRACARDI_PORT– override if you change the internal port.TRACARDI_DEBUG=false– keep debug disabled in production.
Persistence
Tracardi stores data in Elasticsearch. If you log locally, attach a volume for logs/backups:
- Mount path:
/var/log/tracardi - Size: based on expected retention
Networking
- Protocol: HTTP
- Internal port:
8686 - Users reach
https://example-app.klutch.shwhile Klutch.sh routes to port8686in the container.
Health check (recommended)
curl -I http://localhost:8686/healthDeployment on Klutch.sh
- Push your Dockerfile to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
8686. - Configure environment variables for Elasticsearch (
ELASTIC_HOST,ELASTIC_PORT,ELASTIC_SCHEME, credentials), admin access (ADMIN_USER,ADMIN_PASSWORD), andSECRET_KEY. Add Redis vars if used. - Optionally attach a persistent volume at
/var/log/tracardifor log retention. - Deploy. After first boot, sign in with the admin user to complete setup.
Verification
-
UI: open
https://example-app.klutch.shand confirm the dashboard loads. -
API health:
Terminal window curl -s https://example-app.klutch.sh/health
Next steps
- Set up TLS and user roles in Elasticsearch.
- Enable backups for your Elasticsearch cluster.
- Tune worker and queue settings if using Redis for high-throughput ingestion.