---
title: distDir
description: Set a custom build directory to use instead of the default .next directory.
url: "https://nextjs.org/docs/14/app/api-reference/next-config-js/distDir"
docs_index: /docs/14/llms.txt
version: 14.2.35
lastUpdated: 2023-06-28
prerequisites:
  - "API Reference: /docs/14/app/api-reference"
  - "next.config.js Options: /docs/14/app/api-reference/next-config-js"
---


> For an index of all Next.js documentation, see [/docs/14/llms.txt](/docs/14/llms.txt).
You can specify a name to use for a custom build directory to use instead of `.next`.

Open `next.config.js` and add the `distDir` config:

```js filename="next.config.js"
module.exports = {
  distDir: 'build',
}
```

Now if you run `next build` Next.js will use `build` instead of the default `.next` folder.

> `distDir` **should not** leave your project directory. For example, `../build` is an **invalid** directory.
---

For an index of all available documentation, see [/docs/14/llms.txt](/docs/14/llms.txt)