# voxal deploy

> Build and deploy your app so anyone can reach it over SSH

`voxal deploy` builds your app and ships it to voxal. When it finishes, anyone can reach your
app with `ssh app@voxal.sh`.

```bash
voxal deploy [dir] [--name <name>]
```

`dir` defaults to the current directory. The manifest is read from `voxal.json`.

## What it does

1. **Signs you in** if needed. On an interactive terminal it offers to log you in inline.
2. **Resolves the target project** (see [project resolution](#project-resolution) below).
3. **Builds** your app with production settings, the same [bundle pipeline](/cli/build#the-bundle-pipeline)
   as `voxal build`.
4. **Checks the size** against the bundle limit (hard limit 5 MiB, warning past 4 MiB).
5. **Validates** the bundle by booting it, so a broken app fails before it goes live.
6. **Uploads** it and, on success, prints the live `ssh app@voxal.sh` command.

Each deploy replaces the running version. voxal drops the previous instance, so the next
connection boots the new code.

## Flags

| Flag | Value | Description |
| --- | --- | --- |
| `--name` | `<name>` | Target project. Creates or links it if you own it. |
| `--token` | `<token>` | Authenticate a single command without an interactive login, for CI. Pair it with `--name`. |

## Project resolution

`voxal deploy` decides which project to deploy to in this order:

1. The `--name` flag.
2. The `name` field in `voxal.json`.
3. The cached link in `.voxal/project.json`.
4. An interactive picker, when running on a terminal.

## Examples

```bash
# Linked project, the common case, no prompts
voxal deploy

# Deploy a specific directory under an explicit name
voxal deploy ./apps/game --name space-game

# Non-interactive deploy in CI
voxal deploy --token "$VOXAL_TOKEN" --name myapp
```

## Troubleshooting

A `401` means the project is not linked to your account. Ownership is re-checked on every
deploy, so a project you do not own cannot be deployed to. Run [`voxal whoami`](/cli/auth) to
confirm your account and projects.

<Callout title="Verified end to end">
Every deploy is integrity-checked from build to run, so the bytes that boot are exactly the
bytes you built. See [Security](/platform/security).
</Callout>

---

Source: https://docs.voxal.sh/cli/deploy
