Nuxt dev server default port: 3000

Nuxt dev server uses TCP port 3000 by default. From Nuxt 4.6, nuxt dev moves to another free port when the one it asked for is taken, logs which port it chose, and exits instead if you pass --strictPort. Nuxt 4.6 also records each dev server in a nuxt.lock file in the build directory (.nuxt by default).

Updated

Key facts

Default ports for Nuxt dev server
PortProtocolRoleCategory
3000TCPnuxt dev serverFrontend

What happens when the port is busy

From Nuxt 4.6, nuxt dev moves to another free port when the one it asked for is taken, logs which port it chose, and exits instead if you pass --strictPort. Nuxt 4.6 also records each dev server in a nuxt.lock file in the build directory (.nuxt by default). In a terminal, a second nuxt dev for the same project asks whether to take over the running server. Outside a terminal it refuses to stop a server that was started in one. --takeover stops the running server and starts the new one in its place.

Change the port

CLI flag
nuxt dev --port 3001

-p is the short form. From Nuxt 4.6, add --strictPort to exit when the port is taken instead of switching.

nuxt.config.ts
export default defineNuxtConfig({
  devServer: {
    port: 3001,
  },
})

devServer.port defaults to 3000. The flag and the environment variables below take precedence over it.

Environment variable
NUXT_PORT=3001 nuxt dev

Precedence is --port, then NUXT_PORT, NITRO_PORT, PORT, and finally devServer.port.

Environment variable: NUXT_PORT. Checked first, then NITRO_PORT and PORT. The --port flag wins over all of them, and they win over devServer.port in nuxt.config.

Bind address

The host comes from -h, --host, then NUXT_HOST, NITRO_HOST or HOST, then devServer.host. A HOST variable left in your shell therefore changes where nuxt dev listens. With none of them set, Nuxt 4.6 and later listens on localhost, except inside Docker or WSL, where it listens on all interfaces. Pass --public to listen on all interfaces and accept any host.

What else uses this port

TCP port 3000 is also the default for Next.js dev server and Rails server.

The dataset is the 12 tools on the ports index.

Find and free this port

These commands find the process that holds TCP port 3000 and stop it. They come from the Port in use command generator. PID_NUMBER stands for the process ID you read from the first command: replace it before you run the others.

macOS (zsh)
lsof -nP -iTCP:3000 -sTCP:LISTEN
ps -p PID_NUMBER -o pid,ppid,user,command
kill -TERM PID_NUMBER
Linux (bash)
ss -ltnp 'sport = :3000'
ps -p PID_NUMBER -o pid,ppid,user,command
kill -TERM PID_NUMBER
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 3000 -State Listen -ErrorAction SilentlyContinue | Select-Object LocalAddress, LocalPort, State, OwningProcess
Get-CimInstance -ClassName Win32_Process -Filter "ProcessId = PID_NUMBER" | Select-Object ProcessId, ParentProcessId, Name, CommandLine
Stop-Process -Id PID_NUMBER

Read the output of the second command before you stop anything, because the owner may be a container or another person’s process. Then run the first command again to confirm the port is free.

Next free ports

Counting up from 3000, the next three ports that no tool in this dataset uses as a default are 3001, 3002, and 3003. They are suggestions only: another program on your machine may hold any of them, so run the find command above before you choose one.

In Rig

Rig starts Nuxt with --port N, where N is the project’s port. If something else holds N, start_project returns a portConflict that names the owner and a suggested free port, unless you pass resolve_port=kill (stop the owner) or resolve_port=suggest (switch the project to a free port).

Collisions in practice

Nuxt shares 3000 with Next.js, so a workspace holding both collides on the first start. The less obvious clash is inside Nuxt: the port resolves from --port, then NUXT_PORT, NITRO_PORT, PORT, and only then devServer.port in nuxt.config. A PORT exported for another service in the same shell therefore beats the value in your config, which is why a hard-coded devServer.port can look ignored. Set the port in one place, use the flag when you need certainty, and from Nuxt 4.6 add --strictPort if you would rather fail than move.

Frequently asked questions

Why is devServer.port in nuxt.config.ts ignored?

Environment variables outrank it. nuxt dev reads --port first, then NUXT_PORT, NITRO_PORT and PORT, and uses devServer.port only when none of them is set. Run env | grep PORT to see whether one is exported in your shell.

How do I stop Nuxt switching to another port?

Pass --strictPort in Nuxt 4.6 or later. nuxt dev then exits when the requested port is taken instead of choosing another one. Earlier releases have no such flag, so run nuxt dev --help on your installed version to see what it offers.

A second nuxt dev says a server is already running. What now?

From Nuxt 4.6, nuxt dev records each dev server in a nuxt.lock file in the build directory (.nuxt by default). When it refuses, the message lists the running server’s URL and PID and suggests --takeover, which stops that server and starts a new one in its place. Otherwise, keep using the server that is already running.

Sources

  1. Nuxt: nuxt dev command (--port, --strictPort, --takeover, environment variables)Official documentation, checked 13 October 2026
  2. Nuxt: configuration reference (devServer.port)Official documentation, checked 13 October 2026
  3. Nuxt 4.6 release post (dev server lock file)Official documentation, checked 13 October 2026
  4. Nuxt: published CLI source (@nuxt/cli@4.0.1 on npm)Editorial, checked 13 October 2026

Busy ports in Rig

When a start fails because a port is taken, Rig shows which process owns it when it can, and lets you reclaim the port or choose another. You do not need Rig to use this page.

Related

https://userig.app/ports/nuxt