# deploy (/docs/cli/deploy) > 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. Deploy a Composer application to Prisma Compute, to production or another environment. Location: CLI > deploy `deploy` deploys a [Prisma Composer](https://www.prisma.io/docs/composer) application to [Prisma Compute](https://www.prisma.io/docs/compute). It loads the module whose default export is the application root, named by `entry` in the `composer` section of `prisma.config.ts`, typically `./module.ts`. The command streams the deploy pipeline's own output to the terminal. `deploy` and [`dev`](https://www.prisma.io/docs/cli/dev) are root-level commands of the unified Prisma CLI. There is no `composer` command group. By default, the command uses the credentials from your existing `auth login` session. In CI or other headless environments, set `PRISMA_SERVICE_TOKEN` and `PRISMA_WORKSPACE_ID` instead. See [Deploying](https://www.prisma.io/docs/composer/deploying#credentials) for details. The first deploy of an app creates its project in your workspace, and a new project needs a region. Set it once, either as `prismaCloud({ region: 'us-east-1' })` in your deploy config or as the `PRISMA_REGION` environment variable; without one, the deploy stops with `project "" does not exist yet and no deploy region is configured`. A project that already exists keeps its region and needs neither. The region ids are listed under [Limitations](https://www.prisma.io/docs/compute/limitations). The `deploy` command does not build your application. Run your build command before deploying. ## Usage [#usage] #### npm ```bash npx prisma deploy npx prisma deploy --environment feat-auth ``` #### pnpm ```bash pnpm prisma deploy pnpm prisma deploy --environment feat-auth ``` #### yarn ```bash yarn prisma deploy yarn prisma deploy --environment feat-auth ``` #### bun ```bash bunx prisma deploy bunx prisma deploy --environment feat-auth ``` ## Flags [#flags] | Flag | Description | | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `--entry ` | Deploy the app from this module instead of the `entry` in `prisma.config.ts` | | `--name ` | Override the application name for this deploy. It defaults to the name of the exported application, and that name selects the project in your workspace: a project this module deployed before is reused, and a same-name project whose hosted state cannot be verified stops the deploy with `HostedStateBootstrapError`, so pass `--name` when the default would land in a project you did not mean to deploy into | | `--environment ` | The environment to deploy to (default: `production`). Any other name is a complete, isolated copy of the app, such as `staging` or one per pull request. Must be a valid git ref name | | `--report ` | Write the deploy's outcome as JSON to this path: resources, preview URLs, and the failure cause. Also settable as `PRISMA_COMPOSER_REPORT_FILE` | | `--build-id ` | Join the deploy record your CI already created rather than letting the target create one | ## Global flags [#global-flags] The Prisma CLI's global flags also apply: `--format`, `--json`, `--log-level`, `--verbose`, `--quiet`, `--yes`, `--confirm`, `--interactive`, `--color`, and `--config`. ## Environment variables [#environment-variables] | Variable | Description | | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `PRISMA_SERVICE_TOKEN` | A workspace service token from the [Prisma Console](https://console.prisma.io/?utm_source=docs\&utm_medium=content\&utm_content=cli), for CI and other headless environments. When unset, the command uses your stored `auth login` session | | `PRISMA_WORKSPACE_ID` | The workspace ID from the workspace's settings; pair it with the service token | | `PRISMA_REGION` | The region for a project this deploy creates; `prismaCloud({ region })` in the deploy config wins when both are set. Ignored once the project exists | | `PRISMA_COMPOSER_REPORT_FILE` | Path to write the deploy's JSON outcome report; the `--report` flag wins when both are set | ## Tearing down and log tailing [#tearing-down-and-log-tailing] The unified CLI has no `destroy` or `log` command. Both operations are available in-process through the control API below: `destroy` takes a required `environment` (production is `environment: 'production'`), and `log` tails a locally running application. ## The control API [#the-control-api] Everything the CLI does is also callable in-process, from `@prisma/composer/control`: typed `deploy`, `destroy`, `dev`, and `log` operations that return structured results instead of printing and exiting: ```ts import { fileURLToPath } from 'node:url'; import { deploy } from '@prisma/composer/control'; import prismaConfig from './prisma.config.ts'; const result = await deploy({ environment: 'pr-42', config: { value: prismaConfig.composer, file: fileURLToPath(new URL('./prisma.config.ts', import.meta.url)), }, }); if (!result.ok) console.error(result.failure.message); ``` Every operation takes a required `config`: the `composer` section of your `prisma.config.ts` and the path of the file that declares it. `deploy`'s `environment` defaults to `production`; `destroy`'s is required. Operations return `{ ok: true, value }` or `{ ok: false, failure }`. Failures come back as structured errors with a dotted `failure.code` and the same fix-naming `message` the CLI renders. The deploy engine's live output still streams to your process's stdio; the operations do not capture it. The operations authenticate with `PRISMA_SERVICE_TOKEN` and `PRISMA_WORKSPACE_ID` only. They do not read the session stored by `auth login`, so a script that runs fine next to the CLI's `deploy` fails under the control API with `environment variable PRISMA_WORKSPACE_ID is required` until both variables are exported. ## Next steps [#next-steps] - [`dev`](https://www.prisma.io/docs/cli/dev): run the same application locally, with no credentials. - [Getting started](https://www.prisma.io/docs/composer/getting-started): the commands in a working flow. - [Deploying](https://www.prisma.io/docs/composer/deploying): environments, CI, and what a deploy prints. ## Related pages - [auth](https://www.prisma.io/docs/cli/auth): Sign in to your Prisma account from the CLI, sign out, and manage workspace sessions. - [branch](https://www.prisma.io/docs/cli/branch): List platform branches for a project. - [bucket](https://www.prisma.io/docs/cli/bucket): Create and manage object-store buckets. - [Configuration](https://www.prisma.io/docs/cli/configuration): Configure Prisma ORM CLI commands with prisma.config.ts and global flags. - [contract emit](https://www.prisma.io/docs/cli/contract-emit): Emit Prisma ORM contract artifacts.