Prisma
databasesprismaGuideBeginner
Installing Prisma
How to install the Prisma CLI, install @prisma/client, initialize database configuration, and verify installation.
Verified: 2026-10-01
Tested on:prisma 6.x
Platforms:
node
#prisma#installation#setup#npm#pnpm
Installing Prisma
Setting up Prisma requires installing the Prisma CLI as a development dependency and the Prisma Client as a production runtime dependency.
1. Installation
<PackageManagerTabs package="@prisma/client" />
And install the CLI tool as a development dependency:
<PackageManagerTabs package="prisma" dev />```bash
# For PostgreSQL (Default)
npx prisma init --datasource-provider postgresql
```
This command automatically creates:
- `prisma/schema.prisma` (The main schema file)
- `.env` (Environment variable configuration with `DATABASE_URL`)```ini
# .env
DATABASE_URL="postgresql://postgres:mysecretpassword@localhost:5432/myapp_dev?schema=public"
```2. Verifying the Setup
Check that the Prisma CLI is installed and communicating with your environment:
npx prisma --versionOutput:
prisma : 6.x.x
@prisma/client : 6.x.x
Computed binaryTargets : darwin-arm64Related Guides
Prisma ORM Overview
Introduction to Prisma — the next-generation TypeScript ORM featuring declarative data modeling, automatic type-safety, and seamless migrations.
Prisma Project Setup & TypeScript Configuration
Recommended project structure, TypeScript compiler settings, tsx script runner, and package.json scripts for Prisma.