# Self-host ZITADEL

> An identity and access management server with single sign on and OIDC.

- Page: https://levelrail.com/templates/zitadel/
- JSON: https://levelrail.com/templates/zitadel.json
- Category: Security
- Licence: AGPL-3.0 (Network copyleft (AGPL) license)
- Source: https://github.com/zitadel/zitadel
- Upstream docs: https://zitadel.com/docs

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 17-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| db | postgres | 17-alpine | none | zitadel_db_data -> /var/lib/postgresql/data |
| zitadel | ghcr.io/zitadel/zitadel | v4.16.0 | 8080 | none |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| db | PGUSER | preset |
| db | POSTGRES_DB | preset |
| db | POSTGRES_PASSWORD | generated |
| zitadel | ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD | generated |
| zitadel | ZITADEL_DATABASE_POSTGRES_ADMIN_SSL_MODE | preset |
| zitadel | ZITADEL_DATABASE_POSTGRES_ADMIN_USERNAME | preset |
| zitadel | ZITADEL_DATABASE_POSTGRES_DATABASE | preset |
| zitadel | ZITADEL_DATABASE_POSTGRES_HOST | preset |
| zitadel | ZITADEL_DATABASE_POSTGRES_PORT | preset |
| zitadel | ZITADEL_DATABASE_POSTGRES_USER_PASSWORD | generated |
| zitadel | ZITADEL_DATABASE_POSTGRES_USER_SSL_MODE | preset |
| zitadel | ZITADEL_DATABASE_POSTGRES_USER_USERNAME | preset |
| zitadel | ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINV2_REQUIRED | preset |
| zitadel | ZITADEL_EXTERNALDOMAIN | preset |
| zitadel | ZITADEL_EXTERNALPORT | preset |
| zitadel | ZITADEL_EXTERNALSECURE | preset |
| zitadel | ZITADEL_MASTERKEY | generated |
| zitadel | ZITADEL_TLS_ENABLED | preset |

## Deploy

### CLI

```bash
levelrail-cli templates deploy zitadel --name my-zitadel
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/zitadel/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## Questions

### Can I deploy ZITADEL on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id zitadel for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image postgres:17-alpine, ghcr.io/zitadel/zitadel:v4.16.0 is what you deploy there.

Self-host ZITADEL, ZITADEL docker compose file, deploy ZITADEL on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
