---
title: "Installation and Setup"
description: "Drizzle ORM is a lightweight and flexible tool designed to help you interact with your SQL databases using TypeScript. By handling the bridge between your code and your database, it allows you to w..."
last_updated: "2026-07-02T09:37:14.243111+00:00"
canonical_url: "https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/getting-started/installation-and-setup"
---

Drizzle ORM is a lightweight and flexible tool designed to help you interact with your SQL databases using TypeScript. By handling the bridge between your code and your database, it allows you to write queries safely and efficiently without worrying about complex underlying connection logic.

## Installation Steps

To use Drizzle ORM in your project, you need to install the core package along with the specific driver required for your chosen database.

### 1. Install the Core Package
Open your terminal in your project directory and run the following command to add Drizzle ORM to your project:

```bash
npm install drizzle-orm
```

### 2. Install Your Database Driver
Drizzle ORM is designed to work alongside existing database drivers. Depending on which database you are using, you must install the corresponding package.

> [!NOTE]
> Drizzle is "database-agnostic," meaning you only need to install the driver for the specific technology you are using (such as PostgreSQL, MySQL, or SQLite).

Commonly supported drivers include:

| Database Type | Driver Package Name |
| :--- | :--- |
| PostgreSQL | `pg` or `postgres` |
| MySQL | `mysql2` |
| SQLite | `better-sqlite3` or `sqlite3` |
| Serverless | `@neondatabase/serverless` |

For example, to set up a PostgreSQL project, you would install the driver like this:

```bash
npm install pg
```

## Understanding Key Concepts

*   **ORM (Object-Relational Mapper):** A tool that lets you interact with your database using your application's programming language, rather than writing raw database commands.
*   **Driver:** The underlying software that enables your application to communicate with a specific database system.
*   **Peer Dependencies:** These are secondary packages that Drizzle ORM expects you to have installed in your environment. Because Drizzle supports many different databases, it does not bundle every possible driver; instead, it lets you choose the one you need.

> [!TIP]
> If you are working in a specific environment like Cloudflare Workers or using a specialized platform like PlanetScale, check your platform's documentation to identify which specific driver package they recommend using with Drizzle.

## Troubleshooting and Setup Tips

> [!WARNING]
> Always ensure that the version of your database driver is compatible with the latest version of Drizzle ORM. Using outdated drivers may result in connection errors or unexpected behavior when executing queries.

*   **Keep it clean:** Only install the driver package for the database you are currently using. Installing unnecessary drivers may increase the size of your project unnecessarily.
*   **Version Compatibility:** If you encounter issues during setup, verify that your driver version meets the minimum requirements.
*   **Environment Variables:** After installing your driver, ensure your database connection credentials are stored securely and are accessible to your application.

## Related

- [Quickstart Guide](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/guide/getting-started/quickstart-guide)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/e1b68fed-3c4e-4c95-b2ba-ebf050f78025/llms.txt) for all pages in this wiki.
