Back up a Supabase database automatically
A copy of your Supabase project's Postgres database, every night or every few hours, in a Google Drive, S3 bucket or other cloud that is yours and not Supabase's.
Why a copy outside Supabase
Supabase's own backups depend on your plan, and they live inside the same Supabase account as the project. If the project is paused, deleted, or the account is lost, they go with it. A dump in storage you control is the copy that survives that, and it is a plain PostgreSQL file any Postgres server can load, so it is also your way out if you ever move.
The do-it-yourself way
The Supabase CLI makes a dump from your own machine:
supabase db dump --db-url "$SUPABASE_DB_URL" -f schema.sql
supabase db dump --db-url "$SUPABASE_DB_URL" --data-only -f data.sql
That is a good one-off. Run on a schedule, it needs a machine that is always on, and the same care as any cron job: a failure nobody hears about, and old copies nobody deletes.
Steps
- In Supabase, open your project, press Connect, and copy the Session pooler connection string (port 5432). The direct connection answers over IPv6 only, and the transaction pooler (port 6543) does not suit pg_dump.
- Sign in here, open Databases, press Connect a database and choose Supabase. Paste the string with your database password in it. TLS is switched on for you.
- Press Schedule on its card. Choose the cloud and folder, how many backups to keep (1 to 365), and how often: every 6 hours, every 12 hours, every day, every Sunday or on the 1st of every month.
- Save. The first backup starts at once.
What each backup is
- A plain SQL dump from a current
pg_dump, with--clean --if-existsand no owners or grants, gzipped: one dated file such asmyapp-2026-11-04-020000.sql.gz. - Everything the database user can read is in it, including Supabase's own schemas such as
authandstorage. To keep only your application's tables, listpublic.*under Tables. A table list copies tables only, not functions, types or extensions. - Files in Supabase Storage buckets are not in the database. Connect Supabase Storage as a cloud of its own and copy or schedule its buckets into the same place.
Encrypted backups
Give the database a backup passphrase (12 characters or more) and every backup is encrypted with AES-256 before it leaves our server; its name gains .enc. The cloud you save into then holds nothing readable. To open one on your own computer, with the OpenSSL that comes with macOS, Linux and Git for Windows:
openssl enc -d -aes-256-cbc -pbkdf2 -iter 600000 -in myapp-2026-11-04-020000.sql.gz.enc -out myapp-2026-11-04-020000.sql.gz
Keep the passphrase somewhere safe. Without it nobody, including us, can open the backups.
Restoring
From the app: press Restore on the card, pick a backup, type the database's name to confirm. Every table in the backup is dropped and recreated; tables not in it are left alone.
By hand, into Supabase or any other Postgres:
gunzip -c myapp-2026-11-04-020000.sql.gz | psql -v ON_ERROR_STOP=1 "$SUPABASE_DB_URL"
Restoring a whole dump into a new Supabase project can clash with the auth and storage schemas Supabase creates for itself; a backup of public.* restores cleanly.
Limits
- A backup is the data at one moment, not a continuous replica or point-in-time recovery.
- A backup stops after 2 hours, or past 20 GB compressed, unless the operator has changed those limits.
- Each backup's size counts towards your transfer allowance.
Questions
Does this work on Supabase's free plan?
Yes. It connects as any Postgres client does, through the session pooler, so it works on every Supabase plan. A paused project cannot be backed up until it is resumed.
Neon, Railway, Render?
Choose Neon by name, or PostgreSQL for the others, and paste the connection string. On Neon, use the direct connection string rather than the pooled one.
Try it
Prepaid: 30 GB free, then 500 GB for ₹100 or 2,500 GB for ₹500, each valid a year. No card is asked for to start.