How to back up Plausible Analytics in Docker (2026)

A complete Plausible Analytics backup has three parts: dump its PostgreSQL and ClickHouse databases the correct way, capture the 2 data volumes that hold files on disk, and save the compose file and .env. Dockstash detects all three automatically, dumps the database from the running container, and restics everything off-site.

What it stores

What Plausible Analytics stores

Compose servicesplausible, postgres, clickhouse
Databases detectedpostgres, clickhouse
Data volumespg_data (/var/lib/postgresql/data), clickhouse_data (/var/lib/clickhouse)
Config pathsdocker-compose.yml, .env, clickhouse/clickhouse-config.xml
Step by step

The backup plan

  1. Dump the PostgreSQL metadata database. Run pg_dumpall -U "$POSTGRES_USER" to capture sites, users, and configuration. Postgres holds account and site metadata, not the event stream.
  2. Back up the ClickHouse event store. Use the ClickHouse BACKUP statement (or clickhouse-backup) to snapshot the analytics events table consistently — never copy /var/lib/clickhouse live.
  3. Capture compose and config. Restic docker-compose.yml, .env (SECRET_KEY_BASE), and the clickhouse config so both databases reconnect correctly on restore.

Restoring Plausible Analytics

Plausible splits data across two databases: Postgres for metadata and ClickHouse for the raw event stream. Restore both — a Postgres-only restore loses all analytics history. Preserve SECRET_KEY_BASE in .env.

Back up Plausible Analytics in one click All guides

Last updated: July 2026

Frequently asked questions

Why does Plausible use two databases?

PostgreSQL stores account, site, and configuration metadata; ClickHouse stores the high-volume analytics event stream. A complete backup dumps both — miss ClickHouse and you lose all historical stats.

How do I back up the ClickHouse part?

Use the native BACKUP statement or clickhouse-backup for a consistent snapshot of the events table. Copying /var/lib/clickhouse live is inconsistent because parts merge in the background.

Is the Postgres backup alone enough?

No. It only captures metadata. Without the ClickHouse backup you would restore your site list but none of the collected analytics data.