How to back up and restore Zitadel without losing identity data
Many applications depend on your identity platform for sign-in, so the question that matters is what you must protect to bring Zitadel back after a failure, and how quickly you can prove that the restore works. For self-hosted Zitadel, the answer centers on PostgreSQL. Zitadel stores its data in PostgreSQL, with versions 14 through 18 supported, and its event store is the source of truth from which the working tables and projections are derived. Your restore path therefore runs through PostgreSQL backups and point-in-time recovery, not through a separate Zitadel export. Confirm the PostgreSQL version you plan to run against the Zitadel database documentation before you design the backup schedule, because the supported range also determines which PostgreSQL release line you must keep patched.
Teams need a formal backup design at three points: before go-live, before every Zitadel or PostgreSQL upgrade, and whenever the workload falls under regulation or contractual recovery objectives. Before go-live, the design should name the recovery point you can accept, the recovery time you can tolerate, who can authorize a restore, and where backup copies are kept. Before an upgrade, a fresh backup taken immediately beforehand is the rollback point you rely on if a migration fails. For regulated workloads, the backup design becomes evidence, so record the retention period, encryption, access controls and restore test results in a form your compliance team and auditors can review. Ask your PostgreSQL operators to confirm how continuous archiving and point-in-time recovery are configured in your environment.
The masterkey is part of the backup. Zitadel uses a masterkey to encrypt sensitive values stored in the database, so a database dump restored without the matching key cannot recover those values. Store the masterkey in a separate, access-controlled secret store and keep a documented copy that is backed up alongside the database, but never in the same unprotected location as the dumps. Before you rely on any backup, run a restore drill in an isolated environment: restore the database to a point in time, start Zitadel with the same masterkey and configuration, and confirm that administrator login, an existing organization and an application sign-in all work. Record the time the drill took, because that is the most credible recovery time you can give your application owners. The Zitadel self-hosting overview lists the deployment options whose restore steps you should rehearse.
How backups, WAL archives and the masterkey fit together
The diagram starts with Zitadel writing its events to PostgreSQL, which is the source of truth. A base backup and a continuous WAL archive are copied to separate backup storage, which sits on the far side of the trust boundary from production. The masterkey is held in a separate secrets store and is not kept with the database backups. A restore rebuilds PostgreSQL to a chosen point in time, and only then is Zitadel started against it. Check that the backup side can be reached without production credentials and that the masterkey can be retrieved during a drill.
Backups and WAL archives sit outside production, and the masterkey is kept apart from both.
Which PostgreSQL backup method fits your recovery goals
A logical dump exports the database contents as SQL or a custom archive, which you can restore into a fresh PostgreSQL instance. It is simple to reason about and useful for moving data between hosts or major versions, but it captures the database only at the moment the dump ran. Anything written after that point is lost if the cluster fails, so it sets a coarse recovery point. Restores rebuild every object and index from scratch, which takes longer as the database grows.
- What it protects against: accidental table drops, logical corruption you can recover from an earlier export, and copies needed for test or migration work.
- What restore involves: creating a target instance, running the restore tool, then checking row counts, extensions and roles before cutover.
- What the team operates: a schedule, retention rules, encryption of dump files, and off-cluster storage.
- What it does not cover: point-in-time recovery between dumps, so plan the schedule around the data loss your organization accepts.
- Version note: PostgreSQL documents
pg_dumpalland restore as one path for major upgrades, so dumps also serve as upgrade inputs.
Confirm with your database team how long a full restore of your Zitadel database takes in a drill, not only how long the dump takes.
A base backup copies the whole data directory while the server runs, and continuous WAL archiving stores every write-ahead log segment as it is produced. Together they allow point-in-time recovery: restore the base backup, then replay archived logs up to a chosen moment just before a bad change. PostgreSQL's continuous archiving documentation is the reference for this method, and it is the path most teams use to protect Zitadel's event store, which holds the authoritative record of changes.
- What it protects against: a bad deletion, a faulty migration or a corrupted volume, restored to a specific timestamp.
- What restore involves: restoring a base backup to a new location, configuring recovery targets, and replaying archived WAL until the chosen point.
- What the team operates: the archive command, storage for base backups and WAL, retention, monitoring for archive failures, and encryption of both.
- Masterkey dependency: a restored database only works with the same Zitadel masterkey, so store that key separately from database backups.
- Recovery time: replay speed depends on the volume of WAL since the base backup, so take base backups often enough to bound it.
Ask for a documented recovery target, the archive failure alert, and a timed restore to a point before a test change.
A standby replica is a second PostgreSQL server that receives changes from the primary, either synchronously, where a commit waits for the standby, or asynchronously. Hot standbys can also serve read-only queries. Replicas shorten downtime when a server fails, but they are not backups. A replica applies a mistaken delete or a bad update just as faithfully as a good one, so the damage reaches every copy within moments. PostgreSQL also does not detect primary failure or notify the standby, so automatic failover requires external tools that you select, configure and test.
- What it protects against: loss of a single server or storage node, with the aim of a fast switch to a standby.
- What restore involves: promoting a standby, redirecting Zitadel's database connection, and rebuilding a replacement standby afterward.
- What the team operates: replication monitoring, lag alerts, a failover tool, fencing to prevent split brain, and connection routing.
- Trade-off: synchronous replication protects committed data at the cost of commit latency, while asynchronous replication can lose the most recent commits on failover.
- Pair it with backups: keep base backups and WAL archives alongside replicas so logical mistakes can still be undone.
Confirm that a replica failover is tested separately from a backup restore, because the two drills answer different questions.
Backup options and when each fits
This table compares the configuration choices that shape a Zitadel backup and restore setup, with the situations where each option fits and the trade-off it carries. Read each row as a decision: pick the option that matches your recovery expectations, then confirm the detail with your database and Zitadel setup. The main takeaway is that a backup is only as useful as the restore you have tested, and the masterkey must be recoverable alongside the data.
| Choice | When it fits | Trade-off |
|---|---|---|
| Backup frequency | Full base backups on a fixed schedule, plus continuous WAL archiving if you need recovery to a point between backups | More frequent base backups shorten the worst-case replay but add storage, I/O on the database and more jobs to monitor |
| Retention period | Keep enough base backups and WAL to cover the longest period you may need to recover from, including undetected corruption or bad changes | Longer retention raises storage cost and extends the window of personal data held in backups, so set it with your privacy and legal team |
| WAL archive location | A separate storage target from the database host, in a different failure domain, with access restricted to the backup role | Remote archives protect against host loss but add network dependency, and a slow or full archive can stall the primary if archiving backs up |
| Encryption of backups | Encrypt base backups and WAL at rest with keys held outside the database host, so restored copies are not readable from storage alone | Key management adds an operational dependency, and a lost backup key makes every backup unrecoverable |
| Separate credentials for backup jobs | A dedicated database role with backup privileges and a separate storage credential, scoped to the archive path only | More credentials to rotate and audit, and a misconfigured role can still reach production data if it is over-privileged |
| Masterkey storage location | Store a recoverable copy of the Zitadel masterkey in a controlled secrets store, separate from the database backup, with access logged | Two storage locations must stay in step with the database backups, and a key copy held near the data weakens separation of duties |
| Backup verification method | Scheduled restores into an isolated environment, followed by checks that Zitadel starts and that known test logins succeed | Restore drills take staff time and infrastructure, and a backup that is never restored only proves that files were written |
| Restore target | A standby environment for fast failover, or a clean instance for point-in-time recovery to a chosen moment | A hot standby protects availability but does not guard against logical errors that replicate, so it complements rather than replaces backups |
Keeping the masterkey with backups
A database backup of Zitadel is only half of a restore. The masterkey that Zitadel uses to protect sensitive values must be preserved separately from the PostgreSQL data, under access control that is at least as strict as the database itself. Store it in a secrets manager or a sealed, access-logged vault that is not in the same backup bucket, snapshot or dump file as the database. If the key and the data are kept together, anyone who can read a backup can read the encrypted values, and a single backup loss can take both protections with it.
The reverse risk matters just as much during a restore. If you recover the PostgreSQL database but not the matching masterkey, or restore a key that belongs to a different environment, encrypted values in the restored data may be unreadable. Those values can include settings and credentials that Zitadel needs to start and serve logins, so the failure may appear only after the database is back online. Treat the database backup and the key as one restore set, record which key version belongs to which backup, and test the pairing in a restore drill rather than assuming it works. Confirm in the Zitadel deployment documentation which configuration values and stored data depend on the masterkey, since that list determines what must be captured with the key.
Before go-live, ask the Zitadel team or your DeployOpen engineer to document how the masterkey is rotated, what Zitadel re-encrypts during rotation, whether old keys remain needed to read older backups, and what the process requires when the key is changed in a high-availability deployment. Keep the answers in your runbook and check them against the version you run, because the procedure depends on the release and on how your secrets are injected into the pods or containers. Do not design a rotation procedure from assumptions. Confirm each step in the vendor documentation, then rehearse it in a non-production environment with a restored copy of the database.
How to set up backups and restore for Zitadel
This sequence turns a running self-hosted Zitadel into one with tested PostgreSQL recovery, a protected masterkey, a written restore runbook and scheduled drills, so you know the instance can be brought back before you need it.
Confirm PostgreSQL and Zitadel version support
The platform engineering lead confirms which PostgreSQL major version the database runs and checks it against the supported list: version 14 is supported through November 12, 2026, and versions 15 through 18 are supported later. Record the Zitadel release in use and compare it with the latest release on the Zitadel GitHub releases page, since the upgrade path affects which backup tooling and restore steps you rely on. Done when the versions are written into the runbook with their support end dates, and any version nearing end of support has an owner and a planned upgrade date.
Enable continuous archiving and base backups
The database administrator sets the PostgreSQL archive mode and archive command so write-ahead log (WAL) segments are shipped off the primary, then schedules regular base backups of the Zitadel database cluster. Point-in-time recovery depends on both pieces: a base backup gives a starting point, and archived WAL carries the database forward to the chosen moment. Check that archived WAL segments arrive at the archive location without gaps, and that a base backup completes and is listed in the backup catalog. Confirm the settings against the PostgreSQL continuous archiving documentation for your version before you change production.
Store WAL and backups in separate encrypted storage
The infrastructure team places WAL archives and base backups in separate storage locations, with different credentials and access roles, and enables encryption at rest and in transit for both. Separation means that losing or compromising the primary storage does not remove the only copy, and a single leaked key does not expose every backup. Set retention rules for each store and confirm that deleting a backup set requires a separate approval. Done when a test read of a WAL segment and a base backup works from the restore environment using only the restore credentials, and the write credentials cannot delete existing archives.
Store and back up the Zitadel masterkey
The security team stores the Zitadel masterkey in a secrets manager or sealed vault that the restore team can reach during an incident, and keeps an offline copy under dual control. Zitadel uses this key to protect data it encrypts, so a database backup restored without the matching masterkey may not be usable. Record where each copy lives, who can retrieve it, and how a change of key is logged. Confirm the key version in the restore runbook matches the one used by the running instance. Done when a restore test uses the key from the recovery store, not from the live server.
Document the restore runbook
The operations lead writes the restore runbook as a numbered procedure: provision a database host with the same PostgreSQL major version, restore the base backup, replay WAL to the target time, start Zitadel with the matching release and masterkey, then verify. Include the exact commands and configuration keys used in your environment, who approves a restore, how the target time is chosen, and how the team communicates during an incident. Ask Zitadel documentation and your database vendor or support path to confirm any steps that depend on your deployment method (Kubernetes with the Helm chart, Docker Compose or binaries). Done when a second engineer can follow the document without asking the author questions.
Run a restore into an isolated environment
The platform team restores the latest base backup and archived WAL into an isolated environment that has no route to production clients or identity providers. They choose a target time, start Zitadel against the restored database with the recovered masterkey, and confirm the service reports ready. Then they sign in with a known test user, confirm that user's organization and project grants, and make a token request for a test application. Record elapsed times and any manual steps, since those become the baseline for future drills. Done when the known user signs in and the token request succeeds against the restored data.
Schedule restore drills and review results
The security and operations leads set a recurring restore drill and assign an owner for each run, with a written checklist covering WAL continuity, base backup integrity, masterkey retrieval, Zitadel startup, a sign-in check and a token check. After each drill, they compare the result with the runbook, update steps that failed, and note any gap in access or tooling. Keep drill records as evidence for internal reviews or assessments, and confirm with your auditors which records they expect. Done when each drill produces a dated record, every failed check has a tracked fix, and the runbook version is updated to match.
Security risks in backup storage and restore access
A Zitadel backup is more sensitive than a typical database dump because it holds user records, client configuration and the material needed to read encrypted fields. The risks below sit in storage, credentials, key handling and test environments, and each one is easy to miss because the backup job itself usually works.
Personal data and secrets in dumps
A PostgreSQL backup of a Zitadel database contains user profiles, login identifiers, organization structure and application client configuration. Treat every dump and archived WAL segment as personal data for retention and access purposes. Ask your team to list which tables and fields are in scope, confirm who can read the backup files, and confirm whether any client secrets or signing material are stored in a form that a backup reader could use.
Zitadel database docsBroadly readable backup buckets
Object storage buckets used for base backups and archived WAL are often created for convenience and shared across teams. A bucket readable by a wide group exposes the entire identity store to anyone with that group membership. Check bucket policies, public access settings, encryption at rest and whether access is logged. Confirm that the backup location is separate from the application's own storage and that deletion rights are restricted.
Continuous archiving docsRestore credentials with excess rights
The account that runs a restore often ends up with superuser rights, replication rights and access to every database on the server because that is the fastest way to get a drill working. Restore access should be separate from the routine backup job and limited to the target cluster. Review which roles can create databases, change authentication settings or read from the backup store, and confirm how PostgreSQL authentication methods, such as certificate or SCRAM-based password login, are configured for these roles.
PostgreSQL authentication methodsMasterkey stored beside backups
Zitadel uses a masterkey to protect sensitive values it stores. A backup that is stolen together with the masterkey can be read far more easily than a database dump alone. Keep the masterkey in a separate secret store with its own access policy and audit trail, and do not copy it into the same bucket, the same repository or the same restore runbook as the data. Confirm the key handling steps with the Zitadel deployment guidance before you finalize the procedure.
Test copies carrying production personal data
Restore drills and staging refreshes often produce a full copy of production identity data in a less controlled environment. Developers then log in with real accounts, screenshots circulate, and test systems receive fewer controls than production. Decide before the drill whether the copy will be masked, reduced to a subset or kept under the same access rules. Record who approved the copy, where it lives and when it will be destroyed.
Restored systems reaching live services
A restored Zitadel instance still holds the client configuration, redirect URIs and identity provider connections from production. If the restore network can reach live applications, live identity providers or external webhooks, a test restore can send tokens, trigger actions or change production state. Restore into an isolated network segment, disable outbound paths that are not needed for the drill, and confirm that restored clients and identity provider connections cannot be used against production.
Questions buyers ask about backing up Zitadel
What does a backup and restore engagement for Zitadel cover?
A backup and restore engagement covers the design, build and proof of the recovery path for your self-hosted Zitadel: PostgreSQL backups, continuous archiving for point-in-time recovery, storage placement, retention, the handling of the masterkey, and documented restore runbooks. It also usually includes at least one restore drill that proves the path works end to end. Effort is driven by how many environments exist, the size and write rate of the database, whether you already run PostgreSQL backup tooling, how strict your recovery time and recovery point requirements are, and how many people must be trained. The scope and deliverables are agreed in writing before work starts, and the quote follows from that scope.
Can our own team back up and restore Zitadel without a partner?
Yes, if your team already operates PostgreSQL and can run the Zitadel stack on infrastructure it controls. The parts that most often need outside help are the first working configuration of continuous archiving, a restore drill that is actually timed and verified, and the key custody decision for the Zitadel masterkey, because a backup without the matching masterkey may not be usable. Ask yourself whether someone on the team has restored a PostgreSQL cluster to a point in time before, and whether that person can repeat the process after a staff change. A partner can fill gaps in that experience, while your team keeps ownership of the runbooks and the environment.
What does the client need to provide for a backup and restore engagement?
Plan to provide the following before work starts:
- Administrative access to the PostgreSQL servers that hold Zitadel data, including permission to change archiving and backup settings
- Object or file storage for base backups and WAL archives, in a location separate from the primary database host
- A decision on who holds the masterkey and where it is stored, along with a sealed copy that is not kept on the same host as the backup
- A non-production environment where restores can run without touching live data
- Named owners for security, database operations and the Zitadel service, who approve the retention and access model
Confirm the exact storage, network and access rules with your own security and infrastructure teams, since they differ between organizations.
How long does a Zitadel restore drill take?
No duration for a drill is supplied here, so treat any number you hear with caution. The time depends mainly on the size of the database, the amount of WAL to replay for the chosen recovery point, the speed of your storage and network, how much of the Zitadel stack must be brought back to verify the restore, and whether the drill is scripted or performed by hand. Retention matters too, because a longer retention window means more base backups and archives to choose from and to store. Ask your partner or your own database team to run a timed drill on a copy of your data and to record each step, so you have a measured figure for your environment rather than a general estimate.
How do PostgreSQL major upgrades change the Zitadel backup plan?
A major upgrade creates a new cluster, so the backup set taken before the upgrade may not restore onto the new version with the same procedure. PostgreSQL offers three documented routes: dump and restore with pg_dumpall, pg_upgrade, and logical replication, which the upgrade documentation says can limit downtime to several seconds. Each route changes what your backups look like afterward, so the plan must be updated with the upgrade. Minor version updates keep the storage format, so they usually need only executable replacement and a restart, but the backup and restore runbook should still be retested. Supported major versions for Zitadel are listed in the PostgreSQL support policy, so check which version your Zitadel release requires before you schedule an upgrade.
What does keeping backups and restores running cost in ongoing time?
Ongoing work is mostly recurring operations time rather than a fixed fee. Expect regular checks that backups and WAL archives are completing, monitoring of storage capacity and retention, periodic restore drills, rotation of access credentials, and review of the runbook after each Zitadel or PostgreSQL upgrade. The amount of time depends on how many environments you run, how often you drill, how automated the checks are, and whether a retainer covers testing and upgrades. Ask any provider to break the recurring work into named tasks with frequency and owner, so you can compare the effort against your own staffing. DeployOpen offers ongoing support and continuous testing as retainers, and the scope of any retainer is set in writing.
What to confirm in your environment before relying on a restore
A backup that has never been restored is an assumption, not a control. The cards below cover the decisions and checks that connect Zitadel's database, its event history, its projections and its masterkey, and they are the items to settle with your team before you depend on any restore path.
Recovery point and recovery time targets
Agree in writing how much data loss and how much downtime your organization accepts for the identity service. Point-in-time recovery in PostgreSQL depends on continuous WAL archiving, so the achievable recovery point depends on how archiving is configured, not only on the backup schedule. Confirm the targets with the owners of every application that signs users in through Zitadel, and test that a restore meets them.
PITR docsRelease and PostgreSQL version support
Check that your Zitadel release and your PostgreSQL major version are supported together before you restore into a new environment. Zitadel supports PostgreSQL 14 through 18. PostgreSQL 14 reaches end of support in November 2026, so a restore target built on that version may need a major upgrade soon after. Plan the restore and any upgrade as separate, tested steps.
- Supported PostgreSQL versions
- 14 to 18
Projection rebuild after restore
Zitadel keeps its event store as the source of truth and builds read models, called projections, from it. Confirm how your team will verify that projections are consistent after a restore and how long they take to catch up on your data volume. Test a restore on a copy of production and check that users can sign in, that organizations and grants look correct, and that projections finish processing without errors.
Masterkey storage and recovery
The masterkey encrypts sensitive data that Zitadel stores, so a database backup without the matching key cannot be fully restored. Decide where the key lives, who can read it, and how it is kept with backups under the same access controls. Write down the recovery procedure and rehearse it, because a missing or mismatched key can make an otherwise valid restore unusable.
Self-hosting overviewStorage provider and retention rules
Identify where backup files and WAL archives are written, which provider holds them, and whose account controls deletion. Confirm retention periods against your records policy and legal hold obligations, and check that backups are encrypted and stored outside the failure domain of the primary database. Ask your storage team whether object lock or immutable copies are available, since these protect backups from accidental or malicious deletion.
Whether Zitadel engineering support is needed
Decide before an incident whether your team can run the full restore path alone or whether Zitadel engineers should be involved for specific steps, such as event store repair or version-specific migrations. Ask the vendor how that support is delivered and under which agreement. The Enterprise plan includes custom support agreements, so confirm whether your deployment would be covered and what response expectations apply.
Zitadel pricingWhere to read the official backup and recovery guidance
Start with the PostgreSQL continuous archiving and point-in-time recovery documentation before you design anything for Zitadel. It explains how a base backup combined with archived write-ahead log segments lets you restore a cluster to a chosen moment, and it sets out the prerequisites your archiving setup must meet. Because Zitadel stores its event store and projections in PostgreSQL, that page is the authoritative description of the restore path your team will rely on. Have your database administrators read it alongside your own archive tooling, and confirm that the archive settings you plan to use match the version of PostgreSQL you run.
The Zitadel self-hosting database documentation is the second primary reference, and it answers a different question: which PostgreSQL versions Zitadel supports and how it expects to connect to the database. Zitadel supports PostgreSQL versions 14 through 18, so check that your target version sits inside that range before you write a backup runbook for it. Use this page to confirm the connection and role setup your backup and restore procedures will assume, and to note any database-side settings the Zitadel team documents as required. Keep a copy of the version you tested against in your change records, since a restore drill is only meaningful for the versions it was run on.
Treat these two pages as the starting point, not the finish line. Neither one tells you how to handle the Zitadel masterkey, which must be stored separately from the database backup, and neither defines your recovery time or recovery point targets. Ask Zitadel and your own platform team to confirm any steps that the self-hosting documentation leaves open for your deployment method, whether that is Kubernetes with the official Helm chart, Docker Compose or binaries. Record every open question as a decision for your restore drill plan.
How DeployOpen scopes, delivers and supports Zitadel backup and restore
DeployOpen plans, builds, tests and hands over backup and restore for self-hosted Zitadel inside your own infrastructure. The work centers on PostgreSQL backups, point-in-time recovery, safe handling of the masterkey, and restore drills that show your team the procedure works before an incident forces it.
How we scope
- Written scope lists the PostgreSQL versions, hosting model and backup tooling your environment uses for Zitadel.
- Scope records recovery point and recovery time targets agreed with your risk, compliance and operations owners.
- Scope defines where the masterkey is stored, who can access it, and how it is kept with backup sets.
How we build
- We configure base backups and continuous WAL archiving so point-in-time recovery to a chosen moment is possible.
- We set up backup storage with encryption, retention rules and access controls separate from the production database.
- We test restores into an isolated environment and verify that Zitadel starts and serves logins against the restored data.
How we hand over
- You receive runbooks for full restore, point-in-time restore and masterkey recovery, written for your operations team.
- Documentation covers backup schedules, monitoring of backup jobs, and the evidence your auditors may ask to see.
- We run a supervised restore drill with your team and record results, gaps and follow-up actions in the handover.
How we support
- Ongoing support, upgrades and recurring restore testing are available as retainers after the initial handover.
- Retainers can cover PostgreSQL minor and major upgrade planning that affects the backup and restore procedure.
- Any change to Zitadel or PostgreSQL versions triggers a review of the backup configuration and a repeat restore test.

