next dev starts the application in development mode with Hot Module Replacement (HMR), error reporting, and incremental compilation.
Development builds are output to
.next/dev instead of .next, so next dev and next build can run concurrently without conflicts.Options
The directory containing the Next.js application. Defaults to the current working directory.
Port number to listen on. Can also be set via the
PORT environment variable.Hostname to listen on. Set to
0.0.0.0 to make the server available on all network interfaces.Start development mode using Turbopack (default bundler in Next.js 15+).
Start development mode using webpack instead of the default Turbopack bundler.
Disable source map generation in the development server.
Disable server-side Fast Refresh. When set, changes to server-side code require a full page reload instead of a soft refresh.
Enable the Node.js inspector for debugging server-side code. Accepts an optional
host:port (default 127.0.0.1:9229).Start the server with HTTPS using a locally-trusted self-signed certificate generated by
mkcert.Path to a custom HTTPS private key file.
Path to a custom HTTPS certificate file.
Path to a custom HTTPS certificate authority file.
Report a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.
Use Node.js native TypeScript resolution for
next.config.ts or next.config.mts.Enable CPU profiling via V8’s inspector. Profiles are saved to
.next/cpu-profiles/ on process exit.Show all available options.
Watch mode
The development server automatically watches all source files. When you save a change, Next.js incrementally recompiles only the affected modules and applies the update via HMR without a full page reload. For Server Components and server-side code, the affected pages are revalidated and the browser updates automatically.Examples
Change the port
PORT cannot be set in .env files — the HTTP server starts before environment files are loaded.Expose to the network
HTTPS in development
https://localhost:3000. Useful for testing webhooks, OAuth flows, and other HTTPS-only features.
To use an existing certificate:
Debugging server-side code
chrome://inspect or any editor with Node.js debug support.
CPU profiling
.next/cpu-profiles/ when you stop the server (Ctrl+C). Open .cpuprofile files in Chrome DevTools under the Performance tab.
Version history
| Version | Changes |
|---|---|
v15.0.0 | Turbopack for dev stable |
