Skip to content

jakeat11labs/supabase-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

supabase-local

One command to stand up a local Supabase stack on macOS. It installs the prerequisites (Colima, Docker CLI, Supabase CLI), runs supabase init, disables the one container Colima can't run, and drops in a make up/make down kit plus snapshot/restore and schema-promotion scripts.

cd ~/projects/my-new-sandbox
curl -fsSL https://raw.githubusercontent.com/jakeat11labs/supabase-local/main/setup.sh | bash
make up

Prefer to read it before running (recommended)?

curl -fsSL https://raw.githubusercontent.com/jakeat11labs/supabase-local/main/setup.sh -o setup.sh
bash setup.sh

What it does

  1. Checks macOS + Homebrew. (Colima provides the Docker daemon; brew installs it.)
  2. Installs any missing prerequisites via Homebrew — colima, docker, and supabase — after asking. (--no-install to only check; --yes to skip prompts.)
  3. Runs supabase init in the current directory (skipped if supabase/config.toml already exists).
  4. Disables analytics in config.toml — that container and its vector sidecar need the Docker socket handed in, which Colima's virtiofs can't do.
  5. Writes the kit into the current directory:
    • up.sh / down.sh / Makefilemake up boots Colima then supabase start; make down stops both.
    • snapshot.sh / restore.sh — checkpoint & roll back the local public schema (auth/logins are never touched).
    • promote-schema.sh — ship a schema migration up to a remote/cloud Supabase (schema only, never data; backs prod up first, applies in one transaction).
    • README.md (or SUPABASE-LOCAL.md if one exists) and a merged .gitignore.

Re-running is safe: it skips supabase init if the project already exists, leaves config.toml alone if analytics is already off, and won't duplicate .gitignore lines.

Options

Flag / env Effect
-y, --yes (or SUPABASE_LOCAL_YES=1) Don't prompt; accept prerequisite installs and file writes.
--no-install Check prerequisites only; never run brew (fails if any are missing).
-h, --help Show help.

Requirements

  • macOS (uses Colima). On Linux, install Docker Engine natively and run supabase start directly.
  • Homebrew — not auto-installed (its installer is interactive); the script prints the install command if it's missing.

Safety notes

  • Single self-contained script — no dependencies, nothing fetched at runtime, no install hooks. Work happens only when you run it.
  • Prompts read from /dev/tty, so it stays interactive even under curl | bash (where stdin is the script itself).
  • It never bundles real credentials. promote-schema.sh reads the cloud connection from $PROD_DATABASE_URL or a gitignored env file you provide.
  • curl | bash runs remote code directly — if that makes you uneasy, use the download-then-run form above and read setup.sh first.

License

MIT

About

One command to stand up a local Supabase + Colima sandbox on macOS (make up/down, snapshot/restore, schema promotion).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages