Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Next.js 16+ · Command

next start

Starts a previously built Next.js application in production mode. It supports selecting the directory, port, hostname, connection timeout, and optional CPU profiling.

How it works

Run this command after building a Next.js application to launch its production server. It serves the compiled output and accepts options such as the application directory, port, hostname, and keep-alive timeout.

Syntax

next start [directory] [-p <port>] [-H <hostname>] [--keepAliveTimeout <milliseconds>] [--experimental-cpu-prof]

Parameters

NameTypeDescription
directorystringOptional application directory; defaults to the current directory.
portnumberListening port; defaults to 3000 and can also come from PORT.
hostnamestringListening hostname; defaults to 0.0.0.0.
keepAliveTimeoutnumberMaximum inactive-connection wait time in milliseconds.

Returns

Starts the Next.js production server.

Key points

  • Use next start to serve the application as a production server.
  • The normal lifecycle is build first, then start.
  • Choose a listening port with -p or --port <port>.
  • Bind the server to a chosen host with -H or --hostname <hostname>.
  • Tune inactive connection closure using --keepAliveTimeout <keepAliveTimeout>.
  • Enabling --experimental-cpu-prof writes V8 CPU profiles to .next-profiles/ when the process exits.

Common mistakes

  • Run next build before next start; starting without a production build is unsupported.
  • A directory argument changes which application is started; otherwise, the current working directory is used.

Example: Run a production server

npm run build
npm run start -- --port 4000

Builds the application and then starts the compiled production server on port 4000.

When to use it

Production deployment

After creating a production build, launch the Node.js server that serves it.

Custom port

Run the built application on a non-default port for local verification or infrastructure constraints.

Operational tuning

Adjust inactive connection handling for a production server or enable CPU profiling during diagnosis.

Interview questions

QWhat does next start do, and what must happen first?

next start launches the application in production mode. The application must be compiled with next build before this command runs.

Follow-up: How would you change the listening port? Pass -p or --port, or set the PORT environment variable.

QWhich location and networking options does next start support?

The command accepts an optional directory followed by options such as --port and --hostname. Without a directory, it starts the application from the current directory.

Follow-up: What is the default hostname? It is 0.0.0.0, unless overridden with -H or --hostname.

QHow can the production server's keep-alive timeout be configured?

Use --keepAliveTimeout with a value in milliseconds to configure how long inactive connections remain open before closing. For example, next start --keepAliveTimeout 70000 sets 70,000 milliseconds.

Follow-up: What other operational profiling option is documented? --experimental-cpu-prof enables V8 CPU profiling and saves profiles under .next-profiles/ on exit.

  • next build
  • next dev
  • next CLI

Source: CLI: next. Checked 2026-10-15.