Backing up Element Server Suite Community on Kubernetes

A practical guide to backing up and restoring an ESS Community deployment on Kubernetes, covering the components to save, the scale-down and dump sequence, the restore order and what to confirm before you rely on it.

On this page

Backing up ESS Community on Kubernetes: what your team must protect

A team running Element Server Suite Community on infrastructure it controls needs a backup it can restore before it needs anything else. The backup covers the bundled PostgreSQL database, the Synapse media volume, the values files you used to install the chart, the generated credentials Secret, and the deployment markers ConfigMap. Take one before any upgrade, chart change, storage migration or node rebuild, and on a schedule that matches how much chat history and media you can afford to lose. Losing the PostgreSQL data loses the users, rooms and message history, while losing the credentials Secret can leave you with a working database you cannot reconnect to the right services.

The ESS Community maintenance guide defines the procedure your team should follow, and it is the reference your runbook should cite rather than a summary written from memory. In outline, the procedure scales Synapse and MAS to zero so writes stop, dumps the bundled Postgres with pg_dumpall, saves the values files, the Secret and the ConfigMap, and copies the Synapse media volume. Confirm the exact commands and resource names against the guide version that matches your chart release, because the Secret and ConfigMap names and the media volume claim depend on how the deployment was installed.

A backup you have never restored is an assumption, not a control. Plan a restore test into a separate namespace or cluster, using the saved values, the Secret and the database dump, and check that users can log in, that existing rooms load and that media downloads work. Record how long each step took and who ran it. Also decide who holds copies of the Secret and values files, since they contain credentials, and confirm where the backups are stored and how they are encrypted. The restore order and the exact checks belong in your runbook, so the test should follow that document step by step.

Which parts of an ESS Community deployment hold state

An ESS Community deployment keeps its state in a few places outside the container images, and a restore rebuilds the platform only from what was saved. The six items below are the ones to capture before any change, and each one fails in a different way if it is missing. The Kubernetes cluster underneath them is a separate layer with its own backup concerns.

Bundled PostgreSQL data

The bundled PostgreSQL database holds Synapse and MAS state: user accounts, room events, device keys, access tokens and sessions. Dump it with pg_dumpall while Synapse and MAS are scaled to zero so the dump is consistent. Without it, users, rooms and message history cannot be recovered, and encrypted history can become unreadable without matching key material. Check that the dump file is non-empty and can be loaded into a scratch cluster.

ESS maintenance guide

Synapse media volume

The Synapse media volume stores uploaded files, avatars and cached remote media. The database only holds references to these files, so a database restore without the volume leaves broken links and missing attachments. Copy the volume contents while Synapse is stopped so no file is written mid-copy. Confirm the file count and total size match before and after the copy.

Values files

The Helm values files record the hostnames, server name, ingress settings, storage sizes and feature choices that produced the running deployment. Redeploying the same chart without them produces a different installation that may not match the existing database or domain. Store them in version control and keep the exact values used for the release being backed up, not only the latest copy.

Generated credentials Secret

ESS generates passwords and signing material for its components and stores them in a Kubernetes Secret. Those values must match what is already in the database and on existing clients, so regenerating them on restore breaks logins and internal connections. Treat this Secret as sensitive, export it through a controlled path, and restrict who can read the backup. Kubernetes Secrets are stored unencrypted in etcd by default, which makes the backup copy a second place to protect.

Kubernetes Secrets practices

Deployment markers ConfigMap

The deployment markers ConfigMap records which setup steps ESS has already completed, such as initial configuration and migrations. If it is missing, the installer may try to repeat one-time steps against a database that has already had them, or skip steps that a restored database still needs. Save it with the other ESS objects and compare its contents after a test restore.

Cluster and etcd layer

The Kubernetes control plane stores object definitions, including the ESS objects above, in etcd. Backing up the ESS files does not capture the cluster's own state, node configuration or network setup, so a full rebuild of the cluster needs its own etcd snapshot plan. Ask the cluster owner whether etcd snapshots are taken, where they are stored and how often they are tested. Keep this layer on a separate runbook from the ESS procedure.

