🔧 Error Fixes

EADDRINUSE: Address Already in Use — How to Fix It


Error: listen EADDRINUSE: address already in use :::3000

Another process is already using port 3000 (or whatever port you’re trying to use). You can’t have two processes on the same port.

Fix 1: Find and Kill the Process

# macOS / Linux — find what's using port 3000
lsof -i :3000

# Output:
# COMMAND  PID   USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
# node    1234  alice   23u  IPv6  0x...  0t0      TCP *:3000

# Kill it
kill 1234

# Force kill if it won't stop
kill -9 1234
# Windows
netstat -ano | findstr :3000
taskkill /PID 1234 /F

Fix 2: Use a Different Port

# Node.js
PORT=3001 node server.js

# Vite
npx vite --port 3001

# Next.js
npx next dev -p 3001

# Create React App
PORT=3001 npm start

Fix 3: Previous Process Didn’t Shut Down

If you Ctrl+C’d a server and it didn’t clean up:

# Kill all Node processes
killall node

# Or find the specific one
ps aux | grep node
kill <PID>

Fix 4: Docker Container Using the Port

# Check Docker containers
docker ps

# Stop the container using that port
docker stop <container_id>

One-Liner Fix

# Kill whatever is on port 3000 (macOS/Linux)
lsof -ti :3000 | xargs kill -9

See also: Docker port already in use fix