Zitadel

Deploy Zitadel self-hosted with Docker Compose or Kubernetes on PostgreSQL. Plan multi-tenant organizations, OIDC, SAML, SCIM and Login V2, then prove backup, restore and upgrades.

On this page

What is Zitadel and where does it fit when you self host it?

Zitadel is a self-hostable identity platform for customer, partner and workforce identity. It issues tokens over OpenID Connect and OAuth 2.0, acts as a SAML 2.0 identity provider, and runs on PostgreSQL in infrastructure you control. Teams usually choose it for customer identity (CIAM) and B2B products, where each customer organization needs its own users, login policy, branding and delegated administrators. It can also give internal applications single sign-on by brokering an existing directory.

Login options include passkeys (FIDO2/WebAuthn) and MFA with OTP, U2F, email OTP and SMS OTP, according to the Zitadel GitHub repository. Upstream sources include LDAP, enterprise identity providers and social logins. The same repository says self-hosted installations and Zitadel Cloud run the same codebase, and that Cloud regions are the US, EU, AU and CH. This page covers the self-hosted path with Docker Compose or Kubernetes.

An instance is the top-level identity system. Inside it, organizations hold users and policies, projects group applications and roles, and project grants let one organization delegate roles in its project to another. Data and policy scoping follow this hierarchy. Decide early how customers, partners and internal teams map to these objects. Changing the mapping after people have signed in means moving users, grants and role assignments.

Zitadel stores every change as an immutable event in PostgreSQL and builds query views from those events. The event store only appends data, so the audit trail and the current state are the same data. That gives a built-in audit trail and one clear backup target. It also makes database health the same thing as identity health.

How do you connect applications, SAML and upstream identity to Zitadel?

Applications

Register each application with the protocol it supports. Use OIDC for web, mobile and API clients, SAML 2.0 for older enterprise software, and device authorization for clients without a browser. Record redirect URIs, token lifetimes and the role claims each one reads. Keep SAML service provider details in the same client register.

Upstream identity providers

Broker logins from LDAP directories, enterprise identity providers and social logins. For B2B tenants, domain discovery routes users to their company's provider by email domain. Test what happens when the upstream account is disabled, and record who approves each new provider and domain entry.

Machine identities

Service accounts authenticate with JWT profile, personal access tokens or client credentials. Zitadel also lists token exchange and impersonation for machine-to-machine flows. Give each service account an owner, a scope and a rotation date, and keep the inventory current as applications change.

Provisioning and events

Zitadel includes a SCIM 2.0 server for inbound provisioning, and Actions for webhooks, custom code and token enrichment. Review every action and webhook target like code, since each can change who gets access. Document which system owns each user record so SCIM and manual changes do not conflict.

Audit events and SIEM

Instance administrators can view events in the Console at $CUSTOM_DOMAIN/ui/console/events. The event API requires a service account, and events can be streamed to SIEM or SOC systems. Create that service account early, give it a narrow scope, and confirm the security team receives policy and administrator changes.

Which Zitadel topology fits: Docker Compose, Helm on Kubernetes or air-gapped?

Docker Compose with the Zitadel API, the login service and PostgreSQL is enough to model tenants, test integrations and rehearse an upgrade. The Compose guide requires Docker Engine 24 or later and at least 2 GB RAM, and the requirements page needs Compose v2.x, not the V1 docker-compose CLI. The guide positions Compose for getting started and points to the Helm chart for production. Use the production hostname pattern so issuer URLs and redirect URIs behave the same way. Change the default admin password before first start. The Linux guide is for development or demonstration only and does not work for Zitadel 4.

Which production settings must be settled before go-live?

These follow the Zitadel production checklist and the self-hosting docs, plus the settings that are hard to change once tenants exist.

SettingDecisionCheck
PostgreSQLRun a highly available PostgreSQL on an internal network, on a version the target release supports. The database docs list PostgreSQL 14 to 18, and PostgreSQL 18 needs Zitadel v4.11.0 or newer. Do not use sslmode disable outside local development.A primary failover is tested while users sign in, and connection limits hold under expected load.
Managed database rolesOn managed databases without superuser access, an administrator pre-creates the role and database, and the service user then runs zitadel init schema. The DSN is set through ZITADEL_DATABASE_POSTGRES_DSN.A clean environment initializes with the pre-created role, and the DSN comes from a secret.
MasterkeyGenerate a masterkey of exactly 32 characters before first start and keep it in a secrets manager, separate from database backups. The Compose guide says it cannot be changed later without losing access to encrypted data.The recovery runbook can retrieve the key without depending on the Zitadel instance it protects.
External domainSet ExternalDomain, ExternalPort and ExternalSecure to the address users and applications reach through the proxy. The update guide says they are applied only during setup. A mismatch causes Instance not found errors, which the Compose guide calls the most common deployment issue.Discovery documents and issuer URLs show the public hostname over HTTPS.
Edge and TLSUse a trusted certificate on a fully qualified domain name and a layer 7 WAF or proxy with HTTP/2, rate limiting and bot detection. The requirements page lists tested proxies: Traefik v3.x, NGINX v1.x stable, Caddy v2.x and Apache httpd 2.4.x.Browser, gRPC and REST traffic all pass the proxy, a test client triggers the rate limit, and the firewall also filters IPv6.
CacheRedis is an optional cache. The requirements page says it must run in standalone mode, because cluster and Sentinel are not yet supported.If a cache is used, it runs standalone and a test shows Zitadel behavior when the cache is unavailable.
First instance and settingsThe Compose quickstart uses the default admin password Password1!, which the guide says to change before first start with ZITADEL_FIRSTINSTANCE_ORG_HUMAN_PASSWORD. The checklist also suggests applying settings with the Terraform provider so they are repeatable.No default credential remains, and a rebuilt environment reproduces the same settings.