Operating etcd clusters

Choosing a backup approach for each component

This table compares the ESS maintenance guide procedure with volume snapshots and an external PostgreSQL backup tool, component by component. Read each row to see which approach fits the component, what consistency it gives and what your storage class or bundled database must support before you rely on it.

ComponentMaintenance guide procedureVolume snapshots or external tooling
Bundled PostgreSQLScale Synapse and MAS to zero, then dump with pg_dumpall. Gives a logically consistent copy because no writers are active.A crash-consistent volume snapshot is possible, but only if the storage class supports snapshots. An external tool needs its own credentials and a tested restore path into the bundled database.
Synapse media volumeCopy the volume while Synapse is scaled to zero so no uploads are written during the copy.Snapshots are fast for large media stores, but confirm the storage class supports snapshots and that the snapshot is taken with no active writes.
Values files and Helm release inputsSave the values files used for the release. Simple file copies, stored outside the cluster.Keep these in version control or a secrets manager. Snapshots do not capture them, so a separate copy is still needed.
Generated credentials SecretSave the Secret and deployment markers ConfigMap as files. Confirm the copy is encrypted at rest in your backup store.Kubernetes Secrets are stored unencrypted in etcd by default unless encryption at rest is configured. Snapshots of etcd or the cluster may also capture them, so restrict access to backup copies.
Cluster state and etcdNot covered by the ESS procedure. Back up etcd separately if you run self-managed control planes.Use etcd snapshot tooling on the control plane, or your managed provider's cluster backup service. Confirm which one applies to your cluster.
Restore order and downtimeRestore the database and volumes first, then the Secrets and values, then start the workloads. Downtime lasts while the workloads are scaled to zero.Snapshot restores can be quicker but require matching the snapshot to the database state. Test the full order in a separate namespace before relying on it.

Running the ESS Community backup in order

This sequence stops writes to Synapse and MAS, captures a consistent PostgreSQL dump, and saves the configuration, generated secrets and media so the deployment can be rebuilt from a known point. Each step ends with a check you can record before moving on.

  1. Confirm the Helm release and namespace

    Before touching anything, record the Helm release name, the Kubernetes namespace and the chart version that the ESS Community deployment was installed with. Run helm list in the target namespace and keep the output with your backup record. Confirm that kubectl points at the correct cluster, since a backup taken against the wrong context is a common and avoidable mistake. The step is complete when you can name the release, namespace and cluster in a single note that the restore team can read.

  2. Scale Synapse and MAS to zero

    Scale the Synapse and Matrix Authentication Service deployments down to zero replicas so no new events, sessions or account changes are written while the dump runs. Use kubectl scale against the deployments that ESS created, and check the names with kubectl get deployments first. Confirm with kubectl get deployments that the desired and ready replica counts are both zero and that no Synapse or MAS pods remain running. Do not proceed until both checks pass, because a dump taken during writes may not match the media volume you copy later.

  3. Dump the bundled PostgreSQL with pg_dumpall

    Run pg_dumpall against the PostgreSQL instance bundled with ESS, writing the output to a file on a volume outside the cluster. The maintenance guide describes this procedure, so follow its exact commands for the chart version you run. Store the dump in a location with access controls, since it contains account, room and session data. Check that the dump file exists and is non-empty, and that the tail of the file shows the expected end-of-dump marker. Record the file size and a checksum alongside it.

  4. Save the values files

    Export the Helm values files used for the deployment, including any overrides for server name, ingress, storage and Synapse configuration. Keep the exact files that were applied, not reconstructed copies, and store them in version control or an encrypted location with restricted access. If values were passed on the command line, record those arguments too. Verify each saved file opens and contains the keys you expect, such as the server name, and that no file is empty. These files are needed to recreate the deployment with the same identity.

  5. Save the credentials Secret and deployment markers ConfigMap

    Export the generated credentials Secret and the deployment markers ConfigMap that ESS creates, using kubectl get with output in YAML. Treat the exported Secret as sensitive: it holds generated credentials, so store it encrypted, limit who can read it, and avoid printing it to terminals or logs. Confirm the exported files contain the expected object names and that the Secret data fields are present without printing their values. Kubernetes stores Secrets unencrypted in etcd by default, so the same care applies to the copies you make.

  6. Copy the Synapse media volume

    Copy the contents of the Synapse media volume to your backup location while Synapse is still scaled to zero. The method depends on your storage class, so confirm how the persistent volume claim is mounted and whether a snapshot is available. Use a copy tool that preserves file ownership and permissions, because Synapse reads these files as its own user. Compare the file count and total size at source and destination, and check that a sample of files opens. Media is often the largest part of the backup, so confirm free space before you start.

  7. Scale Synapse and MAS back up

    Restore the original replica counts for Synapse and MAS, using the values recorded in the first step rather than defaults. Watch the rollout with kubectl rollout status until both deployments report ready. Check the Synapse logs for a clean startup and confirm that a client can log in and send a test message in a non-critical room. Only after these checks should you mark the backup as complete. Keep the backup record, the checksums and the restore order together so the restore can follow the same steps in reverse.

