Backing up and restoring Zammad on Docker

Zammad on Docker needs more than a volume snapshot to restore cleanly. This page explains the zammad-backup service, the restore directory procedure, file storage purging and the Elasticsearch rebuild that follows.

On this page

How to back up and restore Zammad on Docker without losing tickets

This section covers how to run the zammad-backup service in a Docker Compose or Portainer deployment, including nightly and one-off backups, the restore directory procedure, and the Elasticsearch rebuild that follows a restore. Operators who run Zammad in containers need this path because tickets, customer records, attachments and configuration do not survive a lost host, a failed upgrade or a move to new infrastructure unless a recovery has been rehearsed. A backup exists for four situations: data loss from a bad change or deletion, a failed upgrade that must be rolled back, loss of the host or its volumes, and a planned move to another server.

Zammad's data is spread across three places, and a backup is only usable if all three are captured together. Ticket and account data sits in PostgreSQL, attachments and other files sit in file storage (inside the container volumes or in a separate store), and the search index lives in Elasticsearch, which is optional but changes how search and reporting behave. The exact file layout, service names, volume names and restore steps differ between Zammad releases, so the procedure must be checked against the version you run and the current Docker Compose documentation before it is written into a runbook. Confirm the zammad-backup image tag and its configuration keys with the vendor documentation for your release, not from memory.

Treat the first restore as the real test. Restore a recent backup into a separate, isolated Compose project, confirm that you can log in, open tickets with attachments, and run a search, then record how long the restore took. Schedule that test again after each major change to the stack, and keep at least one copy of each backup off the host that runs Zammad. Ask your DeployOpen contact or the Zammad team to confirm which backup items the nightly job covers in your version, and whether the Elasticsearch index must be rebuilt after a restore, because a restored database without a matching index returns incomplete search results until the rebuild finishes.

Which backup approach fits which Docker setup

This table compares the zammad-backup service, volume-based snapshots and separate database dumps on what each captures, how much work a restore takes and which setups they suit. Read it to shortlist an approach, then confirm the exact contents of each option against the Zammad Docker documentation for your release before you rely on it.

ApproachWhat it capturesRestore effortWhen it fits
zammad-backup serviceDatabase and file storage as produced by the zammad-backup container in your Compose or Portainer stack, on a schedule or as a one-off runPlace the backup in the restore directory and follow the documented restore procedure, then rebuild the search indexStandard Docker Compose or Portainer stacks where the team wants Zammad's own backup format and a repeatable procedure
Host or hypervisor volume snapshotsEverything on the Docker volumes at the moment of the snapshot, including PostgreSQL data and attachment storage if both live on those volumesRestore the volumes to a host with the same stack definition, then verify; restore is fast but tied to the storage platformHosts already backed up by a hypervisor or storage layer that can snapshot all volumes at one point in time
Volume snapshots taken without quiescingA copy of PostgreSQL files and file storage taken at different moments, which may not match each otherHigh risk: the database and attachments can disagree after restore, so treat as unreliable unless the vendor guidance says otherwiseGenerally avoid. Use only if the snapshot tool can freeze or flush PostgreSQL and file storage together
Separate PostgreSQL dumpsDatabase contents only, unless file storage is copied separatelyRestore the dump into a matching PostgreSQL version, then restore attachments and config from their own copiesTeams that already run database dump tooling and can cover file storage and configuration in the same schedule
Copies of file storage and configurationAttachment storage and environment or config files outside the databaseOnly useful together with a database copy taken at the same timeAs a complement to any of the options above, not a standalone backup

How the Docker parts map to a backup

The diagram starts at the running Zammad application containers, which write to PostgreSQL, the file storage location and Redis. The zammad-backup service reads the database and file storage and writes a backup to a backup volume or host path, from which an off-host copy is made. On restore, the backup is placed in the restore directory of a fresh Compose stack, and PostgreSQL and file storage are restored from it. The Elasticsearch index is not restored; it is rebuilt after the restore, so check search results once the rebuild finishes.

Restored data flows from the backup into a fresh stack, while the search index is rebuilt.

What a Zammad backup on Docker must capture and what it leaves out

