pg.
What you need
- A DBHost account and one active database
- A Next.js app
- Node.js 18 or later
- Prisma packages installed in the app
DBHost exposes PostgreSQL through PgBouncer on port
6432. Prisma works with
pooled PostgreSQL connections, and Prisma’s PgBouncer guide covers advanced
migration setups if you need them later.1. Create a database in DBHost
Create a database from the dashboard, then copy the connection string from the database detail page. If you are setting up a new project, the DBHost quickstart is still the fastest first step. It gives you the host, port, username, and password you need before you touch your app code.2. Install Prisma
From your Next.js project:3. Point Prisma at DBHost
Add the DBHost connection string to.env.local or the environment file your app already uses:
?pgbouncer=true flag keeps the pooled connection explicit for Prisma setups that need it.
4. Define a simple schema
Start with a minimal model:db push is enough for a quickstart. If your team already uses a different Prisma migration flow, keep that workflow and keep the pooled DBHost URL in place.
5. Create a reusable Prisma client
In a Next.js app router project, keep the client in one shared file:6. Query from a server component
When DBHost helps most
- You want PostgreSQL to work with Prisma without managing a VPS
- You want the pooled connection ready on day one
- You want backups and password resets from the dashboard later
- You expect to automate database creation or backup triggers through the published CLI or REST API
Next steps
Start for Free
Create a DBHost account and provision your first database.
Compare Next.js Paths
See when Prisma, Drizzle, or plain
pg is the better fit for your app.- See the DBHost quickstart for the shortest path to your first database.
- See the Next.js + PostgreSQL guide if you want to compare Prisma with Drizzle or plain
pg. - See the CLI if you want to script database actions from your terminal.
- See the API reference if your deployment pipeline already speaks HTTP.