Running Zitadel on managed PostgreSQL: what changes without a superuser
Platform teams that want Zitadel inside their own cloud account, on RDS, Cloud SQL or Azure Database, often start from one constraint: the managed service does not give them superuser access. That is workable. Zitadel uses PostgreSQL as its database, and self-hosted deployments support versions 14 through 18. The change is in who creates the objects. Your team creates the database role and the database ahead of time, with the privileges Zitadel needs, and then runs the Zitadel setup phase that builds the schema. The provider's control plane handles the rest, such as backups, patching and instance sizing, which are usually the reasons a team chose a managed service in the first place. Confirm the exact role attributes and extension requirements with the Zitadel database documentation for your release before you ask the cloud team to create anything.
Two steps still run inside Zitadel and cannot be skipped. Provisioning the user and database by hand does not replace zitadel init schema, which creates the eventstore, projections and system schemas. Run it with the privileged setup credentials you have been given, then start the service with the lower-privileged role. Keep those two credential sets separate in your secrets store so the runtime account never holds rights to change schema. If your provider restricts specific privileges, test the init step in a staging instance first, since a failure at this stage is easier to fix before production data exists.
This model suits teams whose cloud provider already manages PostgreSQL for other workloads, whose security policy forbids shared superuser accounts, and whose compliance reviewers want least-privilege database access documented per service. It is less suitable where you need operating system access to the database host or extensions the provider does not offer. Ask the provider which PostgreSQL minor version it currently runs, how it handles major upgrades, and whether point-in-time recovery is enabled, since those answers decide how much of the operating work stays with your team.
How Zitadel connects to a managed PostgreSQL instance
The admin provisions a database role and database on the managed instance, then runs the init, setup and start phases of Zitadel in order. Init and setup create the schemas Zitadel needs, so the start phase only serves traffic. The API and Login services reach the managed endpoint over TLS, optionally through PgBouncer inside the client network. Check that the managed instance is outside the trust boundary and that every connection uses sslmode set to require or verify-full.
Admin, Zitadel phases and services connecting to a managed PostgreSQL across the trust boundary.
Which connection and pooling options fit your environment
This table compares the TLS modes, direct connections and PgBouncer pooling modes available for Zitadel on a managed PostgreSQL service. Read each row for the situation it fits, the trade-off it brings, and the setting to confirm with your provider or in the Zitadel configuration reference before you commit.
| Option | When it fits | Trade-off | Confirm before choosing |
|---|---|---|---|
| sslmode require | Managed service whose CA is not yet mounted in Zitadel's containers or hosts, and where the network path is already private | Encrypts traffic but does not verify the server certificate, so a spoofed endpoint could still receive credentials | Whether your service enforces TLS and which mode the Zitadel configuration reference expects |
| sslmode verify-full | Production clusters where you can mount the provider's CA bundle and match the server hostname | Needs CA distribution, rotation handling and hostname matching in every Zitadel process | The provider's CA bundle location, rotation schedule and endpoint name to use in the connection string |
| Direct connection to the managed endpoint | Small or moderate deployments where Zitadel's own pool sizing fits within the instance connection limit | Every Zitadel replica opens its own connections, so scaling replicas can exhaust the database connection limit | Maximum connections your instance class allows and whether the provider exposes a reader or writer endpoint |
| PgBouncer in transaction mode | Many Zitadel replicas or short-lived connections that need multiplexing against a limited managed connection count | Server-side session state does not persist between transactions, so features relying on session settings or prepared statements need testing | Whether your Zitadel version works with transaction pooling and which pool_mode your PgBouncer build supports |
| PgBouncer in session mode | Workloads that need session-scoped behavior while still reducing the number of server connections | Fewer multiplexing gains than transaction mode, so connection savings are smaller | Whether the session model satisfies Zitadel's database access pattern in your release |
| Zitadel pool size settings | Tuning the number of open connections each replica holds to match the database limit | Too many connections across replicas exhausts the server, too few slows requests under load | Exact default values and key names in the Zitadel configuration reference for your release, plus the connection limit of your managed instance |
| Managed provider connection proxy | When the provider offers its own proxy or pooler that handles TLS and failover endpoints | Adds another hop to troubleshoot and may change connection behavior during failover | Whether the proxy is supported with Zitadel and how it handles failover and idle timeouts |
How to provision the role, database and schema step by step
This sequence gives Zitadel a dedicated, non-superuser PostgreSQL login and database on a managed service, with the schema created and checked before the application starts.
Confirm the managed PostgreSQL version and settings
Before creating anything, confirm the managed PostgreSQL engine version is one Zitadel supports, which is versions 14 through 18 according to the Zitadel database documentation. Check the end-of-support dates in the PostgreSQL versioning policy, since version 14 is listed as supported only until November 12, 2026. Record the instance endpoint, the port, and whether the provider offers a server CA bundle for verify-full. The step is done when you have a written version, endpoint and CA source that the rest of the sequence will use.
Create the login role without superuser rights
Using the cloud console or infrastructure as code, create a dedicated login role for Zitadel with a generated password stored in your secrets manager. Use the provider's admin account only for this step, and do not grant the role superuser, create-role or create-database attributes that are not required. The check is a query run as the admin account that lists the role and shows it is not a superuser. Your managed service may use its own role-management mechanism, so confirm the exact steps with the provider documentation.
Create the database and grant the required privileges
Create an empty database owned by the admin account or a dedicated owner role, then grant the Zitadel role the privileges it needs on that database. Zitadel's database documentation describes what the role must be able to do, so confirm the privilege list against that page before granting anything beyond it. Avoid granting access to other databases on the instance. The check is a connection as the Zitadel role to the new database followed by a query that confirms it can create objects in the schema it will use, and cannot read other databases.
Enforce the connection mode and test it
Set the sslmode value you chose for the connection, which should be require or verify-full for a managed database, never disable. For verify-full, mount or reference the provider's CA bundle. Connect with the Zitadel role using psql or an equivalent client with that sslmode, and run a query such as showing the SSL status of the session. The step is done when the connection succeeds with the expected mode and the session reports SSL in use. A failure here usually indicates a CA or hostname mismatch, which you should resolve before continuing.
Run zitadel init schema with the dedicated user
Run zitadel init with the dedicated Zitadel role and the configured connection settings, so the eventstore, projection and system schemas are created under that role. The Zitadel database documentation states that init schema must still run even when the user and database were provisioned manually. Run it from the same environment that will later run setup and start, so configuration matches. The step is done when the command exits without errors and the log reports the schema creation completing.
Verify the eventstore, projection and system schemas
Connect as the Zitadel role and list the schemas in the database to confirm the eventstore, projection and system schemas exist and contain tables. Check that the objects belong to the Zitadel role and that the role can read and write them. Keep the output with your change record, since it is the evidence that initialization worked before the application is started. Use the schema names your installed Zitadel version creates, which you can confirm in the database documentation for that release.
Run setup, then start Zitadel
Run zitadel setup with the same configuration, then start the service in its start phase. Setup completes the instance configuration on top of the schema, and start serves traffic. Confirm the service reports healthy and that the logs show a successful database connection with the sslmode you configured. The step is done when the readiness endpoint responds and no database errors appear in the first startup logs. If you plan to add PgBouncer, test this sequence first without it so any later issue is easier to isolate.
Why zitadel init schema still runs when the superuser is absent
Provisioning the database role and the database by hand does not remove the need for zitadel init. Without a PostgreSQL superuser, your team or the managed provider's console can create the Zitadel login role and an empty database, but Zitadel still has to create the eventstore, projection and system schemas that the product depends on. The Zitadel database documentation describes this split, and it is the first thing to confirm before you plan the run book. Treat provisioning and schema creation as two separate privileged steps with two separate owners.
During provisioning, a platform administrator holds the privileges needed to create the role and database, and grants the Zitadel init role enough rights to create schemas in that database. The init step runs under that role, creates the schemas, and then hands over to the runtime role used by zitadel start. The runtime role should only need to read and write data and should not own the schemas. If it owns them, a compromised application process can alter or drop the eventstore, and schema migrations on later upgrades become harder to review. Keep the init credentials out of the long-running service configuration and rotate them after the first run.
Ask the managed provider three questions before the first run. Which PostgreSQL extensions can be enabled for a non-superuser role, and does Zitadel's init step need any of them in your version? Which parameter group settings can you change, such as connection limits, SSL enforcement and statement timeouts? And can the provider's administrative role create schemas in the target database without granting superuser? Confirm the answers against the version you plan to run, since the supported PostgreSQL range for your Zitadel release is stated in the Zitadel documentation.
Securing the managed database connection and credentials
A managed PostgreSQL service removes much of the operating work, but the connection from Zitadel to the database still needs deliberate choices. The cards below cover how the connection is encrypted, how the database trusts its certificate, which role Zitadel holds, how its password is rotated, how traffic reaches the database, and how access is recorded.
Choose sslmode require or verify-full
Managed PostgreSQL endpoints accept encrypted connections, and Zitadel's sslmode setting decides how strictly the client checks the server. Never use disable for a managed database, because credentials and identity data would cross the network in plain text. require encrypts traffic without checking the server certificate, while verify-full also checks the certificate chain and host name, which protects against a spoofed endpoint. Confirm which mode your team can enforce and test it against the actual endpoint name before go-live. The sibling TLS page covers the configuration details.
Distribute the provider CA certificate
For verify-full, Zitadel's runtime needs the CA bundle that signs the managed database's server certificate. Cloud providers publish their own CA bundles, and those bundles change when certificates are renewed. Decide where the bundle lives (a container image, a mounted Kubernetes secret or a file on the host), who updates it, and how a rotation is rolled out without a long outage. Ask the provider which CA chain applies to your region and engine version, and test a deliberately wrong bundle to confirm that connections fail as expected.
Give Zitadel a least-privilege role
Pre-provision a login role that owns only the Zitadel database, and do not hand it the managed service's administrative account. Zitadel's documentation states that zitadel init schema must still run to create the eventstore, projections and system schemas, so the role needs the rights that step requires and no more. Review which privileges the setup phase needs compared with the runtime phase, and consider separate credentials for each if your policy requires it. Confirm the exact grants with Zitadel's current database guidance before you finalize them.
Rotate and store the database password
Keep the database password in a secrets manager or the platform's secret store, and pass it to Zitadel through a file or environment mechanism your deployment supports. Plan rotation as a routine operation: create the new credential, update the secret, restart Zitadel components in a controlled order and then revoke the old credential. Check whether your managed service supports automated rotation and whether it integrates with the secrets store you already run. Never place the password in a configuration file committed to source control.
Keep the database on a private endpoint
Place the managed database on a private network path that only the Zitadel workloads can reach, such as a private IP inside your VPC or VNet, or a private endpoint. Remove public access where the service allows it, and restrict the security group or firewall rules to the Zitadel subnets and the administrative jump path. Verify the network from the Zitadel side with a connection test, and confirm that DNS resolves the database name to the private address in every environment.
Enable audit logging on the service
Turn on the managed service's audit and connection logging so that authentication attempts, administrative changes and privilege grants are recorded outside the application. Decide where the logs go, how long they are kept and who may read them, and check that they cover the role Zitadel uses. Ask the provider which log categories are available for your engine version and whether they can be exported to your security monitoring. Test by making a deliberate failed login and confirming that it appears in the log.
Operating the database under Zitadel: upgrades, backups and failover
Database operations under Zitadel divide into three tasks with different risk profiles: minor updates, major upgrades and recovery or failover. Minor PostgreSQL releases never change the internal storage format, so applying one means replacing executables and restarting, which the managed service usually performs in its maintenance window. Confirm with your provider which minor versions it offers and when it applies them, and test the restart against a staging Zitadel so you can see how the API and Login containers reconnect after the database returns. Keep the Zitadel version and the PostgreSQL major version on a written compatibility matrix that your team reviews before any change.
Major upgrades carry the most risk. Supported major versions for Zitadel are 14 through 18, and the PostgreSQL versioning policy lists 14 as supported only until November 12, 2026, so plan the move off 14 before that date. Before any major upgrade, run a Zitadel compatibility check against the target version, because the database version Zitadel supports is only one part of the change. On a managed service, the upgrade path is usually an in-place upgrade or a new instance fed by logical replication. Logical replication works between different major versions and can keep downtime to several seconds, but it needs the Zitadel schema and the publication configured on the source first. PostgreSQL 18 pg_upgrade retains planner statistics across major upgrades, which shortens the post-upgrade slow period, and you should confirm with the provider whether its managed upgrade uses that path.
Backups and failover need tests with Zitadel running, not just documentation. Ask the provider to confirm the point-in-time recovery window, the retention period and whether a restore creates a new instance with a new endpoint, since Zitadel's connection settings will then need to change. Run a restore drill into a separate instance, start Zitadel against it and confirm that logins and the admin console work. Read replicas are read-only, so do not send Zitadel's write traffic to them. PostgreSQL does not detect a primary failure on its own, so confirm what your managed service's failover does, how long DNS or endpoint switching takes, and whether Zitadel reconnects without a restart. Rehearse a planned failover with live logins to measure the outage your users will see.
Questions teams ask before running Zitadel on managed PostgreSQL
How much effort does running Zitadel on managed PostgreSQL take?
The effort depends mainly on how much of the database setup your provider lets you control, and on how many environments need the same pattern. Teams typically spend time on four areas: creating the role and database without superuser rights, running zitadel init and zitadel setup against that database, choosing TLS and connection settings, and testing failover and restore behavior with the managed service. Each area is short on its own, but the verification work across staging and production is what usually takes longest. Ask any partner to split its quote by these areas so you can see which parts your team already covers.
Can our in-house team run this without outside help?
Yes, if your team already operates managed PostgreSQL and has someone comfortable with Zitadel's configuration and its setup phases. The skills needed are cloud database administration, Linux or Kubernetes operations, and basic TLS. The most common gap is not the initial install but the upgrade path, where a new Zitadel release may need the schema step run again and the database service may need a major version change planned around it. Be honest about who will own those upgrades for the next several years before deciding.
What do we need to provide for an engagement like this?
Expect to provide access to the cloud account or subscription that hosts the managed database, the network design for private connectivity between Zitadel and the database, and a change window for any step that restarts Zitadel or alters the database. You will also need to name an approver for the role and database definitions, since these are the controls your security and compliance teams will review. Confirm the exact access model in writing with any provider, including which accounts they will use and how that access is removed at handover.
Is PgBouncer required when Zitadel uses managed PostgreSQL?
PgBouncer is not required for every deployment, but it becomes more useful as the number of Zitadel replicas, or the number of services connecting to the same managed instance, grows. A connection pooler limits how many server connections your fleet opens, which helps when managed databases cap connections based on instance size. Check the connection limit for your managed tier, the pool size Zitadel opens per replica, and whether any pooling mode you choose conflicts with the way Zitadel uses the database. PgBouncer is documented at PgBouncer, and its settings should be tested under realistic load before production.
Will we ever need superuser access to the managed database?
Usually not. Zitadel's documentation states that the user and database can be provisioned manually without a PostgreSQL superuser, but zitadel init must still run to create the eventstore, projection and system schemas. That means the role used for setup needs enough privilege to create those objects, while the runtime role needs only what Zitadel requires. Ask your provider which privileges the managed service reserves for itself, and confirm with Zitadel's database documentation which grants each phase needs before you agree on the role model.
How is this work scoped and priced?
DeployOpen works from a written scope, and most engagements are fixed-scope, so the scope, deliverables and timeline are agreed in writing before work starts. A quote follows from that scope, and DeployOpen does not publish a price list. The main cost drivers are the number of environments, the number of database instances and replicas, whether high availability and backup testing are included, the connection and TLS design, and how much change control your organization requires. Ask for the quote to list one-time setup work separately from any recurring upgrade, monitoring or support retainer.
What should we test before going live on managed PostgreSQL?
Test the full path rather than only the first connection. Confirm that the setup role can run the initialization steps, that the runtime role can start Zitadel and serve login, and that TLS verification works with the CA your provider issues. Then rehearse a restore from the managed service's backup into a separate instance, and simulate a failover or maintenance restart to see how Zitadel reconnects. Record the results, because your auditors and security reviewers will ask for evidence that the setup was tested, not only documented.
How DeployOpen scopes the managed PostgreSQL work
DeployOpen plans and implements Zitadel inside your own cloud accounts or data centers, including the managed PostgreSQL instance it depends on. The scope is agreed in writing before work starts, and the written scope is what sets the deliverables and timeline. For this topic, that scope usually covers the database role and database provisioning with your platform team, the schema initialization sequence, the TLS mode and CA handling, connection pool and PgBouncer settings where they apply, verification of the running system, and a handover that leaves your team able to operate it. Engagements are fixed-scope, so the questions to settle early are which managed service you run, who holds the administrative access the provider allows, and which PostgreSQL major version you target from the versions Zitadel supports.
The written scope should also name who does what on your side. Ask for the list of items your team owns, such as network paths, parameter group or flag changes, secrets storage and approval of any change to the database engine version. Ask for a verification plan that states what was tested, including a connection check under each TLS mode you plan to keep, a fresh install and a restart, and a documented rollback path. Ask how the handover will be delivered: runbooks, configuration files, and the record of which settings were chosen and why. Confirm each item with your DeployOpen contact and with the provider's documentation before you sign, because provider behavior around extensions, roles and certificates changes over time.
Ongoing support is available as a retainer for work that continues after handover, such as Zitadel version upgrades, PostgreSQL minor and major updates, certificate renewal, and periodic review of connection and pool settings. Retainer terms, like the initial scope, are set in writing. DeployOpen does not issue audit reports or certifications, so if your compliance team needs evidence for a database control, the scope should say which records DeployOpen will prepare for your assessor to review.