The restore order that brings ESS back without data drift

The restore order matters because the database, the media volume and the secrets only describe a consistent server when they come from the same backup point. Start by preparing the target namespace and confirming the cluster can run the ESS release. Then restore the credentials Secret and the saved values files before the Helm release is installed again, so Synapse and MAS start with the same signing key, database passwords and shared secrets they used when the dump was taken. Restore the deployment markers ConfigMap at the same stage so the chart state matches the values.

Next, restore PostgreSQL from the pg_dumpall output while the Synapse and MAS workloads are still scaled to zero, then restore the Synapse media volume. The signing key and secrets must match the database contents. If Synapse starts with a different signing key than the one that signed existing events, federated servers will reject its history and the server will drift from what other homes remember. If the media volume comes from a different day than the database, users will see events that point to missing files. Confirm the timestamps of each artifact before you bring anything up, and record which backup set each piece came from.

Only then start the release, and check Synapse and MAS health before opening user access. Confirm that both pods become ready, that MAS can reach its database and upstream identity provider, and that Synapse answers its client and federation endpoints. Confirm with your Element or ESS support contact which health endpoints and log messages the chart version exposes. Rehearse the full sequence in a non-production cluster at least once, timing each step and recording where it deviated from the runbook. A restore that has never been rehearsed is an untested backup, whatever the dump file size suggests.

Protecting backup contents and access

An ESS backup is more sensitive than the running cluster's data alone, because it collects the database, the generated credentials and the media store in one place. The cards below cover where those secrets sit, who can read them and how long copies should live.

Treat the dump as credentials

The pg_dumpall output holds every database role and password hash, along with Synapse and MAS message and account data. Store it with the same controls as production data, not as an ordinary file share copy. Confirm who can open the backup location and whether copies are encrypted before they are written.

ESS maintenance guide

Check Secret encryption at rest

The generated credentials Secret is part of the backup, and Kubernetes stores Secrets unencrypted in etcd by default. If encryption at rest is not configured on your cluster, anyone with read access to etcd storage or its snapshots can recover those values. Confirm your encryption setup with your cluster administrators before relying on the Secret in a backup.

Secrets good practices

Restrict Secret read access with RBAC

Only the service accounts and operators who run the backup and restore should be able to read the credentials Secret and the ConfigMap holding deployment markers. Kubernetes guidance asks administrators to restrict list and watch access as well as get access, since listing can expose values too. Review role bindings in the ESS namespace and remove broad cluster-wide grants.

Encrypt and limit the media copy

The Synapse media volume contains user uploads, which may include personal or regulated files. Copy it to storage that encrypts data and restricts access to named administrators. Note where the copy lives, since a media backup in a less controlled location undermines protections placed on the database dump.

Set retention and deletion rules

Backups that outlive their purpose keep deleted messages and removed accounts recoverable. Define how long each backup set is kept, who approves extended retention and how copies are destroyed when the period ends. Ask your compliance lead to confirm these rules match your data protection obligations, because the right period depends on your policies.

