Poick

This is a cached version of https://nextjs.org/docs/pages/api-reference/config/next-config-js/distDir from 2/28/2026, 3:21:37 PM.

next.config.js Options: distDir | Next.js

Set a custom build directory to use instead of the default .next directory.

MenuUsing App RouterFeatures available in /appLatest Version16.1.6Configurationnext.config.js OptionsdistDirCopy pagedistDirLast updated February 27, 2026 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: next.config.jsmodule.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. Was this helpful?