Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Backup & Restore

Everything acme-proxy knows lives in two places: the database, and a handful of files the configuration points at. A backup is both, taken on the same schedule. This page lists them, gives the copy command for each backend, and says what a restore does and does not bring back.

What to back up

WhatDefault pathWhy it mattersIf it is lost
The databasesqlite.db (+ -wal, -shm), or the PostgreSQL database database.url namesAccounts, orders, issued certificates, revocations, the CRL, EAB credentials, operators, the job queue and the audit trailEvery certificate already issued becomes impossible to revoke through this server, and every client must register again
The CA keysigner.local_ca.key_path (ca.key)Signs every certificate and CRLNot recoverable. A new CA means distributing trust again — see The CA key is the exception
The CA certificatesigner.local_ca.cert_path (ca.pem)The trust anchor clients installedRecoverable only from wherever clients installed it
The upstream account keysigner.relay.account_key_path (upstream_account.key) and its .kid sidecarThe relay’s identity at the upstream CARegister a new upstream account; with an EAB-only upstream, that needs a fresh credential from the CA
The configurationconfig.toml, or ACME_PROXY_CONFIGEvery profile, and the URLs clients storedRewritable, but every profile name and server.base_url must come back exactly, or clients’ stored account URLs stop resolving
Secrets held outside the configurationenvironment files, *_file pathsTSIG, IPAM, SMTP, OIDC and LDAP credentialsRe-issue each at its source — see Secret Rotation

Three files need no backup. ca.crl is an export the worker rewrites from the database whenever a new CRL is signed, and ca.json.lock is always empty (see Revocation & CRL). A self-signed server.pem/admin.pem is generated again by acme-proxy init; back it up only if a client pins it.

A CA key held in a PKCS#11 token cannot be copied at all, by design. Its recovery is planned differently — see Hardware Keys → Backup and disaster recovery.

In the published container image, every default path above resolves under /data, so backing up that volume and the configuration covers everything except the secrets you passed in the environment.

SQLite

The database runs in WAL mode, so it is three files, and copying sqlite.db on its own gives you a database missing every recent write. Two ways to get a consistent copy:

# Online, against a running server: consistent by construction.
sqlite3 /var/lib/acme-proxy/acme.db ".backup /backup/acme-$(date +%F).db"

# Offline: stop every process first, then copy all three together.
systemctl stop acme-proxy
cp /var/lib/acme-proxy/acme.db* /backup/
systemctl start acme-proxy

.backup produces a single self-contained file with nothing to replay, and is the one to schedule.

PostgreSQL

pg_dump is the copy, and it is consistent while the server runs:

pg_dump --format=custom --file=/backup/acme-$(date +%F).dump \
  postgres://acme@db.internal/acme

A streaming replica is not a backup. It is what High Availability asks for so that a failover loses nothing, but it copies a mistaken DELETE just as faithfully as anything else.

Restoring

  1. Stop every process that uses the database — every role, on every host.
  2. Put the database back. On SQLite, copy the backup into place as the database.url file and delete any stale -wal and -shm beside it. On PostgreSQL, restore into an empty database with pg_restore.
  3. Put the files back, and check their owner and mode: ca.key must be 0600 and readable only by the uid that runs the worker role. A file restored from a backup often is not.
  4. Run acme-proxy migrate if the backup predates the binary you are running. Migrations only move forward, so an older backup comes up to date, but a backup taken by a newer binary needs that newer binary.
  5. Start the worker first, then the other roles, and watch for server_startup in the log.

A restore rolls the server back to the moment of the backup. Whatever happened since is gone from its point of view:

  • Certificates issued since are still valid and still trusted, but their orders are gone, so acme-proxy order revoke cannot find them, and an ACME client’s revokeCert for one is refused as an unknown certificate. Nothing can put them on this server’s CRL any more, which is the strongest reason to keep the backup interval short.
  • Revocations made since are lost too: the CRL the restored server signs next no longer lists them. Revoke them again, from the audit trail of the lost period if you have it, or from your own records.
  • The CRL number goes back with the rest. RFC 5280 expects it only to increase, and a relying party that cached a CRL signed after the backup may prefer it until its nextUpdate, so a revocation made in that window may not be seen until then.
  • Accounts registered since no longer exist. Their clients get accountDoesNotExist and register again on their own.

Testing a backup

A backup is only as good as the last restore that worked. Restore into a scratch copy and ask it something, with the server untouched:

cp /backup/acme-2026-10-23.db /tmp/restore-test.db
ACME_PROXY_DATABASE__URL=sqlite:///tmp/restore-test.db \
  acme-proxy order list --limit 5

An admin command against a database whose schema is behind refuses by name, which is itself a useful thing to learn before the day it matters.

Moving to another backend

Changing backend is not a restore: acme-proxy transfer --to <url> copies every row, ids and serials included, from the configured database into a new, migrated, empty one. See Admin CLI → Moving between backends.