A usable Zammad restore on Docker needs three things captured together: the PostgreSQL database that holds tickets, users and settings, the attachment and file storage that the database points to, and the configuration the containers depend on. That configuration includes the environment values, the secrets the stack reads at startup and the reverse proxy settings that route traffic to Zammad. A database dump without the matching file storage or environment values can restore tickets whose attachments are missing or a stack that will not start with the same secrets. Before you rely on the zammad-backup service, confirm for your release whether it archives file storage and configuration, or only the database, and write down every item it leaves out, such as compose files, .env values, TLS certificates and custom images, so those are backed up by your own process.

The Elasticsearch index is derived data. Zammad builds it from the database and attachment content, so after a restore you should plan to rebuild it rather than trust a copy in the backup. Expect search to be degraded until the rebuild finishes. Redis is different in kind: it holds transient realtime state for websocket communication, not the system of record for tickets or users. Backing it up is not required for recovery, and a restored stack should be expected to repopulate Redis as sessions reconnect. Confirm this behavior in the Zammad documentation for your version, because the Redis requirement and its role are described in the Zammad software requirements.

Turn the answer into a written inventory that lists each component, where it lives on the host or in a named volume, who owns its backup, and how a restore is verified. Include the items the service does not cover and the process that covers them. The inventory becomes the checklist for scheduled restore tests, because a backup that has never been restored into a clean stack is an assumption, not evidence. Keep the list with the runbook so the person restoring at night can see which steps depend on the backup service and which depend on manual copies.

Set up nightly and one-off Zammad backups in Docker Compose or Portainer

This sequence adds the zammad-backup service to an existing Zammad Compose stack, proves a manual backup is complete, and then turns on the nightly schedule with a record of where backups land. Each step ends with a check so you know the backup path works before you rely on it.

  1. Confirm the Zammad release and Compose file

    Record the Zammad release you run, the Compose file or Portainer stack that defines it, and the names of the containers and volumes already in use. Check the release against the Zammad releases page and the Docker Compose installation documentation so the backup service matches your version. Confirm that the stack starts cleanly before any change. Done when you have a written copy of the current file and a note of the running release.

  2. Add the zammad-backup service

    Add the zammad-backup service to the Compose file as described in the Zammad Docker Compose installation documentation, using the image tag and settings the documentation gives for your release. Keep the service on the same Compose network and share the Zammad data volumes it needs to read. In Portainer, make the same change in the stack editor and redeploy. Done when the stack deploys and the backup container appears as running or as a defined service with no startup errors in its logs.

  3. Set the backup location

    Point the backup output at a named volume or a host path that the Docker host can write to, and confirm it has enough free space for a full backup of your database and attachments. Check current disk use on the host before you choose the location, and plan for growth as attachments accumulate. Do not place the backup target on the same disk as the live database volume if you can avoid it. Done when the target path or volume exists, is writable from the backup container, and shows free space in the host check.

  4. Run one manual backup

    Trigger a single backup on demand using the one-off command in the Zammad documentation for your release, rather than waiting for the schedule. Watch the container logs until the command reports completion or exits with an error. Keep the terminal output or log lines so you can compare them with later runs. Done when the command finishes without errors and the logs name the files it wrote.

  5. Check the backup files and sizes

    List the files in the backup location and confirm that the set of files includes the database dump and the attachment archive or storage data your configuration uses. Compare sizes with the expected order of magnitude from your own data, and flag any file that is empty or far smaller than the others. Open the directory listing from the host, not only from inside the container, to confirm the files persist outside it. Done when every expected file is present, non-empty, and visible on the host.

  6. Enable the nightly schedule

    Turn on the scheduled backup using the setting described in the documentation for your release, such as the schedule variable or cron expression the service reads. Use the exact schedule format the documentation specifies, and confirm the time zone the container uses. Record the schedule in your change log. Do not assume a retention period or file naming scheme unless the documentation for your release states it; confirm both with the vendor documentation. Done when the stack redeploys with the schedule set and the service reports it is waiting for the next run.

  7. Confirm the first scheduled run

    After the first scheduled time passes, read the backup container logs and the backup location to confirm a new set of files appeared with a timestamp from that run. Compare its file list and sizes with the manual backup from earlier. If nothing appears, check the schedule format, time zone and container health before changing anything else. Done when the scheduled run has produced a complete set of files that matches the manual backup.

  8. Record where backups are stored

    Write down the backup location, host path or volume name, schedule, the container or stack name that runs it, and the restore steps owner. Store this record with your Zammad runbook so an operator can find the backups during an incident. Also note whether copies leave the Docker host, since off-host copies are a separate decision you still need to make. Done when the record exists in your documentation system and names a person responsible for checking it.

