IT Docs
CLI

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 production

Key options

OptionDescription
--prodDeploy to the production domain
--target <env>Deploy to production, preview, or a custom environment
--env KEY=valueSet an environment variable for this deployment
--build-env KEY=valueSet a build-time-only variable
--prebuiltDeploy a local build from .vercel/output (skip building on Vercel)
--skip-domainDon't auto-promote domains; alias later with vercel promote
--guidancePrint suggested next-step commands after deploying
--yesSkip prompts (CI)

The old --name flag 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 --prebuilt

vercel 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 directory

vercel dev

Replicates the Vercel runtime locally so you can test Functions and Middleware without deploying each change.

npm install     # install deps first
vercel dev

If your framework's own dev command already gives you everything you need (for example next dev natively supports functions, redirects, rewrites, and headers), use that directly — Vercel recommends vercel dev mainly when you specifically need to exercise Vercel-platform behavior locally. The configured Development Command in project settings affects vercel dev for 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=production

For framework dev servers that read .env files instead, use vercel env pull — see that page for the distinction.

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-interactively

vercel 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>

On this page