Skip to content

How do I connect a PostgreSQL database?

Updated 20 August 2026·1 views

Connecting PostgreSQL

Requires PostgreSQL 14 or higher.

Create a database and user

\\\sql CREATE DATABASE underpeaks; CREATE USER underpeaks WITH PASSWORD 'your-password'; GRANT ALL PRIVILEGES ON DATABASE underpeaks TO underpeaks; \\\

Environment variables

\\\env NEXT_PUBLIC_DB_TYPE=postgres NEXT_DB_POSTGRES_HOST=localhost NEXT_DB_POSTGRES_PORT=5432 NEXT_DB_POSTGRES_USER=underpeaks NEXT_DB_POSTGRES_PASSWORD=your-password NEXT_DB_POSTGRES_DATABASE=underpeaks \\\ Underpeaks uses a connection pool internally — don''t use a single Client instance. The installer sets timezone=UTC on all sessions. If using a managed provider (Neon, Railway, Supabase Postgres direct), use the connection pooler host/port where available.

Was this article helpful?