backupdrill — free, open-source Supabase backup CLI
Open-source CLI to back up a Supabase project to your own S3/R2/B2 bucket — the Postgres database and, once you configure its S3 keys, your Storage files — with a checksummed manifest.json so you can prove what was captured.
Backup is half the job. backupdrill drill restores your latest snapshot into a throwaway Postgres and verifies it actually restores — because a backup you've never restored is a guess.
Backups stream through the CLI on your machine (or your CI) straight to your bucket. Your data never touches our servers, because there are none — this is just a CLI.
This is the exact engine the hosted service runs in production. Want it on a schedule, with drills that run themselves, alerts, and emailed reports? That's backupdrill.com. This CLI is the DIY layer; the cloud adds scheduling, alerting, and reports on top.
🎥 Prefer watching? Where do your backups actually go — explained in about a minute.
Why
- Supabase's own database restore only brings back
storage.objects metadata, not your actual Storage files.
- Pro-plan backups keep 7 days and — on the physical backup process current projects use — can't be downloaded; PITR is $100/month per project.
- A
pg_dump you've never restored is a guess.
This CLI gets your database into a bucket you control, with a manifest you can check.
Requirements
- Node.js ≥ 20
pg_dump whose major version ≥ your Supabase Postgres version (Supabase runs PG 15–17). On macOS: brew install libpq then add it to PATH, or point BACKUPDRILL_PG_DUMP at the binary. The CLI checks this and refuses to run a mismatched dump.
Install
npm install -g backupdrill
# or run without installing:
npx backupdrill backup
Use it from Claude Code or Cursor
The plugin/ folder is a plugin for Claude Code and Cursor. It teaches the agent to run estimate, backup, drill and restore for you. Its instructions keep your keys in a gitignored .env.backupdrill that the agent is told never to open, and have it do a dry run before every restore. In Claude Code:
/plugin marketplace add backupdrill/cli
/plugin install backupdrill@backupdrill
Details are in plugin/README.md.
Use it from Pi
This npm package is also a Pi package. Installing it gives Pi the same skill the Claude Code plugin uses:
pi install npm:backupdrill
Start a new Pi session and ask it to back up your Supabase project or run a restore drill. The skill runs the CLI through npx, so Node.js 20 or newer has to be on your PATH. Everything else it needs, and where your keys go, is in plugin/README.md.
Usage
Configure via env vars, a config file, or flags (precedence: flags > env > file).
Env vars
export BACKUPDRILL_DATABASE_URL="postgresql://postgres.<ref>:<pw>@<pooler-host>:5432/postgres"
export BACKUPDRILL_PROJECT_NAME="my-app"
export BACKUPDRILL_S3_ENDPOINT="https://<account>.r2.cloudflarestorage.com" # omit for AWS S3
export BACKUPDRILL_S3_REGION="auto"
export BACKUPDRILL_S3_BUCKET="my-backups"
export BACKUPDRILL_S3_ACCESS_KEY_ID="…"
export BACKUPDRILL_S3_SECRET_ACCESS_KEY="…"
backupdrill backup
All recognized variables: