Skip to content

Backups and restore

An OpenFlare install keeps its state in a handful of Docker volumes plus files under the configuration root. This page lists each piece, what it contains, and concrete commands to back it up and restore it.

State Where it lives Contains Back up with
Control plane database Volume plane-db (Postgres, database vrt_plane, user vrt) Teams, workers, publications, versions, hostnames, variables, worker secret ciphertext, usage and reports pg_dump
Worker bundles Volume plane-bundles (/data/bundles, PLANE_BUNDLE_DIR) Content-addressed, additive worker bundles Volume archive
Static assets Volume plane-assets (/data/assets, PLANE_ASSET_DIR) Static-deploy assets Volume archive
ACME state Volume traefik-acme (/acme/acme.json) ACME account key and issued certificates Volume archive. Never delete it
D1 data Volume cell-sql-data D1 SQLite databases and queue data served by vrt-sql Stop the SQL services, then archive
KV data Volume kv-data (Redis, append-only file) Tenant KV namespaces Stop Redis, then archive
R2 data Volume r2-data (Silo, an S3-compatible store) R2 buckets and objects Stop Silo, then archive (or use an S3 mirror tool)
Durable Object and Workflow data Volumes cell-data and cell-cc-data Runtime and controller data for the cell Stop the cell services, then archive
Cell configuration Volume cell-config (/etc/vrt) Rendered by cell-init at start Regenerated. Archive only if you want an exact copy
Updater job state Volume updater-state (/state) Job history and pre-upgrade <job-id>-postgres.sql dumps Optional
Operator configuration /var/lib/openflare .env (mode 0600), the secrets/ directory, rendered Traefik config, image-digests.txt File copy, preserving permissions
Secrets PLANE_SECRETS_KEY, PLANE_SIGNING_SECRET, PLANE_ADMIN_TOKEN, CONSOLE_AUTH_PASSWORD and others See Security Part of the configuration copy, and also store the first two separately

Compose project name is openflare-all-in-one, so Docker names the volumes openflare-all-in-one_<volume> (for example openflare-all-in-one_plane-db). Confirm on your host:

Terminal window
docker volume ls --filter name=openflare-all-in-one_

Throughout this page, run Compose from the checkout with the env file:

Terminal window
cd /opt/openflare
export DC="docker compose --env-file /var/lib/openflare/.env -f docker-compose.all-in-one.yml"

The database contains worker secrets only as ciphertext. Without the encryption key the ciphertext is useless, and the key is not in the database.

  • PLANE_SECRETS_KEY encrypts worker secrets, Secrets Store values, Hyperdrive passwords and Postgres tenant tokens. If you lose it you must re-enter every secret. Changing it makes stored secrets unreadable.
  • PLANE_SIGNING_SECRET derives the Ed25519 key that signs publications. If you lose it you must establish trust in a new key on every cell.

Store both in your password manager or secrets vault, separately from the database backup. Also back up the whole configuration root, because it holds the env file and the file-backed secrets:

Terminal window
sudo tar --numeric-owner -czpf openflare-config-$(date +%F).tar.gz -C / var/lib/openflare
sudo chmod 600 openflare-config-*.tar.gz

Treat this archive like a credential store. It contains the master secrets and the Cloudflare API tokens.

Terminal window
$DC exec -T postgres pg_dump -U vrt -d vrt_plane | gzip > plane-$(date +%F-%H%M).sql.gz

This takes a consistent dump while the plane keeps running. The plane state is small. Protect the file, because it holds worker secret ciphertext.

Restore into an empty database of a matching OpenFlare version. A dump from a different release train can carry a schema the running plane does not expect.

Terminal window
# 1. Stop the services that use the database
$DC stop plane console
# 2. Recreate an empty database
$DC exec -T postgres psql -U vrt -d postgres -c 'DROP DATABASE IF EXISTS vrt_plane;'
$DC exec -T postgres psql -U vrt -d postgres -c 'CREATE DATABASE vrt_plane;'
# 3. Load the dump
gunzip -c plane-2026-12-02-0300.sql.gz | $DC exec -T postgres psql -U vrt -d vrt_plane
# 4. Start the plane again
$DC up -d plane console

After a restore, the plane’s revision fence stops the restored database from re-signing a revision that a cell has already applied, so cells that are ahead of the backup are never forced backwards. Publish a new revision from the console to bring everything forward.

If you use the in-panel updater, every upgrade also writes <job-id>-postgres.sql into the updater-state volume. To copy one out:

Terminal window
docker run --rm -v openflare-all-in-one_updater-state:/state -v "$PWD":/out alpine \
sh -c 'ls -1 /state/*-postgres.sql && cp /state/*-postgres.sql /out/'

