Scaling Zitadel horizontally: when a single instance stops being enough
A single Zitadel instance stops being enough when login volume grows past what one set of pods and one database can serve, or when you need to patch and restart Zitadel without interrupting sign-in for workforce, customer or partner users. Horizontal scaling means running several Zitadel pods behind a load balancer, and it works only when the database, connection limits and the setup job are designed to match. Zitadel documents Kubernetes with the official Helm chart as the high availability path, so that is the baseline this page assumes. Scaling pods is the easy part. The harder questions are how many connections the pods open to PostgreSQL, how rolling updates run schema migrations, and which component saturates first under your traffic.
The page does not give replica counts, connection numbers or throughput figures. Those depend on your workload mix, including login frequency, token issuance, introspection and user management, and on your database sizing, so they should come from load testing against your own configuration rather than from a general rule. Before you change anything, confirm with Zitadel's documentation which Helm chart values control replicas, resource requests and database settings for the version you run, and check the supported PostgreSQL range in the Zitadel database documentation. Ask your team to record current pod CPU and memory, database connection counts and login latency at peak, because those baselines decide where the first limit sits.
The sections that follow cover the pod autoscaler and disruption budgets, connection limits and PgBouncer, the separate setup job, and how to tell when the database rather than Zitadel is the bottleneck. Read them in that order if you are planning a change, and treat each one as a gate: confirm the pod layer and the database layer can each scale independently before you rely on either for zero-downtime maintenance.
Scaling options and when each one fits
This table compares the levers you can pull when a self-hosted Zitadel deployment needs more capacity, from replica count to PostgreSQL resources. Read each row for what it controls, the symptom that points to it, and what to confirm in the Helm chart or your environment before changing it. The main takeaway is that adding Zitadel pods only helps while the database still has connections and capacity to spare.
| Option | What it controls and signal that points to it | Main trade-off and what to confirm |
|---|---|---|
| Zitadel replica count | Number of API and login pods serving requests. Points here when CPU or latency on Zitadel pods rises while database metrics stay healthy. | More pods add more database connections and more load on shared components. Confirm the replica setting and resource requests in the Helm chart values. |
| Horizontal Pod Autoscaler (HPA) | Changes replica count automatically from observed metrics. Useful when load varies by time of day or by campaign. | Scaling reacts after load arrives, so bursts can outpace it. Confirm the metrics the HPA reads, the bounds you set, and that Zitadel pods have resource requests the HPA can measure. |
| Pod disruption budget (PDB) | Limits how many Zitadel pods can be voluntarily evicted at once during node drains and upgrades. Points here when maintenance causes login errors. | A strict budget can block node maintenance until pods are rescheduled. Confirm the budget in the chart and that it works with your replica floor. |
| Database connection settings in Zitadel | Maximum connections each Zitadel pod opens to PostgreSQL. Points here when logs show connection errors or the database reports exhausted connections. | Each added pod multiplies connection use, so raising this value can starve other clients. Confirm the pool settings in Zitadel's database documentation and the chart values. |
| PgBouncer connection pooling | Multiplexes many client connections over fewer PostgreSQL connections. Useful when pod count grows faster than database connection limits allow. | Adds a component to operate and monitor, and some session-level features can behave differently behind a pooler. Confirm pooling mode compatibility with Zitadel's database documentation before deploying. |
| Separate setup job | Runs database schema setup and migrations outside the serving pods. Points here when new pods race to migrate or fail readiness during upgrades. | Migrations run once, but the job must complete before new pods start. Confirm the chart option for the setup job and the order of rollout in your upgrade runbook. |
| PostgreSQL resources and limits | CPU, memory, disk I/O and maximum connections on the database. Points here when query latency or disk wait rises as replicas increase. | Database changes usually need a maintenance window and more than one node for high availability. Confirm sizing with your PostgreSQL team and the supported versions in Zitadel's database documentation. |
How requests and database connections flow through a scaled Zitadel
The diagram starts with clients and browsers reaching a load balancer, which spreads traffic across several Zitadel pods. Each pod opens database connections, optionally through a PgBouncer pool, into PostgreSQL. The separate setup job runs schema and setup work outside the serving pods, and the boundary between the cluster and the database network is where connection counts should be checked. Confirm that the total pooled connections from all pods stay within what the primary can accept.
Request path, pooled database connections and the separate setup job in a scaled deployment.
Where the database becomes the limit before Zitadel does
Adding Zitadel pods does not add database capacity. Each pod opens its own connections to PostgreSQL, so every pod you add multiplies the number of sessions the database must hold, schedule and serve. The database can saturate while the Zitadel pods still show spare CPU and memory, which makes the problem easy to miss if you only watch the application tier. Before raising the replica count in your HPA, confirm the connection budget: the pool size configured per pod, the replica ceiling you expect under load, and the max_connections value on the PostgreSQL side, minus what your other applications and administrative sessions already use. Confirm the exact database settings with your Zitadel version, since the self-hosting database documentation at Zitadel database documentation lists the supported PostgreSQL versions, 14 through 18.
Watch four signals together. Active and idle connection counts per database and per client show whether pods are holding more sessions than the database can serve well. Lock and wait time, visible in PostgreSQL's wait event views, shows whether queries are queuing rather than running. Disk I/O latency and write pressure show whether storage keeps up with the write path, and replication lag shows whether read replicas, if you use them, are falling behind the primary. Rising latency on login or token requests while pod CPU stays flat is the usual pattern that points to the database. Alert on connection saturation and on wait time before users notice slow sign-ins, and tie those alerts to the same load test used to size the rollout.
When the database is the limit, you have three levers. You can raise database capacity by moving to larger storage, more memory or faster disks, which is a recurring infrastructure cost. You can pool connections with PgBouncer or a similar pooler, so many pod-level connections share a smaller set of server connections, but confirm that your Zitadel version and configuration work with the pooling mode you choose before deployment. You can also change how work reaches the database, for example by limiting the pod ceiling, spreading load across time or tenants, or sending read-only traffic to replicas where Zitadel supports it. Tuning the event store and projections is a separate task covered in the performance tuning page for Zitadel, so change these defaults only after confirming the approach with the vendor.
How scaling differs on Kubernetes and on other installs
Zitadel recommends a Kubernetes cluster with the official Helm chart for high availability. On that platform, horizontal scaling is mostly a matter of declaring the right objects and checking how they interact, because the chart runs Zitadel as pods behind a Service and the platform team adds the controls that decide how capacity grows and how maintenance proceeds.
- Horizontal Pod Autoscaler: scales the Zitadel Deployment on a metric you choose, such as CPU or a custom signal from your monitoring stack. Set minimum and maximum replicas from load test results, not estimates, because each added pod opens more database connections.
- Pod disruption budgets: limit how many Zitadel pods node drains and cluster upgrades can remove at once. Without one, routine node maintenance can take out more pods than your login traffic can absorb.
- Probes and rolling upgrades: readiness probes should hold traffic back until a new pod is ready to serve it. Confirm the chart's probe paths and timeouts for your version before relying on them during rollouts.
- Setup job ordering: the job that prepares the database schema must complete before new application pods take traffic. Treat schema-changing upgrades as a planned step, because old and new pods may run side by side during a rolling update. The Kubernetes version skew policy governs the cluster components you upgrade around it.
- Database limits stay manual: autoscaling Zitadel does not add database capacity. Connection limits and any PgBouncer settings must be sized for the maximum replica count.
Check in the chart documentation for your Zitadel version how the setup job is triggered, what the readiness probe actually checks, and whether your upgrade path needs a maintenance window.
Docker Compose and binary installs are documented self-hosting methods, but they do not supply the scheduling, probes and rollout controls a cluster provides. Horizontal scaling on these methods means running more than one Zitadel process and placing a load balancer in front of them. The Zitadel self-hosting overview lists the methods, and the platform team should confirm multi-instance support for its chosen method before planning capacity.
- Confirm multi-instance support first: ask Zitadel whether the Compose or binary method supports multiple instances against one database at your target version. The high availability recommendation points to Kubernetes, so treat other methods as unproven at scale until confirmed.
- Load balancing replaces the Service: you need a load balancer that health checks each instance and passes HTTP/2 traffic correctly. Test session behavior, timeouts and login redirects with real flows, not only health endpoints.
- Process supervision replaces the controller: systemd, Compose restart policies or another supervisor must restart failed instances and start them in a defined order. Nothing replaces a rolling update, so plan upgrades as a stop, migrate and start sequence inside a window.
- Coordinated schema changes: run the setup step once, on one instance, before the others start on the new version. Two instances racing to migrate the same schema is a failure to reproduce in a test environment before go-live.
- Host failure remains your problem: several processes on one machine still share one point of failure. Spread instances across hosts only if the method and database layout support it.
Ask Zitadel which deployment methods it supports for multiple instances at your target version, and record the answer before you size the database, load balancer or monitoring.
Setup sequence for a horizontally scaled Zitadel
This sequence takes a self-hosted Zitadel from a pinned release to a set of serving pods that scale, drain and upgrade without dropping logins. Each step leaves a check you can run before the next one starts.
Pin the Zitadel version and read its release notes
Choose one Zitadel release and record it in your deployment repository so every environment runs the same build. Zitadel v4.19.5 was released on 15 October 2026 according to the zitadel/zitadel releases on GitHub, which is one example of a version to evaluate, but confirm the current stable release before you pin. Read the release notes for schema migrations, configuration changes and any breaking changes between your current version and the target. Check that your PostgreSQL major version is within the 14 to 18 range Zitadel documents. Done when the chosen tag, the chart version and the database version are written down together and the release notes have been reviewed by the people who will run the upgrade.
Size PostgreSQL and confirm its connection limit
Decide how many Zitadel pods you expect to run at peak, multiply by the connection pool size you configure per pod, and add headroom for administrative sessions, backups and monitoring. Compare the total with the PostgreSQL connection limit on the database you will use. Ask your database team to confirm CPU, memory and disk I/O for the event store and projections, because the database usually sets the ceiling before Zitadel does. Done when you have a written calculation showing the planned pod count times pool size stays below the configured maximum connections with room left for maintenance work.
Add PgBouncer only if the pooling mode is compatible
If your platform team requires a connection pooler, place PgBouncer between Zitadel and PostgreSQL and set the pooling mode after confirming it with Zitadel's database documentation and your own tests. Session-level pooling is the lowest-risk starting point for workloads that rely on session state, while transaction-level pooling can break features that depend on prepared statements or session settings. Confirm this with Zitadel's current documentation and a test run, not from memory. Done when a test deployment completes the setup job and a sample login and token request succeed through PgBouncer, and the pooler's server connection count stays within your PostgreSQL limit.
Run the setup job once, separately from serving pods
Run Zitadel's setup job as its own Kubernetes Job or pipeline step before any serving pods roll out, so schema changes happen once instead of racing across replicas. Ensure the job uses the same configuration, masterkey and database credentials as the serving pods, and ensure it completes before the Deployment update starts. Keep the job's logs for the change record. Done when the Job reports completed, its logs show no errors, and the database contains the expected schema version for the release you pinned.
Deploy serving pods with at least two replicas
Deploy the Zitadel serving workload with at least two replicas behind a load balancer or ingress that uses the readiness endpoint, and confirm it routes HTTP/2 traffic as your proxy requires. Two replicas are the minimum for a rolling update to keep a serving instance available, and the replica count should reflect your availability target rather than the minimum. Verify that each pod receives requests and that the login and OIDC discovery endpoints answer through the public hostname. Done when both pods are Ready, the load balancer lists both backends as healthy, and a login through the public URL completes.
Configure the HPA and the pod disruption budget
Create a HorizontalPodAutoscaler that scales the serving Deployment on a metric you have tested, such as CPU or a request-based signal exposed by your metrics stack, and set minimum and maximum replica counts that match the connection calculation from earlier. Add a PodDisruptionBudget so node drains and cluster upgrades keep a minimum number of pods available. Remember that scaling out adds database connections, so the maximum replica count must also fit the connection budget. Done when the HPA shows current and target values, and a test drain of one node leaves the PodDisruptionBudget satisfied without evicting the last available pod.
Verify readiness and liveness behavior
Configure readiness and liveness probes against the health endpoints Zitadel documents, and make readiness fail when the pod cannot serve requests, such as when the database is unreachable or the setup has not finished. Confirm that liveness does not restart pods during slow schema work or brief database latency, since a restart loop during a migration makes the outage worse. Test by stopping database access for a short period in the test cluster and watching which probes change. Done when the test shows the pod leaves the load balancer rotation when the database is unavailable and returns to rotation once it recovers, without restarts caused by liveness.
Run a rolling upgrade test in a non-production cluster
Before changing production, run the pinned upgrade path in a non-production cluster that holds a recent copy of the database and the same configuration. Run the setup job, roll the Deployment, and watch login success rate, error logs and database load during the rollout. Repeat with a node drain during the rollout to confirm the PodDisruptionBudget and probes hold. Record how long the rollout took and any errors, and compare them against your acceptance criteria. Done when the rehearsal completes with no failed logins beyond your agreed threshold and the findings are documented as the production runbook.
Keeping configuration and secrets identical across every pod
Every Zitadel pod must read the same configuration, the same database target and the same masterkey. When one replica points at a different database host, carries an older configuration file or holds a stale secret value, failures appear only on some requests, depending on which pod the load balancer picks. Logins succeed on one attempt and fail on the next, and token issues look intermittent. Because the symptoms look random, teams often lose hours debugging application code before someone compares the pods. Treat configuration as a single versioned source per environment, and make drift visible with a check that compares the rendered settings of every replica before and after each rollout.
Kubernetes stores Secrets unencrypted in etcd by default, so the secret store is part of your Zitadel security boundary. Enable encryption at rest for the API server, restrict list and watch on Secrets with least-privilege RBAC so that only the service accounts and operators that need them can read them, and consider an external store delivered through the Secrets Store CSI Driver if your policy requires secrets to live outside the cluster. Review the Kubernetes Secrets good practices page with your platform team before choosing. Confirm the masterkey handling in your chart version, including whether it is generated, supplied through an existing Secret, or injected by an external operator, and whether a change of key is supported at all.
The control plane that stores these secrets needs its own high availability decisions. The kubeadm guide describes a stacked topology, with etcd on the control plane nodes, and an external etcd topology, and Kubernetes documentation says etcd should run with an odd number of members, with five members recommended for production. Plan an etcd snapshot schedule with etcdctl snapshot save, test a restore with etcdutl, and store the masterkey alongside your database backups so that a restored cluster can read the data it was given. Ask your platform team which etcd topology and backup retention they operate, because a cluster that loses etcd quorum can lose the Secrets Zitadel depends on.
Risks that appear only after you add replicas
Adding Zitadel pods multiplies load on the database, changes how Kubernetes evicts and upgrades workloads, and can make autoscaling react to the wrong signal. Each risk below has a symptom you can see, a cause that scales with replica count, and a control to confirm before you rely on the replicas.
Connection exhaustion from pod count
Each Zitadel pod opens its own pool of PostgreSQL connections, so total connections grow as pod count times pool size. The symptom is intermittent connection errors or timeouts under normal traffic after a scale-out, often with the database connection limit reached while CPU stays low. Confirm the per-pod pool size, the total across all replicas and any surge during rollouts, then compare that sum with the database's configured maximum and with the headroom a pooler such as PgBouncer would provide.
Zitadel database docsNode drain evicting too many pods
Without a pod disruption budget, a node drain, cluster upgrade or autoscaler scale-down can evict several Zitadel pods at once, leaving too few to serve logins and token requests. The symptom is a burst of failed requests during maintenance that looks like an outage. Confirm that a pod disruption budget exists for the Zitadel deployment, that its minimum available count fits your replica count, and that a drain in a test cluster leaves enough pods running.
Schema migrations running in parallel
Zitadel runs setup and database migration steps as a separate job, and if more than one pod attempts them during a rollout, the pods compete for the same schema changes. The symptom is failed migration logs, pods restarting in a loop or a release that stalls partway. Confirm that the setup job runs once per release, that the application pods wait for it to finish, and that the rollout order is documented for your chosen install method.
Readiness before database reachability
A pod can pass a readiness check while it still cannot reach PostgreSQL, for example after a failover or network policy change, so the load balancer keeps sending it traffic that fails. The symptom is elevated error rates on a subset of pods while the rest of the deployment looks healthy. Confirm that the readiness probe reflects database connectivity through the Zitadel health endpoints, and test it by blocking the database from one pod in a staging cluster.
Version skew between API server and nodes
Adding node pools or upgrading the control plane in stages can leave the API server, controller manager, scheduler and kubelets on different minor versions. The symptom is unexpected scheduling, failed rollouts or nodes that cannot be upgraded when the cluster is upgraded again. Kubernetes requires the API server to be upgraded one minor version at a time, and kubelets may be up to three minor versions older than the API server. Confirm the version of every component against the version skew policy before each upgrade window.
Version skew policyHPA scaling on CPU while the database limits
A Horizontal Pod Autoscaler that targets CPU adds Zitadel pods when the application is busy, but when PostgreSQL is the bottleneck, extra pods add connections and lock waits without raising throughput. The symptom is replica count climbing while request latency stays high and database wait time grows. Confirm which signal limits throughput by watching database CPU, I/O and connection wait during load tests, and decide whether the autoscaler should target something other than CPU alone.
Questions buyers ask before scaling Zitadel
What drives the cost and effort of a Zitadel scaling project?
The main drivers are how many Zitadel pods and database connections the current setup needs, how much of the database layer must change, and how many environments must be proven before go-live. Cost comes from the people doing the work: platform engineers who build the Kubernetes changes, database specialists who size connection limits and pooling, and testers who run load scenarios. Expect one-time work for the design, build and load testing, and recurring work for upgrades, scaling reviews and on-call changes afterward. Ask any partner for a written scope that lists each environment, each component touched and each test run, because that list is what the quote should follow.
Can our platform team scale Zitadel without outside help?
Often yes, if the team already runs Kubernetes, PostgreSQL and a reverse proxy in production and has tested Zitadel in a non-production environment. Zitadel documents Kubernetes with the official Helm chart as its high availability path, so experienced Kubernetes staff have a clear starting point. The gaps usually sit in the database layer, where connection budgets, pooling and failover behavior need careful testing, and in the load testing that proves the change. Assess your team against those specific skills. If the team lacks recent PostgreSQL tuning or load testing experience, an outside review of the design before changes reach production is a reasonable middle option.
How long does a Zitadel scaling project take, and why is no duration given here?
No duration is given here because the timeline depends on facts this page cannot know: the current topology, the Zitadel and PostgreSQL versions in use, how many environments exist, whether the database must be resized, and how long your change approval and load test windows take. Two of those inputs matter most: the supported PostgreSQL range and the Zitadel release you run, since both change the steps. Ask for a timeline that breaks the work into design, non-production build, load testing, production change window and post-change review, and ask which of those steps depend on your own approvals or schedules.
What does the work need from our organization?
Plan for access and time from several teams before work starts:
- Cluster access to the Kubernetes environment where Zitadel runs, with rights to change deployments, autoscaling and disruption budgets in staging and production
- Database access to the PostgreSQL servers that hold the Zitadel event store and projections, including the ability to read connection and resource metrics
- Load test windows in a non-production environment that resembles production, plus a planned window for the production change
- On-call coverage during the change and for the first days after it, with a named owner for rollback decisions
Confirm each item with your own security team, since access to production databases and cluster credentials usually needs formal approval.
Is PgBouncer required when scaling Zitadel horizontally?
PgBouncer is not a fixed requirement, but it is a common answer to a specific problem. Each Zitadel pod opens database connections, so adding pods multiplies the connection count against PostgreSQL. A connection pooler such as PgBouncer can keep that count within the database's limits, but it changes how sessions behave, so you must confirm that Zitadel's database usage works correctly through the pooler in the versions you run. Check the Zitadel database documentation for supported PostgreSQL versions, which are 14 through 18, and test pooling modes in staging before adopting one. If your current connection count stays well below the database limit at your target pod count, a pooler may not be needed.
When should we involve Zitadel engineers or an Enterprise support plan?
Involve Zitadel engineers when a scaling change touches defaults that affect the event store, projection timing or push behavior, because those settings interact with database load in ways that are hard to predict from outside. The Zitadel pricing page lists custom support agreements and technical account management in the Enterprise plan, which is the documented route for that kind of support. Ask Zitadel to confirm the support terms, response expectations and escalation path in writing, since the pricing page does not list them in detail. For a self-hosted deployment, decide before go-live whether the support plan is worth its cost compared with an outside partner or in-house expertise.
What goes wrong when the database becomes the limit instead of Zitadel?
Adding Zitadel pods does not help once PostgreSQL is saturated. Symptoms include rising connection errors, slower logins across all pods, growing disk I/O waits and projection lag, while Zitadel pods show spare CPU. The fix may involve connection limits, pooling, larger database resources or storage changes rather than more Zitadel replicas. Measure database connections, CPU, memory, disk latency and replication health during load tests, and set the pod count only after you know which resource runs out first. Adding pods beyond that point can make the outage worse by opening more connections.
How DeployOpen scopes and delivers a Zitadel scaling project
DeployOpen approaches horizontal scaling for Zitadel as a written, fixed-scope project inside your own Kubernetes cluster and PostgreSQL environment. We start from measured load and database behavior, then change pod scaling, connection limits and setup jobs in a sequence you can review and verify before go-live.
How we scope
- Review your current Zitadel topology, Helm chart version, PostgreSQL version and connection budget before agreeing the work.
- Agree in writing which workloads need scaling, which load profiles must be met and which tests prove it.
- Confirm who owns the Kubernetes cluster, the PostgreSQL service, PgBouncer and any load balancer changes.
- Record out-of-scope items such as event store redesign or Zitadel code changes so the boundary is explicit.
How we build
- Configure pod autoscaling and disruption budgets in a staging cluster that mirrors your production settings.
- Set database connection limits and, where needed, PgBouncer pooling, then check that pool sizes match replica counts.
- Move schema setup into separate jobs so rolling updates do not race on migrations.
- Run the published k6 scenarios against staging and record where the database, not Zitadel, becomes the constraint.
How we hand over
- Deliver the Helm values, manifests and PgBouncer configuration as versioned files in your repository.
- Document the scaling thresholds, connection budget arithmetic and the reasoning behind each chosen setting.
- Walk your platform and database teams through a rollback path and the signals that should trigger a review.
- Provide a test report listing the scenarios run, the environment used and the results, with open items named.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after the initial project closes.
- Retest scaling settings when you move to a newer Zitadel release, Kubernetes minor version or PostgreSQL major version.
- Confirm with your team which metrics and alerts you will watch, and check them against the agreed thresholds.

