Guide

Supabase Storage backup: copy every bucket with S3 tools

Your database backup knows which files exist, not what is in them. Copy every Supabase Storage bucket with the S3 protocol, and restore it when you need to.

By Sascha Heyer · Last updated December 4, 2026

Supabase Storage keeps each uploaded file in object storage and one row per file in the storage.objects table. Every database backup, whether Supabase’s daily backup, PITR or your own pg_dump, contains that row. None of them contain the file. Supabase’s backups documentation says it plainly: database backups do not include objects stored via the Storage API. If users upload avatars, invoices or documents, those need their own backup.

Step 1: create S3 access keys

Supabase Storage speaks the S3 protocol, so any S3 client can read it. In the dashboard open Project Settings › Storage (the S3 configuration page), note the endpoint and region, and create an access key pair. The endpoint looks like this:

https://<project-ref>.storage.supabase.co/storage/v1/s3

Supabase recommends this storage subdomain rather than <project-ref>.supabase.co. The keys have full access to every bucket and bypass row level security, so treat them like the service role key: on a server or in CI secrets only, never in a browser or app.

Step 2: copy every bucket with the AWS CLI

aws configure --profile supabase      # paste the access key, secret and the project region
export AWS_PROFILE=supabase
export ENDPOINT=https://<project-ref>.storage.supabase.co/storage/v1/s3

aws s3 ls --endpoint-url "$ENDPOINT"                       # list buckets
for b in $(aws s3 ls --endpoint-url "$ENDPOINT" | awk '{print $3}'); do
  aws s3 sync "s3://$b" "./storage-backup/$b" --endpoint-url "$ENDPOINT"
done

aws s3 sync only downloads files that are new or changed, so the second run is fast. Keep the local folder, or better, sync it on to a bucket of your own with a different provider. Supabase Storage has no object versioning, so a file a user deletes or overwrites is gone from Supabase; only your copy still has it, and only if your sync does not mirror deletions (aws s3 sync without --delete keeps them).

Or with rclone

rclone copies bucket to bucket without a local disk in between, which suits large buckets. Add a remote:

# ~/.config/rclone/rclone.conf
[supabase]
type = s3
provider = Other
access_key_id = <access key>
secret_access_key = <secret>
endpoint = https://<project-ref>.storage.supabase.co/storage/v1/s3
region = <project-region>
rclone lsd supabase:                          # buckets
rclone copy supabase: ./storage-backup --progress   # every bucket, new and changed files
rclone copy supabase:avatars r2:my-backups/avatars  # straight to another remote

Use rclone copy, not rclone sync, for a backup: sync deletes files at the destination that no longer exist at the source.

Step 3: restore files into a project

Create the buckets in the target project with the same names and the same public or private setting (bucket settings live in storage.buckets, which your database dump holds). Then upload with the target project’s endpoint and keys:

export ENDPOINT=https://<new-project-ref>.storage.supabase.co/storage/v1/s3
aws s3 sync ./storage-backup/avatars s3://avatars --endpoint-url "$ENDPOINT"

Keep the same paths. Your tables store paths like avatars/42.png, and as long as the file lands at the same bucket and path, those references work again. Check one public URL and one signed URL from the app before you call it done.

Make it run every night

A sync you run by hand covers the files that existed that day. Put the loop above into the same scheduled job as your database dump (the GitHub Actions guide has a workflow), and alert on failure. Two things to watch: the egress the sync causes counts toward your Supabase plan’s egress, and the first full copy of a large bucket can take hours, so give the job time.

Let Liferaft copy the files

On Solo and Agency, Liferaft copies new and changed files from every bucket on each backup run, next to the database copy, and lists what it copied in the access log. Connect with Supabase and it does not even need you to paste a key. Files are included up to 25 GB on Solo ($9 a month) and 100 GB on Agency.

Rather not run this yourself? Liferaft runs the dump every night through a read-only role, stores the copy outside Supabase, and restores it every week to count every row. Free for one Supabase project; Solo is $9 a month for five. Back up my Supabase project free

Frequently asked questions

Are Supabase Storage files included in database backups?

No. Supabase’s backups documentation says database backups do not include objects stored through the Storage API. The backup contains the storage.objects rows (the file list), not the files themselves.

What endpoint do I use for the Supabase S3 protocol?

https://<project-ref>.storage.supabase.co/storage/v1/s3, with the region shown on the S3 configuration page of your project’s Storage settings, and an access key pair created on the same page. Supabase recommends the storage subdomain over <project-ref>.supabase.co.

Do the S3 access keys bypass row level security?

Yes. Supabase’s docs say S3 access keys have full access to all buckets and bypass RLS, so keep them on a server or in CI secrets, never in a browser or mobile app.

Does Liferaft back up Storage files?

On Solo and Agency, yes: Liferaft copies new and changed files from every bucket on each run, up to 25 GB on Solo and 100 GB on Agency, next to the database copy. The free plan backs up the database only.

More guides

Compare Supabase backup tools