How to back up Supabase in Docker (2026)
To back up Supabase in Docker you cannot just dump the database — you also need the app's data volumes and its config. Dockstash dumps its PostgreSQL database consistently, captures the 2 volumes of on-disk data, and snapshots docker-compose.yml plus .env in one encrypted run.
What Supabase stores
| Compose services | supabase-db (postgres), storage, kong, auth, rest |
|---|---|
| Databases detected | postgres |
| Data volumes | db_data (/var/lib/postgresql/data), storage_data (uploaded files) |
| Config paths | docker-compose.yml, .env, volumes/api/kong.yml |
The backup plan
- Dump the PostgreSQL cluster. Run pg_dumpall -U "$POSTGRES_USER" against the supabase-db container to capture auth, storage metadata, and all your application schemas including roles.
- Capture the storage volume. Restic the storage volume that holds uploaded files. Supabase Storage keeps object metadata in Postgres but the binary objects live on disk (or in the bundled MinIO/S3).
- Capture compose, .env, and gateway config. Restic docker-compose.yml, .env (JWT secret, service keys), and kong.yml so the API gateway and auth secrets match on restore.
Restoring Supabase
Restore pg_dumpall (which includes roles used by RLS policies) to staging, then restore the storage volume so object rows and files stay in sync. The JWT secret in .env must be preserved or issued tokens and auth break.
Back up Supabase in one click All guides
Last updated: July 2026
Related database guides
Frequently asked questions
What makes Supabase backups more than just Postgres?
Supabase is Postgres plus auth, storage, and an API gateway. You need pg_dumpall (including roles for row-level security), the storage volume for uploaded files, and the .env secrets (JWT) for auth to work after restore.
Why pg_dumpall instead of pg_dump for Supabase?
Supabase relies heavily on Postgres roles for row-level security. pg_dumpall captures global objects like roles; a plain pg_dump would omit them and break RLS on restore.
Where are uploaded files stored?
Supabase Storage keeps metadata in Postgres and the binary objects on disk (or in bundled object storage). Back up both so file references resolve after a restore.