---
title: How can I set a custom build timeout?
description: Wrap your Vercel build command with the timeout command to ensure builds terminate gracefully before exceeding Vercel’s maximum build duration.
url: /kb/guide/custom-build-timeout
canonical_url: "https://vercel.com/kb/guide/custom-build-timeout"
published: 2025-11-03
last_updated: 2025-11-10
authors: Andrew Healey
related:
  - /docs/limits/overview
  - /docs/deployments/configure-a-build
  - /docs/projects/project-configuration
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Troubleshoot Build Errors](https://vercel.com/docs/deployments/troubleshoot-a-build?from=related) — Learn how to resolve common scenarios you may encounter during the Build step, including build errors that cancel a depl
- [vercel build](https://vercel.com/docs/cli/build?from=related) — Learn how to build a Vercel Project locally or in your own CI environment using the vercel build CLI command.
- [Builds](https://vercel.com/docs/builds?from=related) — Understand how the build step works when creating a Vercel Deployment.
- [Getting Timeouts When Deploying on Vercel](https://ai-sdk.dev/docs/troubleshooting/timeout-on-vercel?from=related)
- [vercel inspect](https://vercel.com/docs/cli/inspect?from=related) — Learn how to retrieve information about your Vercel deployments using the vercel inspect CLI command.
- [Build System](https://vercel.com/docs/fundamentals/builds?from=related) — Learn how Vercel transforms your source code into optimized assets ready to serve globally.
- [How can I add a custom build step to my project? ](https://vercel.com/kb/guide/how-can-i-add-a-custom-build-step-to-my-project?from=related) — Learn how to add a custom build step for your project.
- [How do I use the "Ignored Build Step" field on Vercel?](https://vercel.com/kb/guide/how-do-i-use-the-ignored-build-step-field-on-vercel?from=related) — Instructions on how to use the "Ignored Build Step" field to programmatically prevent a new deployment from being built.
- [Per-environment and per-branch Build Commands on Vercel](https://vercel.com/kb/guide/per-environment-and-per-branch-build-commands?from=related) — Customize your commands for specific behaviors based on branch, environment, and more.
- [What can I do when I run into build output limits with Next.js on Vercel?](https://vercel.com/kb/guide/what-can-i-do-when-i-run-into-build-output-limits-with-next-js-on-vercel?from=related) — Learn how to work with build output limits for Next.js on Vercel.

Full cross-link map for this page: [/kb/guide/custom-build-timeout.graph.md](/kb/guide/custom-build-timeout.graph.md)
<!-- /docsgraph:related -->


To kill builds before they timeout due to Vercel’s [maximum build duration](https://vercel.com/docs/limits/overview#build-time-per-deployment), wrap the existing build command with the [timeout](https://man7.org/linux/man-pages/man1/timeout.1.html) command. This method ensures that your builds are terminated gracefully, preventing unnecessary resource usage.

## 1\. Identify Your Build Command

The existing build command can be found via [Build and Deployment Settings](https://vercel.com/docs/deployments/configure-a-build#build-command), or the `buildCommand` value in a previously configured [vercel.json](https://vercel.com/docs/projects/project-configuration#buildcommand) file.

If you haven’t set one, it will be your framework’s default build command.

## 2\. Modify the Build Command

To set a custom build timeout, modify your build command to include the timeout command followed by the desired time limit. The syntax for the timeout command is:

`timeout [DURATION] [COMMAND]`

DURATION is a floating point number with an optional suffix: 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days. A duration of 0 disables the associated timeout.

To set a 15-minute timeout for a Next.js build, your modified build command would be:

`timeout 15m next build`

## 3\. Observe the Result

The next time your build command runs for longer than this duration, it will receive a 124 exit status, which looks like this in your build log:

`Error: Command "timeout 15m next build" exited with 124`