Restore into the same Docker host or a new one

When an upgrade leaves the stack unable to start or returns errors to agents, the usual path is to return the same host to the state before the change. Restore into the same Zammad version that produced the backup, because the database schema and file layout belong to that release. Confirm the image tag in your Compose file or Portainer stack before you start, and rehearse the full sequence on a non-production copy first.

  • Preserve the failed state: Copy the current volumes or record the failed image tags so you can analyze the cause later without losing evidence.
  • Pin the previous version: Set the image tag back to the release that matches the backup, and keep the environment file unchanged unless the release notes say otherwise.
  • Place the backup in the restore directory: Copy the archive to the restore directory the zammad-backup service reads, then run the restore for that backup only.
  • Purge file storage only when needed: If current attachments do not match the backup, purge file storage before the restore so files from the failed state do not mix with restored records.
  • Confirm the application starts: Check container logs for database or migration errors, then sign in and open a known ticket with an attachment.

Before agents return, confirm that ticket counts, attachments and the outbound mail queue match the backup timestamp, and note that the search index may need a rebuild.

Security risks in Zammad backup files and restore access

A Zammad backup is a copy of the whole helpdesk: tickets, customer contact details, attachments and configuration. The cards below cover where that exposure appears, from the backup volume and off-host copies to restore rights and the restored system itself, with the control to apply at each point.

Backups hold customer personal data

A backup of Zammad carries the same personal data as production: customer names, email addresses, phone numbers, ticket bodies and attachments. Treat each backup archive as a copy of the production database and file storage, and classify it at the same level. Before go-live, confirm with your data protection lead which categories of personal data your tickets contain, so the backup inventory and any records of processing describe the copies accurately.

Backup volumes need production access control

Docker backup volumes and any off-host copies are often mounted on a host that has looser permissions than the production stack. Apply the same identity, role and encryption controls to backup storage as to the live Zammad volumes, and restrict who can list, read or copy the backup directory. Check the permissions on the backup path and on every replica or sync target, not only on the primary host.

Restore rights can overwrite live data

A restore replaces the database and file storage that agents work in, so whoever can run a restore can destroy current tickets. Limit restore to a small named group, require a change record that names the backup being restored, and separate the right to create backups from the right to restore them. Test restores on a separate Compose project or host first, never directly over the production volumes.

Secrets in configuration may be backed up

Environment files and configuration held in or near the Zammad stack can contain database passwords, Redis credentials, secret keys and mail account secrets. If the backup captures these values, every copy of the archive becomes a credential store. Inventory which secrets the backup contains, keep the secrets in a managed store where possible, and rotate them after any backup file is exposed outside the authorized group.

Old backups outlive retention promises

Nightly backups accumulate quietly, and copies made before a deletion request or retention cut-off can keep personal data for longer than your policy allows. Set a written retention period for backup archives, make the rotation job enforce it on every copy, and record how deleted customer data is handled in backups. Ask your legal or privacy team to confirm the period before you configure the schedule.

Restored systems need re-hardening first

A restored Zammad comes back with the configuration, accounts and exposure of the time the backup was taken. Before the restored instance is reachable by customers or agents, apply the current patch level, review admin accounts and API tokens, and confirm the reverse proxy and access rules. Add these steps to the restore runbook as gates, so the restored system is not published until each one is signed off.

Why the Elasticsearch index must be rebuilt after a restore

Search results after a restore can be stale or incomplete until the Elasticsearch index is rebuilt. Zammad uses Elasticsearch for faster search, for reporting features, and for searching the content of email attachments. Elasticsearch is optional, but Zammad strongly recommends it, and a Docker Compose deployment usually runs it as its own service with its own volume. The index is a separate copy of ticket and article data. When the PostgreSQL database and file storage come back from a backup, the index still reflects whatever state it had when it was last written, so it can disagree with the restored database. Tickets that exist in the database may be missing from search, and records changed or deleted since the index snapshot may appear in results that no longer match what agents see.

