Port already in use (EADDRINUSE): find and stop the program
Find which program holds a port on Windows, macOS or Linux, then stop it or use another port.
An "address already in use" or EADDRINUSE error means another program already holds the port you asked for. Find the program, stop it, or start your app on a different port.
What to do, step by step
- Enter your port in the tool below and run the first command.
- Find the PID, which is the process number.
- Check what the program is before stopping it.
- Stop it with the second command, or just start your app on another port.
Find what is using port 8080
Run these in a terminal on your computer. Nothing is sent to this site.
Common causes
- The usual culprits
- An old dev server still running in another terminal, a Docker container, or a second copy of your app.
- macOS, port 5000 or 7000
- AirPlay Receiver uses them. Turn it off in System Settings.
- Windows, port 80, PID 4
- PID 4 is Windows itself. IIS or the World Wide Web Publishing Service is using the port. Stop it in Services, or use another port.
- Nothing found but the error stays
- Run the command as administrator or with sudo. Another user’s program is hidden otherwise.
Questions about Port already in use
- What does EADDRINUSE mean?
- The port you want is already used by another program. Stop that program or choose another port.
- How do I kill the process on a port?
- Find the PID with netstat (Windows), lsof (macOS) or ss (Linux), then stop it with taskkill or kill.
Free tools that help
- Common ports listSearch a list of common TCP and UDP port numbers: SSH 22, HTTP 80, HTTPS 443, MySQL 3306, PostgreSQL 5432 and more, with dev server ports.
Config generators for this
- nginx reverse proxy configSend visitors from port 80 to an app running on port 3000.
- PM2 ecosystem.config.jsRun a Node.js app with PM2: restarts on crash, memory limit, cluster mode and start at boot.
- systemd service fileRun your app in the background and start it automatically at boot.
- Kubernetes Deployment and ServiceA Deployment and Service YAML for your container image, with replicas, port, resource limits and health checks.