Build and deploy the full Prisma stack
A single tutorial from empty directory to live URL, with Prisma Next, Prisma Postgres, and Prisma Compute.
This tutorial takes you through the whole recommended stack in one sitting: scaffold an app with Prisma Next, store data in Prisma Postgres, query it over HTTP, and deploy to Prisma Compute for a live URL. About 15 minutes.
It uses the hono template so you get a small API you can verify with curl at every step. The same journey works for the other templates; the framework guides cover each one.
Prerequisites
- Node.js 24 or later (or Bun)
- A Prisma Data Platform account for the deploy step, free to create
- No database needed: setup provisions Prisma Postgres for you
Use with your agent
Prefer to delegate? This is the same journey as the prompt on the getting started page, with the hono template chosen for you:
1. Scaffold the app
One command creates the app, wires up Prisma Next, and can provision the database:
bunx create-prisma@next create my-app --template hono --provider postgresPick Prisma Postgres at the database prompt to have a database created for you, or paste your own connection string. Then enter the project:
cd my-appThe scaffold writes DATABASE_URL to .env, generates a Hono server in src/index.ts with GET / and GET /users routes, puts the Prisma Next setup under src/prisma/, and installs Prisma Next skills for your coding agent. If the database was provisioned without a signed-in CLI, .env also contains a CLAIM_URL; open it within 24 hours to claim the database into your account and keep it.
2. Initialize and seed the database
db:init applies the starter contract to Prisma Postgres and signs the database; db:seed inserts sample users:
bun run db:init
bun run db:seed"summary": "Applied 5 operation(s) across 1 space(s), database signed"
Seeded 3 users.Seeing Cannot read properties of undefined (reading 'where')? The current template still generates the older unqualified query form. Update db.orm.User to db.orm.public.User in src/prisma/seed.ts and src/prisma/users.ts, then rerun db:seed.
3. Run it and query your data
bun run devThe server starts on port 3000 (set PORT if something else is already using it). Confirm the API serves the seeded rows from Prisma Postgres:
curl http://localhost:3000/users[
{ "id": "1", "email": "alice@prisma.io", "username": "alice", "name": "Alice", "createdAt": "2026-07-27T13:31:56.993Z" },
{ "id": "2", "email": "bob@prisma.io", "username": "bob", "name": "Bob", "createdAt": "2026-07-27T13:31:57.021Z" },
{ "id": "3", "email": "carol@prisma.io", "username": "carol", "name": "Carol", "createdAt": "2026-07-27T13:31:57.049Z" }
]The route handler in src/index.ts is ordinary Hono code calling an ordinary Prisma Next query. Change the starter contract in src/prisma/ when you are ready to model your own data; the fundamentals cover the query patterns.
4. Deploy to Prisma Compute
Sign in once (it opens your browser):
bunx @prisma/cli@latest auth loginDeploy from the project directory. The first deploy asks you to pick or create a project; pass --create-project my-app to skip the prompt (agents and CI need it, since there is no interactive picker). The --env .env flag passes your DATABASE_URL to the deployment, so the live API talks to the same database:
bunx @prisma/cli@latest app deploy --env .envFirst deploy of "my-app" -- promoting to production.
Building locally...
Built 0.9 MB
Uploading...
Deploying...
Live in 7.5s
https://<your-app>.ewr.prisma.build5. Verify the live URL
curl https://<your-app>.ewr.prisma.build/usersThe same three users come back, now served from production next to your database. The first deploy pins the directory to your project in a gitignored .prisma/local.json and promotes to production automatically.
Next steps
- Pick your framework: the same journey for Next.js, Nuxt, Astro, NestJS, TanStack Start, and more.
- Branching and previews: every Git branch gets an isolated deployment.
- Learn the fundamentals: reading, writing, relations, and transactions.
- Deploy on push: connect GitHub so every commit deploys itself.