Port 3000

What’s running on port 3000 on my Mac?

Port 3000 is the most crowded default in web development. If EADDRINUSE :::3000 just stopped your server, here’s how to see which of the usual suspects owns it and how to move either one.

Commonly used by

  • Next.jsnext dev and next start listen on 3000 unless you pass -p or set PORT.
  • Create React Appreact-scripts start defaults to 3000 and reads the PORT environment variable.
  • Ruby on Railsbin/rails server (Puma) serves on 3000, bound to localhost in development.
  • Nuxtnuxi dev uses 3000, or --port / the PORT env var.
  • GrafanaA Homebrew or Docker Grafana serves its web UI on 3000.

Check what’s on port 3000

lsof -nP -iTCP:3000 -sTCP:LISTEN

A node command means Next.js, Create React App, Nuxt, Remix or an Express app. ruby means Rails (Puma). grafana or com.docker.backend means Grafana or some other container. To tell several Node projects apart, print the full command line and working folder:

ps -o pid,etime,command -p <PID>
lsof -a -p <PID> -d cwd -Fn | tail -1

Or with Stat Space installed:

statspace port 3000

Free it

If it’s a forgotten server, stop it with kill <PID>. Give it a few seconds to shut down; use kill -9 <PID> only if it ignores you. Docker containers need docker stop <name> instead, because killing com.docker.backend takes every container down with it. The full walkthrough is in how to kill a process on a port.

Or move your app

ToolChange the port
Next.jsnext dev -p 3001 or PORT=3001 npm run dev
Create React AppPORT=3001 npm start, or PORT=3001 in .env
Railsbin/rails server -p 3001
Nuxtnuxi dev --port 3001
Expressapp.listen(process.env.PORT || 3001)
Grafanahttp_port = 3001 under [server] in grafana.ini

Recent Next.js versions don’t fail when 3000 is taken: they quietly move to 3001. That keeps you working but hides the leftover server, so it pays to check what’s holding 3000.

Who can reach it

Look at the NAME column. 127.0.0.1:3000 is local only. *:3000 means every device on your network can open it. Next.js and Create React App bind to all interfaces by default, so on shared Wi-Fi your work-in-progress app and its API routes are reachable by others. Use next dev -H 127.0.0.1 or HOST=127.0.0.1 for CRA when you don’t need phone testing. More in dev server exposed to the network.

Seeing it live

Stat Space lists port 3000 with the framework it detected, the project folder, the launcher that started it (Terminal, VS Code, Cursor, Claude Code, Docker) and how long it’s been up. A *:3000 binding gets a warning, and stopping it asks first.

Questions

Why is port 3000 in use when I closed my terminal?

Closing a terminal tab doesn't always stop its children. A dev server started by an editor task, npm run dev &, or an AI agent can keep running with launchd as its parent. Find it with lsof -nP -iTCP:3000 -sTCP:LISTEN and stop it with kill <PID>.

How do I run Next.js on a different port?

Run next dev -p 3001, or PORT=3001 npm run dev. To make it permanent, change the script in package.json to "dev": "next dev -p 3001".

Can I make Rails and Next.js share port 3000?

No, only one process can listen on a given address and port. Give one of them another port, for example bin/rails server -p 3001, and point the frontend's API URL at it.

Get started

Know what your Mac is doing, without adding to it.

Free, no account. Pro is $9.99 once for the first 100 buyers.