BetterStarter logo
BetterStarter
Docs
GuidesDatabase

Local PostgreSQL

Run a PostgreSQL database on your machine for development.

Docs are in beta — content is improving rapidly. Found something missing? Open an issue on GitHub or reach out on Twitter (X).
  1. Download and install Postgres.app
  2. Open it and start the server
  3. Open a terminal and create a database:

Configure your $PATH to use the included command line tools. Add this to ~/.zshrc file":

# Postgres.app
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
createdb app-db-name
  1. Your connection string to be updated in .env.local:
DATABASE_URL=postgres://username:password@localhost:5432/app-db-name

Option B — Docker

docker run --name betterstarter-db \
  -e POSTGRES_DB=betterstarter \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -p 5432:5432 \
  -d postgres:16

Connection string:

DATABASE_URL=postgres://postgres:postgres@localhost:5432/betterstarter

Run Migrations

Once DATABASE_URL is set in .env.local:

pnpm db:generate
pnpm db:migrate

GUI Tools

On this page