Error Reference › Linux / Server
Linux / Server
Address already in use (EADDRINUSE)
The port you tried to bind is already taken by another process.
What it looks like
Error: listen EADDRINUSE: address already in use :::3000
What does "Address already in use (EADDRINUSE)" mean?
Raised when a server tries to listen on a port another process already holds. Most often that other process is an earlier copy of the same server that never shut down, such as a dev server left running in another terminal.
What causes "Address already in use (EADDRINUSE)"?
- A previous run of your server is still alive.
- Another app uses the same port.
- The port is in TIME_WAIT after a crash.
How do I confirm the cause?
- Find what holds the port: lsof -i :3000 or ss -ltnp on Linux and macOS, netstat -ano | findstr :3000 on Windows.
- Check whether it is an old copy of your own app, another app, or a container publishing the same port.
- If nothing is listening but the error persists, the port may be in TIME_WAIT after a crash — it clears within a minute or two.
How do I fix "Address already in use (EADDRINUSE)"?
- Find and kill the process (lsof -i :PORT / kill).
- Use a different port.
- Enable SO_REUSEADDR / wait for TIME_WAIT to clear.
How do I stop it happening again?
- Shut the server down cleanly (handle SIGINT and SIGTERM and close the listener).
- Make the port configurable (a PORT environment variable) so two services never have to fight over it.