---
title: vercel.toml
product: vercel
url: /docs/project-configuration/vercel-toml
canonical_url: "https://vercel.com/docs/project-configuration/vercel-toml"
last_updated: 2018-10-20
type: conceptual
prerequisites:
  - /docs/project-configuration
related:
  - /docs/project-configuration/vercel-json
  - /docs/routing/rewrites
  - /docs/services
  - /docs/project-configuration/vercel-ts
summary: Learn about vercel.toml on Vercel.
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---

# Static Configuration with vercel.toml

The `vercel.toml` file lets you configure your Vercel project with [TOML](https://toml.io/). In addition to supporting the same configuration properties as [`vercel.json`](/docs/project-configuration/vercel-json), it supports comments and has a flatter structure.

You may wish to use TOML when you have a large or complex configuration, such as if you need to configure many [Rewrites](/docs/routing/rewrites) or are using [Services](/docs/services) to deploy multiple applications within one Vercel project.

Create `vercel.toml` in your project root and commit it with your code. Use only one project configuration file: `vercel.toml`, [`vercel.json`](/docs/project-configuration/vercel-json), or [`vercel.ts`](/docs/project-configuration/vercel-ts).

## Configure your project

Set top-level properties using TOML key-value pairs. This example configures the build command, output directory, and clean URLs:

#### \['vercel.toml'

```toml filename="vercel.toml"
"$schema" = "https://openapi.vercel.sh/vercel.json"
buildCommand = "pnpm run build"
outputDirectory = "dist"
cleanUrls = true
```

#### 'vercel.json']

```json filename="vercel.json"
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "buildCommand": "pnpm run build",
  "outputDirectory": "dist",
  "cleanUrls": true
}
```

TOML is a good fit for configuring [Services](/docs/services), which let you deploy multiple applications within one Vercel project. This example deploys a frontend and backend service, routing `/api` requests to the backend and all other requests to the frontend:

#### \['vercel.toml'

```toml filename="vercel.toml"
"$schema" = "https://openapi.vercel.sh/vercel.json"

# Next.js frontend
[services.frontend]
root = "frontend/"

# FastAPI backend
[services.backend]
root = "backend/"
entrypoint = "main:app"

[[rewrites]]
source = "/api/(.*)"
destination = { service = "backend" }

[[rewrites]]
source = "/(.*)"
destination = { service = "frontend" }
```

#### 'vercel.json']

```json filename="vercel.json"
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "services": {
    "frontend": {
      "root": "frontend/"
    },
    "backend": {
      "root": "backend/",
      "entrypoint": "main:app"
    }
  },
  "rewrites": [
    {
      "source": "/api/(.*)",
      "destination": { "service": "backend" }
    },
    {
      "source": "/(.*)",
      "destination": { "service": "frontend" }
    }
  ]
}
```

## Configuration properties

`vercel.toml` supports all the same configuration fields as [`vercel.json`](/docs/project-configuration/vercel-json).


---

[View full sitemap](/docs/sitemap)
