BetterStarter logoBetterStarter
GuidesDatabase

Supabase

Use Supabase as your PostgreSQL database.

Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter.

Supabase is an open-source Firebase alternative with a hosted PostgreSQL database and a generous free tier.

Setup

  1. Create a free account at supabase.com
  2. Create a new project
  3. Click Connect in the top header
  4. Go to ORMs → Drizzle
  5. Copy the Connection string (URI format)

Configure

Add to .env.local:

DATABASE_URL="postgresql://postgres.[PROJECT-ID]:[PASSWORD]@aws-1-us-east-1.pooler.supabase.com:6543/postgres"

Run Migrations

pnpm db:generate
pnpm db:migrate

Notes

  • Use the pooled connection string (port 6543) for production deployments to handle connection limits
  • Use the direct connection string (port 5432) for running migrations
  • The free tier supports 2 projects with 500 MB storage each

On this page