Log access to backup copies

Record who reads, copies or restores each backup, and keep those logs outside the cluster that holds the data. A restore performed by an unexpected person is hard to spot without an access trail. Confirm with your security team which log sources and retention periods apply to backup storage in your environment.

Questions teams ask before backing up ESS Community

How long does the backup downtime last and what drives it?

The downtime is the window during which Synapse and MAS are scaled to zero, so users cannot sign in or send messages while the data is copied. Its length depends on how long the PostgreSQL dump takes, which grows with the size of the database, and on how long the media volume copy takes, which grows with the amount of uploaded files. Other drivers include the speed of the storage the dump is written to, network throughput if the copy leaves the cluster, and how many checks the team runs before bringing services back. Measure both on a staging copy of your own data before you schedule a window, because no general figure applies to every deployment.

What does the internal team need to provide for an ESS backup?

The team needs cluster access with rights to scale the Synapse and MAS workloads, run a database dump from the bundled PostgreSQL, and read the Secrets and ConfigMaps that hold the generated credentials and deployment markers. Someone must own the decision about where backups are stored, who can read them, and how long they are kept, because the dumps and the credentials Secret contain sensitive material. The team also needs a named owner for the change window and for communicating downtime to users. Confirm access paths and storage locations with your own platform team before work starts.

Can our own team run an ESS Community backup without outside help?

Yes, if your engineers already operate Kubernetes and Helm and can follow the ESS maintenance procedure, a team can run the backup internally. The steps are scaling two workloads, dumping the bundled Postgres with pg_dumpall, saving the values files, the generated credentials Secret and the deployment markers ConfigMap, and copying the Synapse media volume. The harder part is the restore rehearsal, which needs a second environment and time to prove that users, rooms and media come back correctly. Many organizations decide between in-house work and a partner based on who will repeat this procedure, and whether the rehearsal will be done at all.

What should a partner quote for an ESS backup include?

A written quote should list the systems in scope, including the Synapse and MAS workloads, the bundled PostgreSQL, the values files, the credentials Secret, the deployment markers ConfigMap and the media volume. It should state whether a restore rehearsal is included and in which environment it runs, what the acceptance checks are, and who receives the backup artifacts and documentation. Ask how downtime will be planned and communicated, whether the work recurs on a schedule or is a one-time run, and which items the client must supply, such as access, storage and a change window. Fixed-scope engagements are agreed in writing before work starts, so the quote should match that written scope.

How often should we back up an ESS Community deployment?

The right frequency depends on how much chat and media data your organization can afford to lose and on how long a restore takes. Teams usually match the schedule to a recovery point they have agreed with their business owners, then check whether a scheduled downtime window is acceptable for each run, since the procedure scales Synapse and MAS to zero. Frequent runs increase total downtime and storage use over time, while infrequent runs widen the gap in data after a failure. Agree the interval and retention period in writing and review them after each restore rehearsal.

How do we prove that a restore actually works?

Prove it by restoring into a separate environment built from the saved values files, the credentials Secret and the database dump, then checking that Synapse and MAS start, users can sign in, existing rooms and messages load, and media files open. Record the time each step takes, the errors seen and the changes needed, because that record becomes your recovery runbook. Effort rises with the size of the database and media volume, with the number of environments you must rebuild, and with how many test cases your compliance or security team asks for. Repeat the rehearsal after major upgrades, since restoring an older dump onto a newer release can fail.

Which cost drivers matter most for an ESS backup project?

The main one-time costs are the planning and runbook work, the first backup run with its downtime window, and the first restore rehearsal in a separate environment. Recurring costs include scheduled backup runs, storage for dumps and media copies, retention of old backups, and periodic rehearsals after upgrades. Data size is the strongest driver: a larger PostgreSQL database and media volume mean longer dumps, more storage and longer rehearsals. Other drivers are the number of environments, the level of evidence your auditors expect, and whether a partner or your own staff carries the work. Ask any quote to separate these items so you can compare internal and external options.

