Angular CLI: Port 4200 is already in use. Use '--port' to specify a different port
Another process is already listening on the dev-server port, often an earlier ng serve that was not stopped.
Port 4200 is already in usePort 4200 is already in use. Use '--port' to specify a different portWould you like to use a different port?EADDRINUSE 4200 Meaning
Only one process can use a port. Stop the old dev server, or pick another port with --port (use --port 0 for a random free one). On Linux/macOS find the process with lsof; on Windows use netstat.
Common causes
- Previous
ng servestill running in another terminal or background - Another app (Docker, another dev server) using 4200
- Crashed process left a zombie
- IDE running
ng serveautomatically - Port reserved by Windows (excluded port range)
⚡ Quick fix
- Run on another port:
ng serve --port 4300 - Stop the old process
- Free the port with
lsof/taskkill
Detailed fix by platform
Linux
lsof -i :4200thenkill <PID>- macOS: same commands; or
npx kill-port 4200
Windows
netstat -ano | findstr :4200thentaskkill /PID <pid> /F
Code examples
Find and free the port
lsof -i :4200 # shows the PID
kill -9 <PID>
ng serve --port 4300 # or pick another portHow to diagnose
- Process — What is listening on 4200?
- Terminals — Another ng serve running?
- Alternative — Can you use --port?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Could not find the builder's node package Angular CLI: Could not find the '@angular-devkit/build-angular:browser' builder's node package / Cannot find module '@angular-devkit/build-angular/package.json'
- exceeded maximum budget Angular build: Error: bundle initial exceeded maximum budget. Budget 1.00 MB was not met by 120.00 kB with a total of 1.12 MB
- listen EACCES Error: listen EACCES: permission denied 0.0.0.0:80
Most viewed in Angular
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 15 Oct 2026