Deploying a Zitadel App
Introduction
Zitadel is an open-source identity and access management platform. This guide shows how to containerize Zitadel with a Dockerfile, connect it to PostgreSQL, persist data, and deploy it to Klutch.sh over HTTP.
Prerequisites
- GitHub repository containing your Dockerfile.
- PostgreSQL database (managed or deployed separately).
- Klutch.sh project ready in klutch.sh/app.
Project structure
.└── DockerfileSample Dockerfile
FROM ghcr.io/zitadel/zitadel:latest
# Default Zitadel portENV PORT=8080EXPOSE 8080Required environment variables
ZITADEL_DATABASE_POSTGRES_HOSTZITADEL_DATABASE_POSTGRES_PORT– e.g.,5432ZITADEL_DATABASE_POSTGRES_DATABASEZITADEL_DATABASE_POSTGRES_USERZITADEL_DATABASE_POSTGRES_PASSWORDPORT=8080ZITADEL_EXTERNALSECURE=true– rely on HTTPS termination at the edge
Optional environment variables
ZITADEL_LOG_LEVEL=infoZITADEL_TELEMETRY_ENABLED=falseZITADEL_DEFAULTINSTANCE_NAME– brandingZITADEL_DEFAULTINSTANCE_DOMAIN– e.g.,example-app.klutch.sh
Persistence
All state is stored in PostgreSQL. If you log locally, attach a volume:
- Mount path:
/zitadel/logs - Size: based on retention needs
Networking
- Protocol: HTTP
- Internal port:
8080 - Users reach
https://example-app.klutch.shwhile Klutch.sh routes to port8080inside the container.
Health check (recommended)
curl -I http://localhost:8080/debug/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
8080. - Add environment variables for PostgreSQL connectivity and Zitadel settings (host, port, db, user, password, and any branding domains). Mark secrets as sensitive.
- Optionally attach a volume at
/zitadel/logsif you need local log retention. - Deploy. After the app starts, finish the Zitadel setup, create your admin account, and configure projects and clients.
Verification
-
Health:
Terminal window curl https://example-app.klutch.sh/debug/health -
UI: open
https://example-app.klutch.sh/ui/consoleand sign in.
Next steps
- Configure HTTPS at the edge and set
ZITADEL_DEFAULTINSTANCE_DOMAIN. - Enable backups for PostgreSQL.
- Set up OAuth/OIDC clients, service accounts, and policies as needed.