Treat that dump as a safety point taken just before an upgrade, not as your regular backup.

For volumes that hold plain files (plane-bundles, plane-assets, traefik-acme), you can archive while the stack is running. Bundles are content-addressed and additive, so a copy that misses the newest files is still internally consistent.

Terminal window
# Archive
docker run --rm -v openflare-all-in-one_plane-bundles:/data:ro -v "$PWD":/backup alpine \
tar -czpf /backup/plane-bundles-$(date +%F).tar.gz -C /data .
# Restore into an empty volume
docker run --rm -v openflare-all-in-one_plane-bundles:/data -v "$PWD":/backup alpine \
sh -c 'cd /data && tar -xzpf /backup/plane-bundles-2026-12-02.tar.gz'

Substitute the volume name and archive name for plane-assets, traefik-acme and the others.

The traefik-acme volume holds the ACME account and the issued certificates. Back it up and do not delete it. Deleting it forces new issuance and can run into certificate authority rate limits. If you must restore onto a fresh host, restore this volume before the first start so Traefik reuses the existing certificates. Certificates can always be reissued through DNS-01 as long as your Cloudflare tokens still work. See TLS certificates.

These stores are live databases or object stores. To get a consistent copy, stop the service that writes them, archive the volume, then start it again.

Data Services to stop Volume
D1 (SQLite) vrt-sql, vrt-sql-follower cell-sql-data
KV (Redis) redis kv-data
R2 (Silo) silo r2-data
Durable Objects, Workflows and controller state vrt-host, cell-controller, vrt-provider cell-data, cell-cc-data

Example for D1:

Terminal window
$DC stop vrt-sql vrt-sql-follower
docker run --rm -v openflare-all-in-one_cell-sql-data:/data:ro -v "$PWD":/backup alpine \
tar -czpf /backup/cell-sql-data-$(date +%F).tar.gz -C /data .
$DC up -d vrt-sql vrt-sql-follower

Redis runs with the append-only file enabled and snapshotting disabled. The password for Redis is REDIS_PASSWORD in the env file. For the Silo object store, the root credentials are VRT_R2_ACCESS_KEY and VRT_R2_SECRET_KEY, which you must also keep in the configuration backup.

To restore any of these, stop the same services, restore the archive into the (emptied) volume as shown above, and start the services again.

  1. Install Docker and restore /var/lib/openflare from your configuration archive, preserving ownership and modes (the secrets/ files are mode 0600 and the database URL is owned by uid 1000).
  2. Check out the same release tag in /opt/openflare and keep OPENFLARE_IMAGE_TAG pinned to it.
  3. Create the volumes by running $DC create, or restore the archives into volumes you create with docker volume create. Restore traefik-acme early.
  4. Start only Postgres ($DC up -d postgres), then restore the dump as described above.
  5. Start the rest ($DC up -d).
  6. Verify with Health and monitoring, then publish a new revision from the console if any cell reports an older one.

The control plane prunes old operational data on a timer. These are the defaults, set as environment variables on the plane through the env file:

Env Default What it prunes
PLANE_LOG_RETENTION_DAYS 7 Ingested worker logs
PLANE_OPS_RETENTION_DAYS 30 Terminal D1 and cell operations. Unexpired pending operations are never deleted. Expired pending ones are reclaimed after a one-day grace
PLANE_METRICS_RETENTION_DAYS 14 Cell reports (metrics and resource snapshot history)
PLANE_ASSET_RETENTION_DAYS 7 Unreferenced asset manifests and objects
PLANE_PUBLICATION_KEEP 20 Terminal-acknowledged publications kept per cell
PLANE_RETENTION_SWEEP_MS 21600000 (6 hours) Sweep interval. 0 disables the sweep

Retention keeps what you could still need to roll back. A bundle is retained while any retained publication references it, so a cell can always fetch the bundle for a publication it may still be asked to apply. Asset retention is version-safe in the same way.

You can also trigger a prune on demand with POST /api/v1/maintenance/prune (see Management API). The plane source tree also has a standalone maintenance entry point (src/maintain.ts, accepting --keep, --log-days, --ops-days and --metrics-days) for cron-driven setups. The built-in sweep is normally all you need.

Item Frequency
Postgres pg_dump Daily, kept off the host
Configuration root archive and the two master secrets After every change to configuration or secrets
plane-bundles, plane-assets Daily
traefik-acme Weekly, and before any host migration
D1, KV, R2 According to how much tenant data matters to you, in a maintenance window
Restore drill Quarterly

See the Production checklist for the go-live items that depend on backups.