Self-hosted Supabase

@codify/supabase-self-hosted·Codify official·v1.0.0·Updated 5 h ago

Run your own Supabase on Docker in one step, with fresh secrets and API keys generated for you. Works on macOS and Linux.

0 appliesmacOS · Linux
Apply with CodifyCustomize a copy

Opens the template in the Codify dashboard. Applying doesn't create a setup; customizing makes a private copy you can edit.

Or from your terminal
curl -fsSL https://releases.codifycli.com/ensure.sh | bash && codify apply @codify/supabase-self-hosted
Installs Codify first if you don’t have it.
This template runs 8 scripts on your machine. The Codify CLI shows you the exact command and asks before anything runs. Read the scripts

Sets up self-hosted Supabase the way the official guide does, without the copy-pasting.

What it does

  • Installs Git, OpenSSL, jq and Docker (Docker Desktop on macOS, Docker Engine + Compose on Linux)
  • Downloads the docker/ folder of a pinned Supabase self-hosted release (self-hosted/v0.8.5 by default)
  • Generates every secret with Supabase's own scripts: Postgres password, JWT secret, Studio password, Vault, Realtime, Logflare and S3 keys, plus the new publishable/secret API keys
  • Sets your public URL and app URL, then starts the stack

You'll be asked for

  • Install folder (default ~/supabase-project)
  • Release tag
  • Public URL of the API and Studio (default http://localhost:8000)
  • Your app's URL for auth redirects (default http://localhost:3000)

After it finishes

  • Studio: http://localhost:8000 (dashboard login is in .env)
  • Print your keys and passwords: cd ~/supabase-project && sh run.sh secrets
  • Check health: docker compose ps

Good to know

  • Needs 4 GB RAM and 40 GB of disk at minimum (8 GB and 80 GB recommended).
  • Re-applying is safe: existing secrets are never regenerated.
  • Sign-up emails need SMTP settings in .env.
  • On a public server, put Caddy or Nginx with TLS in front of port 8000.
  • To remove everything, including data: cd ~/supabase-project && sh reset.sh

What gets installed

variabletext · Where should the Supabase project live? · ~/supabase-project
variabletext · Self-hosted release tag · A self-hosted/v* tag from github.com/supabase/supabase/tags. · self-hosted/v0.8.5
variabletext · Public URL of the API gateway and Studio · Keep http://localhost:8000 for a local install. On a server use your domain, ex: https:…
variabletext · URL of your app (auth redirects go here) · http://localhost:3000
homebrewgit, openssl, jq
aptgit, openssl, jq, curl, ca-certificates · debian-based
docker
noticesuccess · Supabase is up and running · Your own Supabase lives in `${{ installDir }}`. No credit card required. Studio: ${{ publicUrl }}…

Scripts

Asks before running
action · docker-running-macosContacts: github.com
Condition (runs during plan)
docker info >/dev/null 2>&1
Action (runs during apply)
open -a Docker && until docker info >/dev/null 2>&1; do sleep 3; done
action · supabase-filesContacts: github.com
Condition (runs during plan)
[ -f ${{ installDir }}/docker-compose.yml ]
Action (runs during apply)
tmp=$(mktemp -d) && git clone --filter=blob:none --no-checkout --depth=1 --quiet --branch ${{ supabaseVersion }} https://github.com/supabase/supabase "$tmp/supabase" && git -C "$tmp/supabase" sparse-checkout set --cone docker && git -C "$tmp/supabase" checkout --quiet && mkdir -p ${{ installDir }} && cp -rf "$tmp/supabase/docker/." ${{ installDir }} && cp ${{ installDir }}/.env.example ${{ installDir }}/.env && printf 'ref=${{ supabaseVersion }}\n' > ${{ installDir }}/.supabase-version && rm -rf "$tmp"
action · supabase-secrets · in ${{ installDir }}Contacts: github.com
Condition (runs during plan)
[ -f .env ] && ! grep -q '^JWT_SECRET=your-super-secret' .env
Action (runs during apply)
sh utils/generate-keys.sh --update-env && sed -i.old -e 's|^SUPABASE_PUBLIC_URL=.*$|SUPABASE_PUBLIC_URL=${{ publicUrl }}|' -e 's|^API_EXTERNAL_URL=.*$|API_EXTERNAL_URL=${{ publicUrl }}/auth/v1|' -e 's|^SITE_URL=.*$|SITE_URL=${{ siteUrl }}|' .env && rm -f .env.old && chmod 600 .env
action · docker-group-linux · in ${{ installDir }}Contacts: github.com
Condition (runs during plan)
[ "$(id -u)" = 0 ] || id -nG "$(id -un)" | grep -qw docker
Action (runs during apply)
usermod -aG docker "$(stat -c %U .)"
action · supabase-api-keys-macos · in ${{ installDir }}Contacts: github.com
Condition (runs during plan)
grep -q '^SUPABASE_SECRET_KEY=.' .env
Action (runs during apply)
sh utils/add-new-auth-keys.sh --update-env && rm -f .env.old docker-compose.yml.old
action · supabase-api-keys-linux · in ${{ installDir }}Contacts: github.com
Condition (runs during plan)
grep -q '^SUPABASE_SECRET_KEY=.' .env
Action (runs during apply)
sg docker -c 'sh utils/add-new-auth-keys.sh --update-env' && rm -f .env.old docker-compose.yml.old
action · supabase-start-macos · in ${{ installDir }}Contacts: github.com
Condition (runs during plan)
[ -n "$(docker compose ps --status running -q studio 2>/dev/null)" ]
Action (runs during apply)
sh run.sh start
action · supabase-start-linux · in ${{ installDir }}Contacts: github.com
Condition (runs during plan)
[ -n "$(sg docker -c 'docker compose ps --status running -q studio' 2>/dev/null)" ]
Action (runs during apply)
sg docker -c 'sh run.sh start'

No reviews yet. Reviews come from people who applied this template.