How do you harden Zitadel and prove backup and restore work?

Set login policies per organization: required MFA or passkeys, password rules, lockout and session lifetimes. Record which policy each organization inherits and which it overrides. Keep instance administrators in a dedicated organization, and restrict who can create organizations, add identity providers or edit actions. Send audit events to the SIEM the security team already watches.

Back up PostgreSQL with a method that supports point-in-time recovery, and keep the masterkey and configuration with the recovery runbook. The production checklist asks for regular database backups and restore tests before going live. The event store is the record that matters most, since projections can be rebuilt from it. A restore test should start Zitadel against the restored database in an isolated network, then sign in as a human user, obtain a token for a test application and authenticate a service account.

Harden the edge as the checklist describes: a layer 7 WAF with HTTP/2, rate limits on specific endpoints, bot detection and IP restriction where needed. Before enabling the instance-wide loginV2 feature, create a break-glass machine user with IAM_OWNER and a personal access token. The Login V2 guide says rollback is possible with PUT /v2/features/instance setting loginV2.required to false, so rehearse that path before you rely on it.

What do the Zitadel AGPL license and version changes mean for a deployment?

Confirm each point against the release notes for the exact version you deploy. Sources include the licensing FAQ and the v3 announcement.

TopicWhat to knowDeployment impact
LicenseStarting with v3, Zitadel moved its backend components from Apache 2.0 to AGPL 3.0. SDKs, tools and proto definitions stay under Apache 2.0, and clients generated from the protos do not need to be AGPL.Modified versions or derivative works of the AGPL-covered backend must also be AGPL 3.0. Review AGPL with counsel if you modify Zitadel and offer it to others.
Commercial licenseZitadel offers a commercial license for users who cannot meet AGPL 3.0 requirements. It permits modification and redistribution without open-sourcing your own code. The FAQ says Zitadel Cloud, Free or Pro, is not affected by the change.Legal review should settle the license path before production, and the choice should be recorded with the project.
DatabaseThe v3 announcement of March 13, 2025 says v3 and later drop CockroachDB support and make PostgreSQL the standard backend. CockroachDB support continued in maintenance mode for v2.x until September 30, 2025.Deployments still on CockroachDB must move to PostgreSQL before upgrading to v3 or later.
Release cadenceThe announced plan is a major release every 3 months, a minor release every 2 weeks, patch releases as needed, and release candidates before each major release.Pin an exact version, run setup with every new version, and test each upgrade on a staging copy of production data.
Login UIZitadel v4.0.0, released July 31, 2025, made Login V2 the default for new customers. It also added a resource-based v2 API, ConnectRPC for new APIs and the opt-out Service Ping.The Login V2 guide says staying on Login V1 is supported and is the right default unless there is a concrete reason to move. Treat a move as a change of its own.
Current releaseOn the releases page checked on 2026-12-04, the latest release is v4.21.0, dated 01 Dec 2026. Patch releases v4.20.2 through v4.20.8 appeared between 09 Nov and 01 Dec 2026.Patch releases arrive often, so plan a routine to review them and recheck the notes before each deployment.

How do you migrate to Zitadel or move from CockroachDB to PostgreSQL?

Typical sources are Keycloak, a hosted identity service or an identity layer built into the application. Inventory users, password hash formats, MFA enrollments, identity provider links, clients, redirect URIs and the claims each application reads. Role claims differ between products, so code that parses tokens may need changes. Map each source tenant or realm to Zitadel organizations and projects, import users through the API, and plan password resets for hashes your version cannot import and MFA re-enrollment unless factors can be carried over.

For a database move, the zitadel mirror command copies data between databases, mainly to migrate from CockroachDB to PostgreSQL, and zitadel mirror verify compares row counts afterward. The mirror docs say encryption keys must be copied to the destination, the deployment's domain cannot be changed, and the same masterkey and TLS mode must be kept. Rehearse the copy on a staging snapshot first.

Cut over one application at a time. Run the old and new issuers side by side, move a low-risk application first, and keep a rollback path that points the application back to the previous issuer until token validation, session behavior and logout are confirmed.

Who owns what when Zitadel runs in production?

Identity sits in front of every application that uses it, so name owners for the platform, the tenants and the integrations.

Platform team

  • Runs Zitadel, the login service, PostgreSQL and the proxy.
  • Pins versions and rehearses upgrades and restores.
  • Watches database connections, latency and errors.
  • Tracks patch releases and runs setup with each new version.

Identity administrators

  • Create organizations and apply login policies.
  • Approve identity providers and domain discovery entries.
  • Handle delegated administrator requests.
  • Keep the organization and policy map current.

Application teams

  • Register clients with exact redirect URIs and minimal scopes.
  • Validate tokens and role claims, and implement logout.
  • Own and rotate their service account credentials.

Security

  • Reviews administrator roles, actions and webhooks.
  • Alerts on policy changes from audit events.
  • Protects the masterkey and backups.
  • Holds the break-glass machine user and tests its use.

Zitadel self-hosting questions

Should each customer get an organization or an instance in a multi tenant Zitadel setup?

Organizations are the usual unit for B2B tenants inside one instance. Each can have its own users, policies, branding and identity providers, and project grants let one organization delegate roles to another. Separate instances add stronger separation and separate administration, with more objects to operate. Choose based on how much isolation contracts and regulators require, and decide before users sign in, because moving users and grants later is work.

What proves a Zitadel restore worked?

Zitadel starts against the restored database with the original masterkey. A test user signs in with MFA, an application receives a valid token, a service account authenticates, and audit events are present up to the recovery point. Run the test in an isolated network so the restored copy cannot talk to live systems, and keep a record of the result with the runbook.

Can Zitadel run in an air-gapped network?

Yes, with images and the Helm chart mirrored into an internal registry, and with SMTP, SMS and identity providers reachable inside the network. Turn off Service Ping if policy requires it, and review any action or webhook that calls an external endpoint. Because setup must run each time a new version is deployed, plan upgrades as a repeatable process for moving mirrored artifacts into the network.

Does the Zitadel AGPL license affect my deployment?

Starting with v3, the backend components are AGPL 3.0, while SDKs, tools and proto definitions stay under Apache 2.0. The licensing FAQ says modified versions or derivative works of the AGPL-covered backend must also be AGPL 3.0. A commercial license exists for users who cannot meet those terms. If you modify Zitadel and offer it to others, review the terms with counsel.

How do I migrate from CockroachDB to PostgreSQL for Zitadel?

Zitadel v3 and later drop CockroachDB support, so move to PostgreSQL before upgrading. The zitadel mirror command copies data between databases, and zitadel mirror verify compares row counts afterward. Copy the encryption keys, keep the same masterkey and TLS mode, and do not change the domain. Check the PostgreSQL version against the target release, since PostgreSQL 18 needs Zitadel v4.11.0 or newer.

What changes when moving from Keycloak, and how does Zitadel compare?

A feature comparison depends on your requirements, so start with an inventory. List users, password hash formats, MFA enrollments, identity provider links, clients, redirect URIs and claims. Map each realm to Zitadel organizations and projects. Role claims differ between products, so token-parsing code may need changes. Run the old and new issuers side by side and move applications one at a time with a rollback path.

What happens if the Zitadel masterkey is lost or changed?

The masterkey encrypts sensitive data at rest. The Compose guide says it must be exactly 32 characters, must be set before first start, and cannot be changed later without losing access to encrypted data. Store it in a secrets manager separate from database backups, and make sure the recovery runbook can retrieve it without depending on the Zitadel instance it protects. A restore needs the original key.

How does Zitadel Cloud pricing compare with self-hosting?

Zitadel Cloud offers Free and Pro tiers in the US, EU, AU and CH regions, and it runs the same codebase as self-hosted installations. Current prices are on Zitadel's own pricing page, so check there. Self-hosting adds the cost of running PostgreSQL, the proxy, backups and upgrades yourself, and it keeps identity data in infrastructure you control. The AGPL change does not affect Cloud users.

What does a Zitadel deployment involve and what do you receive at handover?

Effort depends on the number of tenants and applications, upstream identity providers, the migration source and its password formats, availability targets, the PostgreSQL platform and whether the network allows outbound access. Tenant design and application cutover usually take more time than installing Zitadel.

DeployOpen plans the tenant model, deploys Zitadel, the login service and PostgreSQL in your environment, hardens the edge and administration, integrates identity providers and applications, sets up backups, tests a restore and documents upgrades.

Handover includes the configuration repository, organization and policy map, client register, service account inventory, restore test record and support route.

Sources and further reading

More on Zitadel

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.