IT Docs
Reference

Configuration (vercel.json)

The vercel.json project configuration file — build settings, rewrites, redirects, headers, function config, and crons.

Most projects deploy with zero configuration because Vercel detects your framework. When you need to override defaults, you add a vercel.json file at the root of your project. Settings defined in the dashboard and in vercel.json are merged; vercel.json is version-controlled, which makes it the better place for anything you want reviewed alongside code.

A representative example

{
  "buildCommand": "next build",
  "outputDirectory": ".next",
  "framework": "nextjs",
  "redirects": [
    { "source": "/old", "destination": "/new", "permanent": true }
  ],
  "rewrites": [
    { "source": "/api/:path*", "destination": "https://backend.example.com/:path*" }
  ],
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        { "key": "X-Frame-Options", "value": "DENY" }
      ]
    }
  ],
  "functions": {
    "api/heavy.ts": { "memory": 3008, "maxDuration": 60 }
  },
  "crons": [
    { "path": "/api/cron/cleanup", "schedule": "0 3 * * *" }
  ]
}

Common fields

FieldWhat it does
buildCommandOverride the detected build command
outputDirectoryWhere build artifacts are written
installCommandOverride how dependencies are installed
frameworkForce a framework preset
redirectsServer-side redirects (301/302 via permanent)
rewritesProxy a path to another path or external URL without changing the URL
headersAttach response headers by path pattern
functionsPer-function memory, maxDuration, and runtime settings
cronsScheduled function invocations
regionsWhich region(s) functions run in

Redirects vs rewrites

  • A redirect sends the browser to a new URL (the address bar changes).
  • A rewrite serves content from a different path or origin while the URL stays the same — useful for proxying an API or composing apps.

Function configuration

The functions object tunes individual functions — for example raising memory or maxDuration for a heavy endpoint. To enable Fluid Compute for specific environments programmatically, use the fluid property.

Precedence and validation

  • vercel.json settings generally take precedence over dashboard settings where they overlap.
  • The CLI validates the file during vercel build / vercel deploy; a malformed vercel.json fails the build with an error.
  • vercel pull brings the effective project settings down into .vercel/ so local vercel dev / vercel build match the cloud.

On this page