Developers · Next.js build folders

Is it safe to delete the .next folder in a Next.js project?

Safe to removeComes back on its ownTypical size: 100 MB–5 GB per project
…/.next

Anywhere in your projects: a “.next” folder next to “package.json”.

Updated October 17, 2026By the MoreRoom team, Yando Pte. Ltd.This page as Markdown

The short answer

Yes. Rebuilt or re-downloaded automatically when needed.

What is it?

Next.js writes its build output and caches to a .next folder at the project root, next to package.json: compiled pages, the development server’s cache and the build cache in .next/cache. Only folders in projects untouched for 14 days are considered. Typically a few hundred MB to a few GB.

What happens if you delete it?

next dev or next build recreates the folder; the first build after deleting it is slower because nothing is cached. Source code is not affected.

How to remove it properly

Stop the dev server, then move the .next folder to the Trash in Finder, or run rm -rf .next in the project (permanent).

Quit the app that uses it, then move it to the Trash. Empty the Trash when you’re sure.

  • MoreRoom only suggests items unused for 14 days or more.

How MoreRoom helps

MoreRoom recognises this item, shows its real size and when it was last used, and labels it “Safe to remove”. In the free version you can move it to the Trash in one click, with Undo; Pro collects every safe item at once.

Frequently asked questions

Is it safe to delete the .next folder in a Next.js project?

Yes. Rebuilt or re-downloaded automatically when needed. next dev or next build recreates the folder; the first build after deleting it is slower because nothing is cached. Source code is not affected.

Will Next.js build folders come back after I delete it?

Yes. next dev or next build recreates the folder; the first build after deleting it is slower because nothing is cached. Source code is not affected.

How do I remove Next.js build folders properly?

Stop the dev server, then move the .next folder to the Trash in Finder, or run rm -rf .next in the project (permanent).

Guides that mention it

Related folders