Back up Supabase to Backblaze B2
Backblaze B2 has the cheapest storage of the destinations in these guides, and its egress allowance is large enough that restores and restore drills are effectively free at backup scale. The setup has two B2-specific quirks: the master key does not work with the S3 API, and the credential names differ from what S3 tools expect. This guide covers both, plus the bucket and key click-paths, a working CLI config, a weekly GitHub Actions schedule, and lifecycle rules for old snapshots.
Why B2, and what it costs
Three numbers, checked against Backblaze’s pricing page (July 2026):
- Storage at $6.95/TB-month (about $0.007/GB-month), less than half of R2 Standard’s $0.015 and less than a third of S3 Standard’s $0.023. A 10 GB project keeping ten snapshots (100 GB) costs about $0.70/month. The first 10 GB is always free, so several retained snapshots of a free-tier Supabase database (capped at 500 MB) cost nothing.
- Egress free up to 3x your average monthly storage, then $0.01/GB, a ninth of S3’s $0.09/GB rate. For backups this works in your favor: the bucket stores your whole snapshot history, while a restore drill reads back only the latest snapshot. If you keep ten snapshots and drill weekly, you use well under half of the free allowance.
- No request fees or minimum storage duration. Class A, B, and C API calls (uploads, downloads, listing) are free, and there are no minimum storage duration fees, so deleting a week-old snapshot costs nothing extra. (Compare S3’s 30-day minimum on Standard-IA or R2 Infrequent Access’s 30-day minimum plus retrieval fee.)
Two caveats. Backblaze raised this price on May 1, 2026, from $6 to $6.95/TB-month, so check the current price before you rely on “cheapest”. And R2’s egress is free with no conditions, while B2’s is an allowance (a generous one for backups, but still an allowance). The R2 version of this guide covers that setup, and the S3 version covers the case where everything already runs on AWS. Whichever you pick, the backup also pulls data out of Supabase, which counts against your Supabase plan’s egress allowance; the GitHub Actions guide walks through that math.
Step 1: Create the bucket
B2 console → Buckets → Create a Bucket, with files set to private. A backup bucket should never be public. Bucket names are globally unique across B2, so my-backups will likely need a suffix of your own. After creation, the bucket’s detail page shows an Endpoint value of the form s3.<region>.backblazeb2.com. Note it down: both the CLI endpoint and the region come from it.
Step 2: Create an application key (not the master key)
Application Keys → Add a New Application Key, with Read and Write access, scoped to your bucket, not all buckets. With a scoped key, a leak exposes one backup bucket instead of everything on the account.
The B2-specific catch: the master application key does not work with the S3-compatible API. If you point an S3 tool at B2 with the master key and get authentication errors, this is why. Create a standalone application key and use that instead.
Step 3: Map keyID and applicationKey to S3 credentials
B2 keeps its own credential names in the console; every S3-compatible tool asks for the same two values under different labels. The mapping:
keyID → Access Key ID
applicationKey → Secret Access Key (shown only once, at creation)
Endpoint: https://s3.<region>.backblazeb2.com (from the bucket page)
Region: the <region> part, e.g. us-west-004The region is not chosen separately; it is part of the endpoint hostname. If your bucket page says s3.us-west-004.backblazeb2.com, the region is us-west-004. The backupdrill CLI defaults to path-style addressing whenever an endpoint is set, which B2 accepts, so there is nothing extra to set.
Step 4: Point the CLI at B2 and run the first backup
The open-source backupdrill CLI (MIT, github.com/backupdrill/cli) dumps the database with pg_dump, optionally copies your Storage files, and writes a checksummed manifest.json next to the dump. Configure it with env vars:
export BACKUPDRILL_DATABASE_URL="postgresql://postgres.<ref>:<pw>@aws-0-<region>.pooler.supabase.com:5432/postgres"
export BACKUPDRILL_PROJECT_NAME="my-app"
export BACKUPDRILL_S3_ENDPOINT="https://s3.<region>.backblazeb2.com"
export BACKUPDRILL_S3_REGION="us-west-004" # the <region> part of your endpoint
export BACKUPDRILL_S3_BUCKET="my-backups"
export BACKUPDRILL_S3_ACCESS_KEY_ID="…" # B2 keyID
export BACKUPDRILL_S3_SECRET_ACCESS_KEY="…" # B2 applicationKey
npx backupdrill backupThe connection string is the Session Pooler URI from the Connect button at the top of the Supabase dashboard. The default postgres user in it works as-is. Or keep the non-secret parts in a config file (backupdrill.config.json, gitignored in the CLI repo’s template) and the secrets in env vars:
{
"databaseUrl": "postgresql://postgres.<ref>:<password>@aws-0-<region>.pooler.supabase.com:5432/postgres",
"projectName": "my-app",
"schemas": ["public"],
"storage": {
"endpoint": "https://s3.<region>.backblazeb2.com",
"region": "us-west-004",
"bucket": "my-backups",
"accessKeyId": "PUT-IN-ENV-OR-HERE",
"secretAccessKey": "PUT-IN-ENV-OR-HERE",
"prefix": "backupdrill",
"forcePathStyle": true
}
}npx backupdrill backup --config backupdrill.config.jsonTo capture Supabase Storage files in the same snapshot, also set the four BACKUPDRILL_SUPABASE_STORAGE_* variables with keys from Dashboard → Storage → Settings → S3 Access Keys. You want this, because a database restore alone does not bring files back. When the run finishes, the bucket holds a timestamped snapshot: dump.pgcustom, RECOVERY.md, manifest.json, auth.dump with your Auth users when the database role can read them, and a storage/ tree if Storage is configured.
Step 5: Schedule it with GitHub Actions
Run it weekly from GitHub Actions. The GitHub Actions guide has the complete workflow file and the Supabase egress arithmetic; the B2 specifics are just the repository secrets. Required: BACKUPDRILL_DATABASE_URL, BACKUPDRILL_S3_BUCKET, BACKUPDRILL_S3_ACCESS_KEY_ID (the keyID), BACKUPDRILL_S3_SECRET_ACCESS_KEY (the applicationKey). For B2, also set BACKUPDRILL_S3_ENDPOINT to your https://s3.<region>.backblazeb2.com endpoint and BACKUPDRILL_S3_REGION to the <region> part.
Housekeeping: prune old snapshots with a lifecycle rule
B2 buckets keep every file version by default, so old snapshots accumulate until something deletes them. B2’s lifecycle rules are prefix-scoped and work in two steps: hide, then delete. A rule on the backupdrill/ prefix (the CLI’s default key prefix) with daysFromUploadingToHiding set to your retention window and daysFromHidingToDeleting set to 1 hides each snapshot when it ages out and deletes it a day later. Because B2 has no minimum storage duration fees, pruning early costs nothing extra. Backblaze’s own docs also warn that a rule with an empty prefix matches the whole bucket, so scope it.
Prove it restores
Run backupdrill drill to pull the latest snapshot into a throwaway Docker Postgres and verify it against the manifest, or walk through the full restore-testing guide. On B2, a drill reads back one snapshot against an allowance of 3x everything you store, so drilling weekly costs nothing in egress.
FAQ
How much does Backblaze B2 cost for Supabase backups?
Storage is $6.95/TB-month pay-as-you-go (about $0.007/GB-month), the cheapest of the destinations in these guides. The first 10 GB is always free, which covers several snapshots of a free-tier Supabase database. Egress is free up to 3x your average monthly storage, then $0.01/GB. Class A, B, and C API calls (uploads, downloads, listing) are free, and there are no minimum storage duration fees. A 10 GB project keeping ten snapshots (100 GB) costs about $0.70/month.
What are B2's keyID and applicationKey in S3 terms?
keyID is your Access Key ID and applicationKey is your Secret Access Key. B2 uses its own names in the console, but S3-compatible tools take them in those two fields. Two catches: the applicationKey is shown only once, at creation, and the master application key does not work with the S3-compatible API at all. Create a standalone application key instead, scoped to your backup bucket with Read and Write. The endpoint is https://s3.<region>.backblazeb2.com, shown on the bucket page, and the region is the <region> part of that hostname, e.g. us-west-004.
Is Backblaze B2 cheaper than Cloudflare R2 for Supabase backups?
On storage, yes: $6.95/TB-month (about $0.007/GB-month) is less than half of R2 Standard's $0.015/GB-month, even after Backblaze's May 1, 2026 price increase from $6/TB-month. Egress works differently: R2's egress is always free, while B2's is free up to 3x your average monthly storage and $0.01/GB after that. For backups the difference rarely matters. A weekly restore drill reads back one snapshot, a small fraction of everything the bucket stores, so backups alone are unlikely to use up B2's 3x allowance. Either way the backup files are the same: same CLI, same dump.pgcustom, same manifest.
Sources
- Backblaze — B2 Cloud Storage Pricing
- Backblaze Blog — Pricing and Product Updates (May 1, 2026 change)
- Backblaze API Docs — Introduction to the S3-Compatible API
- Backblaze Docs — How to Use B2 S3-Compatible App Keys
- Backblaze Docs — Lifecycle Rules
- Supabase docs — Connecting to your database
- Cloudflare R2 docs — Pricing
- AWS — Amazon S3 pricing
Facts and prices last verified July 11, 2026 against the sources above. Written by the team behind BackupDrill.
Prefer the schedule, the restore drills, and the reports without owning the workflow? BackupDrill runs this same engine against your B2 bucket on a schedule. Start free (the Free plan covers weekly backups for one project), see the bucket setup docs for the shorter click-path version, or keep it DIY with the open-source CLI.