The rebuild runs after the database and attachments are back in place, and it is a separate step from the restore itself. Search may be degraded while the rebuild runs, so agents should not be told that search is fully working during that window. Plan the restore for a period when search gaps are acceptable, and confirm with your team how long the rebuild takes on your data volume and hardware, since that depends on your environment. Once the rebuild finishes, open several tickets you know well, including one with an attachment whose text you can recognize, and search for their subject, customer, and attachment content. Compare the results with the ticket itself. If a known ticket is missing or an attachment term does not match, the rebuild is not complete.

For the full procedure, including how to trigger the rebuild in a Docker deployment and how to check the result, see the separate page on rebuilding the Zammad Elasticsearch index. Keep the Elasticsearch volume in your backup plan as well, because restoring an older index snapshot is not a substitute for a rebuild when the database has moved on.

Questions teams ask before they back up or restore Zammad on Docker

What does it cost to back up Zammad on Docker?

Zammad has no license fee for self-hosted use, so the cost is the work and the infrastructure around it. One-time costs include building the backup procedure, writing the restore runbook and setting up a test environment. Recurring costs include backup storage on the host and an off-host copy, scheduled restore tests, and index rebuilds when Elasticsearch is in use. The main cost drivers are the size of the PostgreSQL database, the volume of attachments and where they are stored, the number of Docker hosts, whether Elasticsearch runs, and whether restores have ever been rehearsed. When you ask for a quote, request a written scope that lists the hosts, data volumes, retention period, off-host copy method and the restore tests included.

How long does a Zammad restore take on Docker?

The restore time depends on the database size, the attachment volume, the CPU and disk speed of the host, and whether an Elasticsearch index rebuild follows the restore. No duration is published for this work, so the only reliable answer comes from a test restore. Run the restore on a copy of recent production data, on a host with the same specification as the target, and time each phase separately: restoring the database and files, starting the containers, checking that agents can log in and see tickets, and rebuilding the search index. Record the results and use them to set your recovery expectations and maintenance windows.

What must we provide before a Zammad backup project starts?

Prepare these items before work begins:

  • A Docker host or hosts where Zammad runs, with Docker Compose or Portainer access for the people doing the work.
  • Storage for nightly backups and a separate location for an off-host copy.
  • Access to the Compose files, environment files and the secrets they reference, handled under your own secret management rules.
  • A test environment that runs the same Zammad release, PostgreSQL and Redis versions as production. The software requirements list PostgreSQL 15 or newer and Redis 7 or newer.
  • A named owner on your side who can approve the restore test results and the maintenance windows.

Confirm the Zammad release you run against the Docker Compose installation documentation before you plan the backup configuration.

Can an internal team back up and restore Zammad alone?

Yes, an internal team can run backups and restores alone if it has Docker and Linux skills, basic PostgreSQL knowledge and a rehearsed runbook. The critical factor is not the first backup but the restore. Schedule restore tests into a test environment at a regular interval, record the time each step takes, and update the runbook after every test. Teams that never restore a backup often discover missing secrets, mismatched versions or missing attachment data only during an incident. If your team lacks time or experience, DeployOpen can plan, implement, document and test the backup and restore procedure under a fixed scope agreed in writing before work starts, and then your team keeps operating it.

Does a Zammad support subscription cover backups and restores?

The Zammad pricing page lists self-hosted support subscriptions with response times: Business at 2,999 EUR per year with a 6 hour response, Enterprise at 5,999 EUR per year with a 4 hour response, and Corporation at 9,999 EUR per year with a 2 hour response. Compare those response times with the recovery time your business needs, and do not treat a response time as a restore time. The published information does not state whether backup and restore assistance is part of each tier, so ask Zammad directly in writing before you rely on it. You can review the tiers on the Zammad pricing page.

Do we need Elasticsearch to back up and restore Zammad?

Elasticsearch is optional for Zammad, but the software requirements describe it as strongly recommended because it provides faster search, reporting features and search inside email attachment content. If you run it, include it in the backup plan and in the restore test, since search will be degraded until the index is rebuilt after a restore. Confirm how your installation stores search data and the rebuild steps for your release before the first restore test. Once the restore is verified, check search results against known tickets to confirm the index is complete.

Should we back up Zammad with the backup service or with volume snapshots?

