PostgreSQL
Create a new Prisma Next project with PostgreSQL using create-prisma@next.
Create a Prisma Next app with PostgreSQL, seed it, and run your first query.
Prisma Next is the next major version of Prisma ORM, available now in Early Access. It’s the cutting-edge version of Prisma ORM and will become the future of Prisma, so we’d love for you to try it, explore what’s new, and share your feedback in Discord.
If you want to stay on the current generally available version of Prisma ORM, you can continue with Prisma 7.
Quick start
bunx create-prisma@next --provider postgresRun this from a Node.js 24 or newer environment. The command preselects PostgreSQL, so you can focus on the template and database URL prompts. Pick Prisma Postgres if you want setup to create the database for you, or paste your own DATABASE_URL.
Setup gives you the app template, a starter contract, prisma-next.md, project-level Prisma Next skills for your coding agent, and package scripts for the database steps below.
If you use your own database, keep the connection string ready before you start.
1. Check the database connection
Open .env and confirm that DATABASE_URL points to the PostgreSQL database you want Prisma Next to use.
DATABASE_URL="postgresql://username:password@host:5432/database?sslmode=require"If you chose Prisma Postgres during setup, this value is already written for you. If you pasted your own connection string, keep it in .env and do not hardcode it in application code.
2. Initialize the database
From the generated project directory, run db:init to apply the starter schema to PostgreSQL and sign the database.
bun run db:init3. Seed data
db:seed inserts sample users so the first query has data to show.
bun run db:seed4. Run the app
Start the app and confirm the sample query runs successfully.
bun run devUse the URL or terminal output shown by your template. You should see the seeded users returned from PostgreSQL.
Next steps
- Open
src/prisma/contract.prismaorsrc/prisma/contract.tsand change the starter model. - Use the PostgreSQL existing-project guide if you already have an app and database.
- Read the Prisma Next overview when you want the concepts behind contracts, query APIs, and migrations.