Quick installation
Install Drizzle ORM and Drizzle Kit using your preferred package manager:drizzle-orm: The core ORM library for your applicationdrizzle-kit: CLI companion for migrations and database management (dev dependency)
Database drivers
Drizzle ORM requires a database driver to connect to your database. Install the driver that matches your database:PostgreSQL drivers
- node-postgres (pg)
- postgres.js
- Neon Serverless
- Vercel Postgres
The most popular PostgreSQL driver for Node.js.
MySQL drivers
- mysql2
- PlanetScale
Fast MySQL driver for Node.js with prepared statement support.
SQLite drivers
- better-sqlite3
- Bun SQLite
- Cloudflare D1
- Turso (libSQL)
Fast synchronous SQLite driver for Node.js.
Project setup
After installing Drizzle ORM and your database driver, set up your project structure:1
Create schema directory
Create a directory for your database schema files:
2
Configure Drizzle Kit
Create a
drizzle.config.ts file in your project root:3
Set up environment variables
Create a
.env file with your database connection string:.env
Verify installation
Create a simple test file to verify your installation:src/db/test.ts
Optional dependencies
TypeScript
Drizzle works best with TypeScript. If you haven’t installed it:Schema validation
Integrate with runtime validation libraries:- Zod
- Valibot
- TypeBox
- ArkType
Next steps
Quickstart
Build your first application with Drizzle ORM
Schema Declaration
Learn how to define your database schema
Database Connection
Configure database connections for different drivers
Migrations
Set up database migrations with Drizzle Kit
Having issues? Check our best practices guide or join our Discord community for help.