# Deployments (/docs/compute/deployments)

> 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.

Build, deploy, inspect, promote, and roll back app deployments on Prisma Compute.

Location: Compute > Deployments

A deployment is one built version of your app. Deployments live inside a [branch](https://www.prisma.io/docs/compute/branching), and the live deployment is the one currently serving traffic.

## Deploy [#deploy]

From your app directory:

  

#### bun

```bash
bunx @prisma/cli@latest app deploy
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app deploy
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app deploy
```

#### npm

```bash
npx @prisma/cli@latest app deploy
```

The CLI resolves your project, branch, and app, builds the code, and returns a live URL. What it resolves:

* **Project**: from your linked directory, or `--project` / `--create-project`.
* **Branch**: `--branch`, then your active Git branch, then `main`.
* **App**: `--app`, or inferred from your `package.json` name or directory. If more than one app matches in non-interactive mode, the deploy fails with `APP_AMBIGUOUS`; pass `--app`.

You can pass values straight into a deploy:

  

#### bun

```bash
bunx @prisma/cli@latest app deploy --framework hono --entry src/index.ts --http-port 3000
bunx @prisma/cli@latest app deploy --env DATABASE_URL=postgresql://example
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app deploy --framework hono --entry src/index.ts --http-port 3000
pnpm dlx @prisma/cli@latest app deploy --env DATABASE_URL=postgresql://example
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app deploy --framework hono --entry src/index.ts --http-port 3000
yarn dlx @prisma/cli@latest app deploy --env DATABASE_URL=postgresql://example
```

#### npm

```bash
npx @prisma/cli@latest app deploy --framework hono --entry src/index.ts --http-port 3000
npx @prisma/cli@latest app deploy --env DATABASE_URL=postgresql://example
```

`--env` is for one-off values at deploy time. For variables that should persist across deploys, set them on the project. To learn more, see the [Environment variables docs](https://www.prisma.io/docs/compute/environment-variables).

## Build locally [#build-locally]

Check your app builds before you ship it:

  

#### bun

```bash
bunx @prisma/cli@latest app build
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app build
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app build
```

#### npm

```bash
npx @prisma/cli@latest app build
```

`app build` supports the build types `auto`, `nextjs`, `nuxt`, `astro`, `nestjs`, `tanstack-start`, `custom`, and `bun`.

## Deploy to production [#deploy-to-production]

Your first deployment is promoted to production automatically. After that, every production deploy needs an explicit `--prod` flag, so you don't ship to production by accident:

  

#### bun

```bash
bunx @prisma/cli@latest app deploy --prod
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app deploy --prod
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app deploy --prod
```

#### npm

```bash
npx @prisma/cli@latest app deploy --prod
```

Without `--prod`, a deploy that resolves to the production branch and already has a live production deployment fails with `PROD_DEPLOY_REQUIRES_FLAG`. With `--prod`, the CLI shows the current live deployment and asks you to confirm before replacing it.

For scripts and CI, pass both flags so nothing waits on a prompt:

  

#### bun

```bash
bunx @prisma/cli@latest app deploy --prod --yes
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app deploy --prod --yes
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app deploy --prod --yes
```

#### npm

```bash
npx @prisma/cli@latest app deploy --prod --yes
```

In non-interactive mode, a `--prod` deploy without `--yes` fails with `CONFIRMATION_REQUIRED`. Preview deploys never need `--prod` and never ask.

## Inspect deployments [#inspect-deployments]

  

#### bun

```bash
bunx @prisma/cli@latest app show --app web
bunx @prisma/cli@latest app open --app web
bunx @prisma/cli@latest app list-deploys --app web
bunx @prisma/cli@latest app show-deploy dep_123
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app show --app web
pnpm dlx @prisma/cli@latest app open --app web
pnpm dlx @prisma/cli@latest app list-deploys --app web
pnpm dlx @prisma/cli@latest app show-deploy dep_123
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app show --app web
yarn dlx @prisma/cli@latest app open --app web
yarn dlx @prisma/cli@latest app list-deploys --app web
yarn dlx @prisma/cli@latest app show-deploy dep_123
```

#### npm

```bash
npx @prisma/cli@latest app show --app web
npx @prisma/cli@latest app open --app web
npx @prisma/cli@latest app list-deploys --app web
npx @prisma/cli@latest app show-deploy dep_123
```

`app show` describes the live app, `app open` opens its URL, `app list-deploys` lists the deployment history, and `app show-deploy` shows one deployment in detail.

## Logs [#logs]

Stream logs for the live deployment, or for a specific one:

  

#### bun

```bash
bunx @prisma/cli@latest app logs --app web
bunx @prisma/cli@latest app logs --app web --deployment dep_123
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app logs --app web
pnpm dlx @prisma/cli@latest app logs --app web --deployment dep_123
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app logs --app web
yarn dlx @prisma/cli@latest app logs --app web --deployment dep_123
```

#### npm

```bash
npx @prisma/cli@latest app logs --app web
npx @prisma/cli@latest app logs --app web --deployment dep_123
```

Your app's log lines go to stdout; the CLI's own status and errors go to stderr, so you can pipe them apart. If the log stream can't be served for the resolved deployment, the command fails with `DEPLOY_FAILED`.

## Promote and roll back [#promote-and-roll-back]

Promote an earlier deployment to be the live one:

  

#### bun

```bash
bunx @prisma/cli@latest app promote dep_123 --app web
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app promote dep_123 --app web
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app promote dep_123 --app web
```

#### npm

```bash
npx @prisma/cli@latest app promote dep_123 --app web
```

Promotion makes an existing deployment live behind the app's endpoint. If the deployment is stopped, it's started first and promoted once it's running. Nothing is rebuilt: environment variables are baked in when a deployment is created, so a promoted deployment keeps the config it was built with. To build a deployment without making it live, deploy with `--no-promote` and promote it later.

Roll back to the previous deployment, or a specific one. Rollback works the same way — it reuses an existing build and just targets the previous deployment, so there is no rebuild step between you and a known-good state:

  

#### bun

```bash
bunx @prisma/cli@latest app rollback --app web
bunx @prisma/cli@latest app rollback --app web --to dep_123
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app rollback --app web
pnpm dlx @prisma/cli@latest app rollback --app web --to dep_123
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app rollback --app web
yarn dlx @prisma/cli@latest app rollback --app web --to dep_123
```

#### npm

```bash
npx @prisma/cli@latest app rollback --app web
npx @prisma/cli@latest app rollback --app web --to dep_123
```

If there's nothing to roll back to, you get `NO_PREVIOUS_DEPLOYMENT`.

## Remove an app [#remove-an-app]

  

#### bun

```bash
bunx @prisma/cli@latest app remove --app web
```

#### pnpm

```bash
pnpm dlx @prisma/cli@latest app remove --app web
```

#### yarn

```bash
yarn dlx @prisma/cli@latest app remove --app web
```

#### npm

```bash
npx @prisma/cli@latest app remove --app web
```

This removes the app from the current branch. Pass `--yes` to skip the confirmation prompt.

## Next steps [#next-steps]

* [Environment variables](https://www.prisma.io/docs/compute/environment-variables): persist config across deploys.
* [GitHub integration](https://www.prisma.io/docs/compute/github): deploy on push instead of manually.
* [Domains](https://www.prisma.io/docs/compute/domains): point a custom domain at production.

## Related pages

- [`@prisma/cli`](https://www.prisma.io/docs/compute/getting-started): Deploy your first app to Prisma Compute with the @prisma/cli beta package, then learn the variations you'll need next.
- [`Branching`](https://www.prisma.io/docs/compute/branching): Branches are isolated environments that map to your Git branches, so preview work never touches production.
- [`CLI reference`](https://www.prisma.io/docs/compute/cli-reference): Every @prisma/cli command, flag, environment variable, and error code for Prisma Compute.
- [`Configuration`](https://www.prisma.io/docs/compute/configuration): Declare your deployable app in a typed prisma.compute.ts file so deploys are reproducible and monorepos work, without re-passing flags every time.
- [`Domains`](https://www.prisma.io/docs/compute/domains): Point a custom domain at a production app and the platform verifies DNS and provisions TLS for you.