Use the dedicated backup service for an application-aware backup, and use volume snapshots only if you can prove they capture the database and attachment storage at the same point in time. A snapshot taken while Zammad writes to PostgreSQL and the file system can produce a backup that restores with mismatched records and attachments. The backup service is easier to verify against the Zammad configuration, while snapshots are useful for host recovery. Whichever method you choose, test the restore end to end, store at least one copy off the host, and document which method covers which data.

What to confirm in your environment before relying on these backups

A backup of Zammad is only useful if it restores into the release and infrastructure you actually run. The cards below list the points to check against the Zammad documentation, the release notes and your own restore test before you treat a Docker backup as recovery-ready.

Zammad release and backup service support

Confirm that the zammad-backup service you deploy supports the exact Zammad release your Compose file or Portainer stack runs. Zammad 7.2 was released on 23 September 2026, followed by security releases 7.2.1 and 7.2.2, and a security release 6.5.5 shipped in parallel for the 6.5 line. Check the image tag you pin against the release notes, because a backup taken on one release may not restore cleanly onto another. Record the tag alongside each backup set.

Zammad releases

Exact contents of each backup

Find out from the Zammad documentation which parts of the instance the backup captures and which it leaves out, such as the database, attachments on disk, configuration volumes or the search index. A backup that omits the file storage path will restore tickets without their attachments. Write the inclusion list down, then compare it with the volumes listed in your Compose file so nothing stored outside the backup set is missed.

Storage location and capacity

Decide where backup archives are written and confirm that the target has room for several retention cycles, not just one night. Ask whether the service writes to a host path, a named volume or a remote target, and whether it can copy off-host. A backup stored only on the same Docker host shares its failure domain with the live instance, so an off-host copy should be part of the plan. Monitor free space on that path, since a full disk can silently stop nightly jobs.

Restore procedure in a test environment

Run the restore directory procedure on a separate Docker host or a disposable Compose project before you need it in an incident. Confirm the exact directory layout the restore expects, the order of steps, and whether the restored instance comes up with the same secrets and environment file. Your own test is the only reliable proof that a backup restores, so record the time it took and any manual fixes you had to make.

Elasticsearch version and rebuild behavior

Check which Elasticsearch version your stack runs and whether the restored instance needs a search index rebuild afterwards. Search results, reporting and attachment content search depend on Elasticsearch, and it is optional but strongly recommended according to the Zammad software requirements. Confirm in the documentation whether the backup contains index data or only the database, and plan for degraded search until the rebuild finishes.

Software requirements

File storage in the database or on disk

Confirm whether your instance keeps ticket attachments in PostgreSQL or on the file system, because that choice decides what a database dump alone can recover. Zammad requires PostgreSQL 15 or newer, and the backup must match where the files actually live. If attachments sit on disk, verify that the file storage volume is captured and that the purge of file storage does not remove data you still need. Check the setting in your own instance rather than assuming a default.

How DeployOpen scopes and tests Zammad backup and restore

DeployOpen approaches backup and restore for Zammad on Docker as a written, fixed-scope piece of work inside infrastructure you control. The engagement covers the backup service, the restore procedure, the search index rebuild afterwards and the evidence your team needs to trust the setup.

How we scope

  • Confirm which Docker Compose or Portainer stack runs Zammad, and where PostgreSQL, Redis and attachments are stored.
  • Agree in writing whether nightly backups, one-off backups, volume snapshots or all three are in scope.
  • Record retention, off-host copy location, and who may trigger a restore before any build starts.

How we build

  • Configure the zammad-backup service for scheduled runs and document the one-off backup command your team will use.
  • Test the restore directory procedure on a separate host using a copy of recent backup data.
  • Verify the Elasticsearch rebuild after a restore and confirm search results match expected tickets.

How we hand over

  • Deliver a runbook covering backup schedule, restore steps, file storage purge and post-restore index rebuild.
  • Walk your operations team through a supervised restore so they have run the procedure themselves.
  • Provide a written record of test results, open items and the settings that differ from the defaults.

How we support

  • Offer ongoing support and scheduled restore testing as a retainer, priced from the written scope.
  • Retest the backup and restore path after Zammad upgrades, Compose file changes or storage moves.
  • Confirm with Zammad which backup behavior applies to your release before changing the stack.

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.