---
title: vercel build
description: Learn how to build a Vercel Project locally or in your own CI environment using the vercel build CLI command.
url: "https://vercel.com/docs/cli/build"
last_updated: 2026-10-07
related:
  - /docs/build-output-api
  - /docs/schedules/quickstart
  - /docs/build-output-api/services
  - /docs/deployments/environments
  - /docs/cli/global-options
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest docs search "<query>"
search_kb_with_vercel_cli: npx vercel@latest kb search "<query>"
---

# vercel build

The `vercel build` command can be used to build a Vercel Project locally or in your own CI environment.
Build artifacts are placed into the `.vercel/output` directory according to the
[Build Output API](/docs/build-output-api).

When used in conjunction with the `vercel deploy --prebuilt` command, this allows a Vercel Deployment
to be created *without* sharing the Vercel Project's source code with Vercel.

This command can also be helpful in debugging a Vercel Project by receiving error messages for a failed
build locally, or by inspecting the resulting build artifacts to get a better understanding of
how Vercel will create the Deployment.

It is recommended to run the `vercel pull` command before invoking `vercel build` to ensure that
you have the most recent Project Settings and Environment Variables stored locally.

## Usage

```bash filename="terminal"
vercel build
```

*Using the \`vercel build\` command to build a Vercel
Project.*

## Schedule configuration

`vercel build` combines [Schedules](/docs/schedules/quickstart) defined in `vercel.json` with schedules that framework builders emit in their Build Output `config.json`. Schedule names must be unique across both sources. If a name appears more than once, the build fails with `SCHEDULE_NAME_CONFLICT`.

For a schedule that targets a function in a [service](/docs/build-output-api/services), set `service` to the service's name and `function` to its build-output function identifier, without the `.func` suffix. For example, `service: "worker"` and `function: "index"` target `.vercel/output/services/worker/functions/index.func`, not a source filename. The build preserves function targets unchanged. `service` applies only to function targets, not `path` or `topic`. Service-hosted function schedules run after deployment; `vercel dev` rejects them with `DEV_SCHEDULE_SERVICE_FUNCTION_UNSUPPORTED`.

## Unique Options

These are options that only apply to the `vercel build` command.

### Production

The `--prod` option can be specified when you want to build the Vercel Project using Production Environment Variables. By default, the Preview Environment Variables will be used.

```bash filename="terminal"
vercel build --prod
```

*Using the \`vercel build\` command with the
\`--prod\` option.*

### Yes

The `--yes` option can be used to bypass the confirmation prompt and automatically pull environment variables and Project Settings if not found locally.

```bash filename="terminal"
vercel build --yes
```

*Using the \`vercel build\` command with the
\`--yes\` option.*

### Environment

Use the `--environment` option to define the environment you want to build against. This could be production, preview, or a [custom environment](/docs/deployments/environments#custom-environments). For production, [`--prod`](#production) does the same as `--environment=production`.

The following example builds for a custom environment named `staging`:

```bash filename="terminal"
vercel build --environment=staging
```

### Output

The `--output` option specifies a custom directory where the build artifacts will be written to, instead of the default `.vercel/output` directory.

```bash filename="terminal"
vercel build --output ./custom-output
```

*Using the \`vercel build\` command with the
\`--output\` option to specify a custom output directory.*

### Standalone

The `--standalone` option creates a standalone build with all dependencies inlined into function output folders, so build artifacts are fully contained within the `.vercel` folder.

```bash filename="terminal"
vercel build --standalone
```

*Using the \`vercel build\` command with the
\`--standalone\` option.*

## Global Options

The following [global options](/docs/cli/global-options) can be passed when using the `vercel build` command:

- [`--cwd`](/docs/cli/global-options#current-working-directory)
- [`--debug`](/docs/cli/global-options#debug)
- [`--global-config`](/docs/cli/global-options#global-config)
- [`--help`](/docs/cli/global-options#help)
- [`--local-config`](/docs/cli/global-options#local-config)
- [`--no-color`](/docs/cli/global-options#no-color)
- [`--non-interactive`](/docs/cli/global-options#non-interactive)
- [`--scope`](/docs/cli/global-options#scope)
- [`--token`](/docs/cli/global-options#token)
- [`--version`](/docs/cli/global-options#version)

For more information on global options and their usage, refer to the [options section](/docs/cli/global-options).

## Related guides

- [Deploying from a CI/CD pipeline](/docs/cli/deploying-from-cli#deploying-from-a-ci/cd-pipeline)

## Search the docs from your terminal

Search the Vercel docs and read pages as Markdown with the Vercel CLI. No login required.

```bash
# Find docs pages by keyword
npx vercel@latest docs search "environment variables"
npx vercel@latest docs search "function timeout"

# Print a docs page as Markdown, by path or URL
npx vercel@latest docs inspect <page>
```

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```

---

[View full sitemap](/docs/sitemap)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
