# dev (/docs/cli/dev)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Start a local Prisma Postgres server for development

Location: CLI > dev

The `prisma dev` command starts a [local Prisma Postgres](https://www.prisma.io/docs/postgres/database/local-development) database that you can run Prisma ORM commands against. It's useful for development and testing and allows easy migration to [Prisma Postgres](https://www.prisma.io/docs/postgres) in production.

## Usage [#usage]

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

## 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 [#subcommands]

| Command                              | Description                       |
| ------------------------------------ | --------------------------------- |
| [`prisma dev ls`](https://www.prisma.io/docs/cli/dev/ls)       | List available servers            |
| [`prisma dev rm`](https://www.prisma.io/docs/cli/dev/rm)       | Remove servers                    |
| [`prisma dev start`](https://www.prisma.io/docs/cli/dev/start) | Start one or more stopped servers |
| [`prisma dev stop`](https://www.prisma.io/docs/cli/dev/stop)   | Stop servers                      |

## Examples [#examples]

### Start a local Prisma Postgres server [#start-a-local-prisma-postgres-server]

  

#### bun

```bash
bunx prisma dev
```

#### pnpm

```bash
pnpm dlx prisma dev
```

#### yarn

```bash
yarn dlx 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 [#start-with-a-specific-name]

Create a named instance for project isolation:

  

#### bun

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

#### pnpm

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

#### yarn

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

#### npm

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

### Run in detached mode [#run-in-detached-mode]

Run the server in the background:

  

#### bun

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

#### pnpm

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

#### yarn

```bash
yarn dlx 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 [#specify-custom-ports]

  

#### bun

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

#### pnpm

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

#### yarn

```bash
yarn dlx 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`](https://www.prisma.io/docs/cli/db): Manage your database schema and lifecycle during development
- [`debug`](https://www.prisma.io/docs/cli/debug): Display Prisma debug information including schema paths, engine binaries, environment variables, and cache directories for troubleshooting
- [`format`](https://www.prisma.io/docs/cli/format): Format and validate your Prisma schema file with consistent structure
- [`generate`](https://www.prisma.io/docs/cli/generate): Generate artifacts like Prisma Client based on your Prisma schema
- [`init`](https://www.prisma.io/docs/cli/init): Set up a new Prisma project in the current directory