How to Free Port 3000 on Mac

Dev servers for Node, Express, Create React App, Next.js and Rails commonly default to port 3000. If a previous run didn’t shut down, you get:

Error: listen EADDRINUSE: address already in use :::3000

Fix it in Terminal

lsof -nP -iTCP:3000 -sTCP:LISTEN     # find the PID
kill <PID>                            # polite stop

Or in one step:

kill $(lsof -ti tcp:3000 -sTCP:LISTEN)

Still running? kill -9 <PID> as a last resort. Confirm with the first command again.

Why it happens

  • A previous npm start was suspended (Ctrl+Z) instead of stopped.
  • A terminal tab closed but the child process lived on.
  • Another project’s server is on 3000.

Don’t want to kill it?

Run on another port: PORT=3001 npm start (varies by framework, e.g. next dev -p 3001).

Without Terminal

Open PortPeek from the menu bar, type 3000, and click Kill Process. You see which app owns the port first, and PortPeek confirms the port is free afterwards.

PortPeek gives you the same visibility from your Mac menu bar. See what's using your ports. Kill it in one click. It is a free, open-source utility inside MacPeek.