How to fix “EADDRINUSE: address already in use” on Mac
Short answerEADDRINUSE: address already in use :::3000 means another process is already listening on port 3000. On a Mac, run lsof -nP -iTCP:3000 -sTCP:LISTEN to see which process it is, then kill <PID> to stop it, or start your server on a different port. Portmole shows the same process in your menu bar and closes it in one click.
What the error means
Only one process can listen on a given port at a time. When your dev server (Node, Vite, Next.js, Express, Rails, Django and so on) tries to bind a port that something else already holds, the operating system refuses and Node prints Error: listen EADDRINUSE: address already in use :::3000. The :::3000 is port 3000 on all IPv6 and IPv4 addresses.
Nine times out of ten the “something else” is your own earlier server: a terminal tab you forgot about, an editor that started it in the background, or a crashed process whose child kept running.
Step 1: find what is using the port
lsof -nP -iTCP:3000 -sTCP:LISTENThe output lists the command name (often node), its PID and the user. If nothing is printed, the port is free or the process belongs to another user, in which case rerun the command with sudo.
Step 2: stop it
kill 12345Replace 12345 with the PID from step 1. kill sends SIGTERM, which asks the process to shut down cleanly. If it is still listening a few seconds later, force it with kill -9 12345. To do both steps at once:
kill $(lsof -t -iTCP:3000 -sTCP:LISTEN)Or use a different port
If the old process is something you want to keep, start your server elsewhere instead. Most tools take a --port flag or a PORT environment variable. Our guide to running a dev server on another port has the exact flag for each framework.
Why it keeps happening
- You closed the terminal window but the server kept running as an orphan.
- A watcher or build tool restarted the server while the old one was still shutting down.
- Two projects are configured for the same default port.
- On macOS, ports 5000 and 7000 are taken by AirPlay Receiver (see the separate post on that).
The no-terminal way
Portmole is a free macOS menu bar app that lists every process listening on a port and closes it with one click, so you don't need to remember any of these commands. Open it, find :3000, click ✕.
Frequently asked questions
How do I find what is running on port 3000 on Mac?
Run lsof -nP -iTCP:3000 -sTCP:LISTEN in Terminal. It prints the process name and PID listening on that port.
Is it safe to kill the process using the port?
If it is your own dev server, yes. Use plain kill first so it can shut down cleanly, and kill -9 only if it ignores that. Don't kill system processes you don't recognise.
Why does EADDRINUSE happen after I closed my terminal?
Closing a terminal window does not always stop the processes started in it. The server can keep running in the background and keep holding the port.
Skip the terminal
Portmole shows every port your Mac is listening on and closes any of them with one click. Free, signed and notarized, about 7 MB.
Download Portmole for Mac