Node.js Error: listen EADDRINUSE address already in use :::3000
Fix EADDRINUSE in Node, Express, Next.js and Vite: find the program using the port, stop it, or start on another port.
The message "Error: listen EADDRINUSE: address already in use :::3000" means something is already listening on that port, often your own app from an earlier run that did not close. Find it, stop it, or use a different port.
What to do, step by step
- Look at the end of the error. The number after the colons is the port, such as 3000.
- Check for an old copy of your app in another terminal tab, an editor terminal or a background process.
- Find the process that holds the port with the command for your system below.
- Stop it, then start your app again.
- Or avoid the clash: start on another port, for example PORT=3001 npm start.
Commands you can copy
lsof -i :3000kill 12345netstat -ano | findstr :3000taskkill /PID 12345 /Fnpx kill-port 3000Other causes to check
- nodemon restarts but the port stays busy
- The old process did not exit. Stop nodemon with Ctrl+C once, wait a moment, and start it again. Make sure your app handles SIGTERM and closes its server.
- The port is used by a Docker container
- Run docker ps and look for a container publishing that port. Stop it with docker stop name.
- macOS, port 5000 or 7000
- AirPlay Receiver uses these ports. Turn it off in System Settings, or pick another port.
- It happens only after a crash
- A crashed parent process can leave a child running. Find the PID with the commands above and stop it.
Questions about Node EADDRINUSE
- What does EADDRINUSE mean?
- It means "address in use". Your program asked the system for a port that another program already holds, so the system refused.
- How do I kill the process on port 3000?
- Find its PID with lsof (macOS, Linux) or netstat (Windows), then stop it with kill or taskkill. The commands are on this page.
- Can two Node apps share one port?
- No. Each port can have only one listener. Give each app its own port, or put a reverse proxy in front of them.
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.
- nginx load balancer configSplit traffic across two or three copies of your app with an nginx upstream block.
- Caddyfile reverse proxySend visitors to an app on port 3000 and get HTTPS certificates automatically.
- Dockerfile for Node.jsA small, working Dockerfile for a Node.js app, with build step, non-root user and health check options.
- PM2 ecosystem.config.jsRun a Node.js app with PM2: restarts on crash, memory limit, cluster mode and start at boot.
- package.json fileCreate a package.json with the right name, version, module type, scripts and Node version.