Limits to confirm in your environment

A backup is only useful if it matches the software that wrote it and the storage it protects. The cards below list the versions, database ownership, storage behavior and documentation fit that you should confirm before you run the procedure in your own cluster.

ESS and Helm chart versions

Record the exact ESS Community release and the ess-helm chart version deployed in your namespace, along with the values files used to install it. The backup procedure is written against the maintenance guide in the chart repository, so the commands and resource names you dump must match the chart you actually run. Confirm the version from your deployment records rather than from memory, because a chart upgrade can change resource names and the layout of the credentials Secret.

ESS maintenance guide

Synapse and PostgreSQL versions

Confirm the Synapse version your chart runs and the PostgreSQL major version of the bundled database. Synapse 1.143.0 and later require PostgreSQL 14 or newer, so a restore into an older server will fail before any data is checked. Keep the Synapse version in the backup label so the restore target can be matched to it.

Bundled database as the only database

Determine whether the bundled PostgreSQL is the only database holding Synapse and MAS data. If you moved either service to an external PostgreSQL instance, pg_dumpall on the bundled pod will not capture that data, and your backup will look complete while missing the room and account state. Write down each database endpoint and who owns its backups.

Storage class behavior for media

Check which storage class backs the Synapse media volume and whether its snapshots or copies are consistent with the database dump taken at the same time. Confirm whether the storage supports volume snapshots, whether reclaim policies could delete the volume when a claim is removed, and how long a copy takes to complete for your media size. Media files referenced in the database must be captured in the same window as the dump.

Documentation fit with your release

Compare the maintenance guide to the release you run before you rely on it. Documentation can lag behind a chart update, so check that the scale-down steps, the names of the Secret and ConfigMap, and the dump commands still match your cluster. Where they differ, test the procedure in a non-production namespace first and record what changed.

Backups must match the running version

Rolling back Synapse after a database schema change can be difficult, so a backup taken on one release may not restore cleanly onto an older one. Take the backup while the same version that will write later data is running, label it with that version, and restore only to a matching release. Keep upgrade notes and the previous chart values so a failed upgrade does not leave you without a compatible restore point.

Backup runs scale down first, then dump, copy and restore in reverse

The backup starts from the running ESS release, where Synapse and MAS are scaled to zero before anything is captured. The bundled PostgreSQL is dumped with pg_dumpall, while the values files, the generated credentials Secret and the deployment markers ConfigMap are exported alongside the Synapse media volume. The restore path reverses the order: values and Secret go back first, PostgreSQL is loaded next, media is returned, and Synapse and MAS are scaled up only after health checks pass.

Backup and restore flow for an ESS Community release on Kubernetes.

How DeployOpen scopes and delivers ESS backup and restore

DeployOpen plans and implements self-hosted open-source platforms inside the client's own infrastructure, so backup and restore for an ESS Community deployment is designed around your cluster, storage and recovery targets. We scope the work in writing, build and test the backup job and restore runbook, then hand both to your team with documentation.

How we scope

  • Inventory the ESS release, values files, generated credentials Secret and Synapse media volume location.
  • Confirm where the PostgreSQL dump and media copies will be stored and who can read them.
  • Agree in writing the restore test, the target environment and the acceptance checks before work starts.

How we build

  • Script the maintenance sequence that scales Synapse and MAS to zero before the pg_dumpall run.
  • Capture values files, the credentials Secret and deployment markers ConfigMap with access restricted to authorized staff.
  • Rehearse the restore order in a separate namespace and record the checks that prove a working homeserver.

How we hand over

  • Deliver the backup scripts, restore runbook and a written list of artifacts with their locations.
  • Document each step with the commands used, expected output and the owner responsible for it.
  • Walk your platform and operations team through a supervised restore so they can repeat it alone.

How we support

  • Offer ongoing support and upgrades as a retainer when your ESS release or cluster changes.
  • Retest the backup and restore procedure after Kubernetes or ESS upgrades, scoped in writing.
  • Review backup retention, storage access and secret handling as part of periodic operational checks.

Sources and further reading

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.