---
title: "Deploy in one command"
description: "`nuxt-backend deploy` links the production deployment, pushes its env, deploys the backend and migrates its data, syncs the billing catalog, registers both webhooks, writes the app's env into the Vercel project and runs `doctor --prod`, step by step and safe to run again."
canonical_url: "https://nuxt-backend.dev/docs/ship/deploy/one-command"
---
# Deploy in one command

> `nuxt-backend deploy` links the production deployment, pushes its env, deploys the backend and migrates its data, syncs the billing catalog, registers both webhooks, writes the app's env into the Vercel project and runs `doctor --prod`, step by step and safe to run again.

Version: nuxt-backend 0.6.x · Tab: Ship · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

`npx nuxt-backend deploy` takes your app to production in one command. It does each step of [the first deploy](https://nuxt-backend.dev/docs/ship/deploy#the-first-deploy) the package can do for you, names the one or two it can't, and finishes with `doctor --prod`. Nobody copies a value from one dashboard to another.

```bash
npx nuxt-backend deploy
```

Run it from your app's folder, signed in to the Convex CLI and, on Vercel, to the Vercel CLI. It uses those logins and the provider tokens you give it, and stores no token of its own.

## What it does

Each step is reported under the [capability](https://nuxt-backend.dev/docs/start/concepts/capabilities) it belongs to, as `nuxt-backend status` shows them:

1. **The deployment.** It links the project's production deployment. When none answers, it asks before it creates one with your Convex login and makes it the default: a deployment that did not answer may still exist. Without a terminal it stops and says how to create one.
2. **The backend env.** It sets `BACKEND_ENVIRONMENT=production`, unless the deployment already holds `sandbox`, which it keeps. Production's own secrets (`AUTH_SECRET` and, on Vercel, the bot-check proof secret) are generated for it, never copied from `.env.local`. It asks you for what only you hold: the app's public origin as `SITE_URL`, the production billing token and the email key.
3. **The deploy.** It pushes the backend to production with `convex deploy`.
4. **The billing catalog.** It runs [`billing sync`](https://nuxt-backend.dev/docs/reference/cli#billing-sync) against Polar's production environment, which loads the catalog's products into the backend and registers the webhook at production's `/billing/events`, its signing secret stored on the deployment. When the sync writes new ids to `backend/billing.generated.ts`, it pushes the backend again, so production reads them. Commit that file: your host's build pushes the backend from the repository.
5. **The data.** On the backend it pushed last, it runs the package's data migrations and the workpool backfill, as [`upgrade --prod --yes`](https://nuxt-backend.dev/docs/reference/cli#upgrade) does (`data-migrations` in `--json`). A migration that fails fails the run. When production does not answer them, or a pool refuses the backfill, the step is `skipped`, not `failed`: the run goes on and exits `0` unless another step fails, and `upgrade --prod --yes` finishes them.
6. **The email webhook and topics.** It registers Resend's webhook at `/email/events`, its signing secret stored on the deployment too. Then it runs production's own [`email sync`](https://nuxt-backend.dev/docs/reference/cli#email-sync), so the topics, segments and lifecycle flows `backend/email.ts` declares exist at Resend (`email-sync` in `--json`).
7. **The app's env.** On Vercel, it writes the names the Nuxt app needs into the project's production environment, through the Vercel CLI and your login: the backend URL, a production deploy key for the build, and the app's half of the bot check. On another host, it prints what to set there.
8. **The gate.** It runs `doctor --prod` and prints what fails, with the fix, and what bot protection, monitoring and hosting still lack.

A key it asks for is read without echo, held in memory, and handed to the Convex or Vercel CLI on its stdin. In CI, or with `--json`, it asks nothing: give the keys in the shell (`SITE_URL`, `BILLING_ACCESS_TOKEN`, `EMAIL_API_KEY`), or it names each step that waits for one and skips it.

## Deploy a demo or staging app

```bash
npx nuxt-backend deploy --sandbox
```

`--sandbox` sets `BACKEND_ENVIRONMENT=sandbox` on the deployment instead, so it runs in production mode on the providers' test modes. It asks for the sandbox billing token, syncs the catalog to Polar's sandbox, and sets `EMAIL_DEV_INBOX=1`, so the demo's visitors read their sign-in codes off the page ([Use the dev inbox](https://nuxt-backend.dev/docs/develop/dev-inbox)). Later runs without the flag keep `sandbox`: `deploy` never turns a demo into a live app on its own. To go live from a demo deployment, set `BACKEND_ENVIRONMENT=production` on it yourself ([Deploy a demo or staging app](https://nuxt-backend.dev/docs/ship/deploy/staging)).

## Safe to run again

Every step looks before it writes. A second run changes nothing that is already right. A run that stopped halfway, on a provider that did not answer or a login that expired, picks up where it stopped. Run it first as a dry run, `npx nuxt-backend deploy --dry-run`: it prints every step it would take and changes nothing.

It writes production and your provider accounts, so it refuses a dev or preview deploy key, as every command that writes production does.

## What stays yours

- **Accounts and domains.** The Polar organization, the Resend account and its verified sending domain, the Convex and Vercel projects. The command uses them and never signs up for you: each [service page](https://nuxt-backend.dev/docs/services) walks the sign-up.
- **Choices.** The billing organization's settings are yours to confirm ([Apply the provider settings](https://nuxt-backend.dev/docs/services#recommended-settings)).
- **What no command can see.** Walk the list on [Prepare for launch](https://nuxt-backend.dev/docs/ship/checklist) before you open the doors.

## Related

- [Deploy to production](https://nuxt-backend.dev/docs/ship/deploy): the same steps by hand, on any host.
- [Service map](https://nuxt-backend.dev/docs/services#provider-setup): what each step sets, and the findings that check it.
- [Start from the deploy template](https://nuxt-backend.dev/docs/ship/deploy/template): a new app, deployed to Vercel from the start.
- [Deploy to Vercel](https://nuxt-backend.dev/docs/ship/deploy/vercel): the Vercel features the app can use beside hosting.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
