Port & Network Error
Fix "Error: listen EADDRINUSE: address already in use :::5000" (Flask / AirPlay)
Developer guide and instant terminal command to diagnose and solve this error.
Terminal Output
$Error: listen EADDRINUSE: address already in use :::5000
Why Does This Error Happen?
On macOS Monterey and newer, AirPlay Receiver listens on port 5000 by default, colliding with Flask and Express servers.
Instant Terminal One-Liner Fixes
Linux (Bash / Zsh)
kill -9 $(lsof -t -i:5000)
macOS (Terminal / iTerm2)
kill -9 $(lsof -t -i:5000)
Windows (PowerShell Run as Administrator)
Stop-Process -Id (Get-NetTCPConnection -LocalPort 5000).OwningProcess -Force
Comprehensive Step-by-Step Resolution
- 1On macOS: Go to System Settings -> AirDrop & AirPlay -> Turn off "AirPlay Receiver".
- 2Or kill the process running on port 5000 using the command below.
- 3Or configure Flask to use port 5001 ("flask run --port=5001").
Dedicated Companion Tool
Open ToolTroubleshoot using the Port 5000 Process Killer
Use our client-side utility with zero server upload for instant debugging.
Frequently Asked Questions
Frequently Asked Questions
Frequently Asked Questions
Everything you need to know regarding specifications, syntax, and security best practices.
On macOS Monterey and newer, AirPlay Receiver listens on port 5000 by default, colliding with Flask and Express servers.
Related Developer Errors
Port & Network
Fix "Error: listen EADDRINUSE: address already in use :::3000"
Port & Network
Fix "Error: listen EADDRINUSE: address already in use :::8080"
Port & Network
Fix "Port 5173 is in use, trying another one... (Vite Dev Server)"
Port & Network
Fix "Error: listen EADDRINUSE: address already in use :::8000" (Django / PHP)