Fix 'Error: listen EADDRINUSE: address already in use :::3000' in Node.js, Next.js & Vite
Find and kill the process holding port 3000 (or any port) on macOS, Linux, and Windows, or start your dev server on another port.
Error: listen EADDRINUSE: address already in use :::3000
# 1. See which process owns port 3000 npx castov port 3000 # 2a. macOS / Linux: kill it kill -9 $(lsof -t -i:3000) # 2b. Windows (PowerShell): kill it Stop-Process -Id (Get-NetTCPConnection -LocalPort 3000).OwningProcess -Force # 3. Or simply start on another port PORT=3001 npm run dev # Next.js / Express npx vite --port 3001 # Vite
Root Cause & Mechanism Analysis
Why does this error occur?
Another process — usually a previous dev server that did not shut down, a zombie `node` process, or another app — is already bound to the port your server tries to listen on. Only one process can listen on a TCP port per interface.
Frequently Asked Questions
Why does EADDRINUSE happen after I close VS Code?
What does ':::3000' mean in the error?
Need Zero-Knowledge .env Secret Sync Across Your Engineering Team?
Explore Castov Env Vault for client-side AES-256-GCM encrypted environment sharing, or sponsor this engineering hub.
Related Developer Error Solutions
Browse All 69 GuidesDocker: Bind for 0.0.0.0:Port Failed
Identify and terminate conflicting host processes or adjust Docker port mapping to resolve port bind collisions.
Node.js: connect ECONNREFUSED ::1:5432 (localhost resolves to IPv6)
Node.js 17+ no longer reorders DNS results to IPv4 first, so 'localhost' hits ::1 while your database only listens on 127.0.0.1.
Ollama Port 11434: connect ECONNREFUSED 127.0.0.1:11434
Diagnose port 11434 listeners with `npx castov port 11434` and configure `OLLAMA_HOST=0.0.0.0:11434` for Docker container access.