---
title: "vlt deploy"
description: "Documentation for the vlt client and the vlt registry."
url: "https://docs.vlt.io/client/commands/deploy"
image: "https://docs.vlt.io/og/client/commands/deploy"
lang: "en"
---

# vlt deploy

Usage:

```bash title="Terminal"
$ vlt deploy <target-dir>
```

Copy a workspace, or a project without workspaces, and its production dependencies into a standalone folder, ready to ship, for example in a Docker image. It works like `pnpm deploy`.

```bash title="Terminal"
# From the project root
$ vlt deploy -w apps/api ./dist/api

# From inside the workspace folder

$ cd apps/api && vlt deploy ../../dist/api
```

## What ends up in the target

- The workspace's files, selected the same way [`vlt pack`](https://docs.vlt.io/client/commands/pack.md) selects them (the `files` field, `.npmignore` or `.gitignore`). Build the workspace before deploying it: no lifecycle scripts run.
- Its `package.json` without `devDependencies`.
- Every workspace it depends on, copied as a real folder into `.vlt-deploy/` inside the target. Nothing in the target links back to the project, so the folder can be copied or moved on its own.
- A `node_modules` folder with the production dependencies, and the `vlt.json` and `vlt-lock.json` it was installed from.

Dependencies are installed from the project's `vlt-lock.json`, so the target gets the exact versions the project uses. `vlt deploy` fails if the lockfile is missing or out of date: run `vlt install` in the project first.

```dockerfile title="Dockerfile"
FROM node:22-slim
COPY dist/api /app
WORKDIR /app
CMD ["node", "index.js"]
```

## Lifecycle scripts

Like [`vlt install`](https://docs.vlt.io/client/commands/install.md), `vlt deploy` runs **no lifecycle scripts** of dependencies unless allowed with `--allow-scripts`. The query is saved to the target's `vlt.json`, so `vlt build` in the target uses it too.

```bash title="Terminal"
$ vlt deploy -w apps/api ./dist/api --allow-scripts="#esbuild"
```

## Limitations

- Only one workspace is deployed at a time.
- `file:` dependencies are not supported.

## Options

| Flag                       | Description                                                    |
| -------------------------- | -------------------------------------------------------------- |
| `--workspace=<path>`       | The workspace to deploy, inferred inside a workspace folder    |
| `--workspace-group=<name>` | Deploy the workspace in this group; it must select exactly one |
| `--allow-scripts=<query>`  | Allow matching packages to run lifecycle scripts               |
| `--force`                  | Remove the contents of the target folder if it is not empty    |
