Skip to main content
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

string
The directory containing the Next.js application. Defaults to the current working directory.
number
default:"3000"
Port number to listen on. Can also be set via the PORT environment variable.
string
default:"0.0.0.0"
Hostname to listen on. Set to 0.0.0.0 to make the server available on all network interfaces.
boolean
Start development mode using Turbopack (default bundler in Next.js 15+).
boolean
Start development mode using webpack instead of the default Turbopack bundler.
boolean
default:"false"
Disable source map generation in the development server.
boolean
Disable server-side Fast Refresh. When set, changes to server-side code require a full page reload instead of a soft refresh.
string
Enable the Node.js inspector for debugging server-side code. Accepts an optional host:port (default 127.0.0.1:9229).
boolean
Start the server with HTTPS using a locally-trusted self-signed certificate generated by mkcert.
string
Path to a custom HTTPS private key file.
string
Path to a custom HTTPS certificate file.
string
Path to a custom HTTPS certificate authority file.
string
Report a subset of the debugging trace to a remote HTTP URL. Includes sensitive data.
boolean
Use Node.js native TypeScript resolution for next.config.ts or next.config.mts.
boolean
Enable CPU profiling via V8’s inspector. Profiles are saved to .next/cpu-profiles/ on process exit.
boolean
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

This makes the dev server accessible at your machine’s LAN IP address, useful for testing on mobile devices.

HTTPS in development

Generates a locally-trusted certificate and starts the server at https://localhost:3000. Useful for testing webhooks, OAuth flows, and other HTTPS-only features. To use an existing certificate:
--experimental-https is for development only. Use a certificate from a trusted authority in production.

Debugging server-side code

Opens the Node.js inspector on the default port. Connect with Chrome DevTools at chrome://inspect or any editor with Node.js debug support.

CPU profiling

Profiles are saved to .next/cpu-profiles/ when you stop the server (Ctrl+C). Open .cpuprofile files in Chrome DevTools under the Performance tab.

Version history