# dev (Prisma CLI v7) (/docs/cli/v7/dev)

Start a local Prisma Postgres server for development

Location: CLI > v7 > dev

The `prisma dev` command starts a [local Prisma Postgres](/guides/local-development-2-postgres) database that you can run Prisma ORM commands against. Use it for development and testing, then point the same project at [Prisma Postgres](/guides/introduction-2-postgres) for production.

## Usage

```bash
prisma dev [options]
```

## Options

| Option             | Description                                               | Default   |
| ------------------ | --------------------------------------------------------- | --------- |
| `-n`, `--name`     | Name of the server (helps isolate state between projects) | `default` |
| `-p`, `--port`     | Main port number the Prisma Dev server will listen on     | `51213`   |
| `-P`, `--db-port`  | Port number the database server will listen on            | `51214`   |
| `--shadow-db-port` | Port number the shadow database server will listen on     | `51215`   |
| `-d`, `--detach`   | Run the server in the background                          | `false`   |
| `--debug`          | Enable debug logging                                      | `false`   |

## Subcommands

| Command                                              | Description                       |
| ---------------------------------------------------- | --------------------------------- |
| [`prisma dev ls`](/guides/dev-commands-dev-ls)       | List available servers            |
| [`prisma dev rm`](/guides/dev-commands-dev-rm)       | Remove servers                    |
| [`prisma dev start`](/guides/dev-commands-dev-start) | Start one or more stopped servers |
| [`prisma dev stop`](/guides/dev-commands-dev-stop)   | Stop servers                      |

## Examples

### Start a local Prisma Postgres server

#### bun

```bash
bunx prisma dev
```

#### pnpm

```bash
pnpm prisma dev
```

#### yarn

```bash
yarn prisma dev
```

#### npm

```bash
npx prisma dev
```

Output:

```text
✔  Great Success!

   Your  prisma dev  server default is ready and listening on ports 63567-63569.

╭──────────────────────────────────╮
│[q]uit  [h]ttp url  [t]cp urls    │
╰──────────────────────────────────╯
```

### Start with a specific name

Create a named instance for project isolation:

#### bun

```bash
bunx prisma dev --name="mydbname"
```

#### pnpm

```bash
pnpm prisma dev --name="mydbname"
```

#### yarn

```bash
yarn prisma dev --name="mydbname"
```

#### npm

```bash
npx prisma dev --name="mydbname"
```

### Run in detached mode

Run the server in the background:

#### bun

```bash
bunx prisma dev --detach
```

#### pnpm

```bash
pnpm prisma dev --detach
```

#### yarn

```bash
yarn prisma dev --detach
```

#### npm

```bash
npx prisma dev --detach
```

This frees up your terminal. Use `prisma dev ls` to see running servers and `prisma dev stop` to stop them.

### Specify custom ports

#### bun

```bash
bunx prisma dev --port 5000 --db-port 5001 --shadow-db-port 5002
```

#### pnpm

```bash
pnpm prisma dev --port 5000 --db-port 5001 --shadow-db-port 5002
```

#### yarn

```bash
yarn prisma dev --port 5000 --db-port 5001 --shadow-db-port 5002
```

#### npm

```bash
npx prisma dev --port 5000 --db-port 5001 --shadow-db-port 5002
```

## Related pages

- [`db`](/guides/db-commands-db): Manage your database schema and lifecycle during development
- [`debug`](/guides/standalone-commands-debug): Display Prisma debug information including schema paths, engine binaries, environment variables, and cache directories for troubleshooting
- [`format`](/guides/standalone-commands-format): Format and validate your Prisma schema file with consistent structure
- [`generate`](/guides/standalone-commands-generate): Generate artifacts like Prisma Client based on your Prisma schema
- [`init`](/guides/standalone-commands-init): Set up a new Prisma project in the current directory

## Related pages

- [Authentication & Tools](./authentication-tools-index.md)
- [Build](./build-index.md)
- [Changelog](../changelog.md)
- [Concepts](./concepts-index.md)
- [Console commands](./console-commands-index.md)
- [Contract Authoring](./contract-authoring-index.md)
- [Core Concepts](./core-concepts-index.md)
- [Data Modeling](./data-modeling-index.md)
- [Database](./database-index.md)
- [DB commands](./db-commands-index.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
