Launch AI Works
InsightsNov 17, 20264 min read

Free Weekly Supabase Backups to Cloudflare R2 Using GitHub Actions

The open‑source script runs pg_dump on a schedule and stores the dump in a private R2 bucket, filling the backup gap left by Supabase’s free tier.

LBy Launch AI Works
Free Weekly Supabase Backups to Cloudflare R2 Using GitHub Actions
The short version

A 30‑line GitHub Actions workflow can back up a Supabase free‑tier Postgres database to Cloudflare R2 each week at no charge. It covers the full database but not storage files, and it lacks encryption or restore testing unless you upgrade to the paid kit.

Why the free tier needs a backup

Supabase’s free plan does not include automated backups, leaving any data loss to manual exports that many small teams forget to run. The repository on GitHub describes a 30‑line workflow that closes this gap by running pg_dump on a weekly schedule and pushing the resulting file to a Cloudflare R2 bucket. Because the workflow runs inside GitHub Actions, there is no separate server to maintain and the only recurring cost is the tiny amount of egress traffic from Supabase to the runner.

The author notes that the free tier caps outbound traffic at 5 GB per month. A 500 MB database dumped once a week consumes roughly 2 GB of that allowance, which stays comfortably under the limit, while a daily dump would push the usage to about 15 GB and exceed the cap. This makes the weekly cadence a practical default for most small‑business workloads.

How the workflow works

Setup requires a private GitHub repository (public repos lose scheduled runs after 60 days of inactivity), a Cloudflare R2 bucket with an API token that has object read/write permission, and the Supabase session pooler connection string — specifically the host ending in pooler.supabase.com on port 5432. The workflow expects five repository secrets: the database URL, the R2 account ID, access key ID, secret access key, and bucket name. Once the files are copied to the repo root, the action can be triggered manually or left to run on its weekly cron.

When the run finishes, the bucket contains a timestamped folder named supabase-backups/YYYY‑MM‑DD/ with a file called supabase‑YYYY‑MM‑DD.dump. The dump includes the entire Postgres cluster, so auth.users and all custom tables are captured. Storage objects kept in Supabase’s S3‑compatible layer are not part of the dump, because they live outside the database.

Limits and costs to watch

The workflow uploads the raw dump without encryption. R2 buckets are private by default, but anyone who obtains the R2 credentials could download the backup. For businesses that handle sensitive customer data, this may be a compliance concern. Additionally, the script does not verify that the dump can be restored; there is no automated restore drill, no checksum validation, and no alerting if the job fails.

Egress from Supabase is the only recurring expense. The free tier’s 5 GB monthly ceiling means you must size your database and backup frequency accordingly. The author’s example shows a 500 MB database staying well within the limit on a weekly schedule, but larger datasets or more frequent runs would require either a paid Supabase plan or a different backup destination.

What the paid kit adds

The same author sells a Supabase Backup Kit that builds on the free workflow. It adds GPG AES‑256 encryption before upload, a pre‑flight validator that rejects an incorrect pooler string, SHA‑256 checksums plus pg_restore –list validation, and a full restore drill into a throwaway Postgres instance with a step‑by‑step runbook. Failure alerts, a cron‑watchdog that notifies you if the scheduled run stops, and an egress calculator are also included.

Pricing is a one‑time fee: $29 for the first 50 buyers (launch price) and $39 thereafter, with a 14‑day money‑back guarantee. For a small business that needs audit‑ready backups and confidence that a restore will work, the kit removes the manual verification steps that the free version leaves to the operator.

Takeaways

  • A free GitHub Actions workflow can give a Supabase free‑tier project weekly off‑site backups to Cloudflare R2 at no extra cost.
  • The backup covers the full Postgres database but not Supabase storage objects, and it ships unencrypted dumps unless you upgrade.
  • Stay within Supabase’s 5 GB monthly egress limit by keeping the dump frequency weekly for typical database sizes.
L

Launch AI Works builds practical AI and automation inside small businesses. Notes in Insights are written from sources we cite and checked before publishing.

Your turn

Where would this work in your business?

Take the two-minute AI Opportunity Snapshot and we will point to where automation is most likely to pay off for you.

2mFree AI Opportunity Snapshot →

Get the Launch AI Works weekly

One email each week: practical AI for small business, plus what we’re building — the tools and workflows we’re testing in the real world.

By subscribing, you’ll receive one weekly email from Launch AI Works with practical AI ideas for small business and updates on what we’re building. We never sell or share your information. Unsubscribe anytime with one click in any email. See our privacy policy.