Deploying (CLI)
The build-and-deploy commands — vercel deploy, build, dev, pull, link, and redeploy — with options and examples.
These commands cover the core loop: link a project, develop locally, and ship. For the variables side, see Environment variables.
vercel deploy
Creates a deployment from the current directory. You can omit the word deploy — bare vercel does the same thing.
vercel # deploy a preview
vercel deploy # identical to the above
vercel deploy --prod # deploy to productionKey options
| Option | Description |
|---|---|
--prod | Deploy to the production domain |
--target <env> | Deploy to production, preview, or a custom environment |
--env KEY=value | Set an environment variable for this deployment |
--build-env KEY=value | Set a build-time-only variable |
--prebuilt | Deploy a local build from .vercel/output (skip building on Vercel) |
--skip-domain | Don't auto-promote domains; alias later with vercel promote |
--guidance | Print suggested next-step commands after deploying |
--yes | Skip prompts (CI) |
The old
--nameflag is deprecated — project identity now comes from linking.
Examples
# Production deploy in CI
vercel deploy --prod --token="$VERCEL_TOKEN" --yes
# Deploy to a custom "staging" environment
vercel deploy --target=staging
# Deploy a build you produced locally
vercel build
vercel deploy --prebuiltvercel build
Runs the build the same way Vercel's cloud would, writing artifacts to .vercel/output. Useful for inspecting build output or for the prebuilt-deploy flow above. It reads settings and variables from .vercel/, so run vercel pull first.
vercel build
vercel build --prod # build against the production environment
vercel build --target=staging
vercel build --output <dir> # custom output directoryvercel dev
Replicates the Vercel runtime locally so you can test Functions and Middleware without deploying each change.
npm install # install deps first
vercel devIf your framework's own dev command already gives you everything you need (for example
next devnatively supports functions, redirects, rewrites, and headers), use that directly — Vercel recommendsvercel devmainly when you specifically need to exercise Vercel-platform behavior locally. The configured Development Command in project settings affectsvercel devfor the whole team.
vercel pull
Downloads the project's settings and environment variables into the local .vercel/ directory, so vercel dev and vercel build behave like the cloud.
vercel pull
vercel pull --environment=preview
vercel pull --environment=productionFor framework dev servers that read .env files instead, use vercel env pull — see that page for the distinction.
vercel link
Associates the current directory with a Vercel project (creating .vercel/). Required before most project-scoped commands.
vercel link
vercel link --yes # accept the suggested project non-interactivelyvercel redeploy
Re-runs a deployment without changing the source — handy when a build was affected by something external (an expired token, a flaky dependency mirror).
vercel redeploy <deployment-url>