Skip to main content
Prisma Documentation Docs

Search documentation

Type to search this documentation.

On this pageOverview

From the CLI

Use the CLI when you want Prisma ORM and Prisma Postgres set up without leaving the terminal.

bun create prisma@latest
Bash
pnpm create prisma@latest
Bash
yarn create prisma@latest
Bash
npm create prisma@latest

Choose PostgreSQL when prompted, and answer No to Deploy to Prisma now?. Setup adds prisma-8.md, installs project-level Prisma ORM skills for your coding agent, and writes the generated scripts used below.

Choose PostgreSQL when prompted, and answer No to Deploy to Prisma now?. Setup adds prisma-8.md, installs project-level Prisma ORM skills for your coding agent, and writes the generated scripts used below.

Create a Prisma Postgres database from the terminal and export its connection string. The generated scripts read the environment variable, not .env:

bunx create-db@latest
Bash
pnpm dlx create-db@latest
Bash
yarn dlx create-db@latest
Bash
npx create-db@latest
Bash
export DATABASE_URL="<the connection string create-db printed>"

The command also prints a claim URL; open it within 24 hours to keep the database in your account.

export DATABASE_URL="<the connection string create-db printed>"

The command also prints a claim URL; open it within 24 hours to keep the database in your account.

From the generated project directory, run:

title="bun"
bun run db:init
pnpm
pnpm run db:init
yarn
yarn db:init
npm
npm run db:init

Sample users are seeded automatically on the app's first query.

title="bun"
bun run dev
pnpm
pnpm run dev
yarn
yarn dev
npm
npm run dev

If the app already exists, run Prisma ORM from the project root:

bunx prisma@latest orm init
Bash
pnpm dlx prisma@latest orm init
Bash
yarn dlx prisma@latest orm init
Bash
npx prisma@latest orm init

Choose PostgreSQL and set DATABASE_URL to your Prisma Postgres connection string. Init adds prisma-8.md, package scripts, and the Prisma ORM skills for your coding agent. Then follow the PostgreSQL existing-project guide.

Choose PostgreSQL and set DATABASE_URL to your Prisma Postgres connection string. Init adds prisma-8.md, package scripts, and the Prisma ORM skills for your coding agent. Then follow the PostgreSQL existing-project guide.

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu