/errors/express/eaddrinuse-address-already-in-use
Error: listen EADDRINUSE: address already in use :::3000
verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated 2026-10-20
- tool
- Express
- exit code
- 1
- versions
- Node.js 18+, Express 4, Express 5
- os
- linux, macos, windows
Error: listen EADDRINUSE: address already in use :::3000 means your server tried to listen on a port that another socket already holds; ::: is the IPv6 "all addresses" form. Only one process can listen on a port at a time. Stop the other process, or use a different port.
Reproduce the error
Two Express apps on the same port in one process:
npm init -y >/dev/null
npm install --silent --no-audit --no-fund express@5 >/dev/null 2>&1
node -e '
const express = require("express");
const first = express().listen(3456, () => {
const second = express().listen(3456);
second.on("error", (err) => { console.log(err.code, "-", err.message); first.close(); });
});'Output
EADDRINUSE - listen EADDRINUSE: address already in use :::3456
Find the process that holds the port
# Linux / macOS
lsof -i :3000
ss -ltnp 'sport = :3000' # Linux
# Windows (PowerShell)
Get-NetTCPConnection -LocalPort 3000 | Select-Object OwningProcessThen stop that process (kill <pid>, or Stop-Process -Id <pid> on Windows).
Use a configurable port
const port = Number(process.env.PORT ?? 3000);
const server = app.listen(port, () => console.log(`listening on ${port}`));
server.on('error', (err) => {
if (err.code === 'EADDRINUSE') console.error(`port ${port} is busy, set PORT to another value`);
else throw err;
});PORT=3001 node app.js then starts a second copy without a conflict. Passing 0 lets the operating system pick any free port, which is handy in tests.
Sources
Related pages
errors · spring-bootSpring Boot: Web server failed to start. Port 8080 was already in use.Spring Boot stops with Web server failed to start. Port 8080 was already in use. when another process holds the port. Free it or set server.port to a new value.compare · flaskFlask vs FastAPI: differences for building Python web APIsFlask is a minimal WSGI framework where you add validation and docs yourself; FastAPI is async ASGI, validates with type hints and generates OpenAPI docs.errors · djangoImproperlyConfigured: Requested setting …, but settings are not configuredDjango raises ImproperlyConfigured when code reads settings before DJANGO_SETTINGS_MODULE is set or settings.configure() runs. Set it, then call django.setup().