Skip to content
MtrXTools

Error: listen EADDRINUSE: address already in use

Another process is already using the port

Seen in Node.js, Python (Errno 98), Go (bind: address already in use), most servers

The server could not bind to its port because another process (often an old copy of the same app) is already listening on it.

Common causes

  • A previous instance of the app is still running, for example a dev server that did not exit.
  • A different service uses the same port.
  • Two parts of the app try to listen on the same port.

How to fix it

  1. Find the process: lsof -i :3000 or ss -ltnp on Linux and macOS, netstat -ano | findstr :3000 on Windows.
  2. Stop that process, or run the app on another port (for example PORT=3001).
  3. Make sure the app calls listen() only once.

Got a different message? Paste it into the error explainer.

Related errors

All 34 Command line & code errors