macOS: Address already in use — Port 5000 is in use by ControlCenter (AirPlay Receiver)
Since macOS Monterey the AirPlay Receiver listens on ports 5000 and 7000, colliding with dev servers like Flask or Docker registries.
Port 5000 is in use by another program. Either identify and stop that program, or start the server with a different portAddress already in use Port 5000 ControlCenterOSError: [Errno 48] Address already in use 5000Port 7000 is in use by ControlCenterAirPlay Receiver port 5000 in use Meaning
Turn off System Settings → General → AirDrop & Handoff → AirPlay Receiver, or run your service on another port. lsof -i :5000 shows ControlCenter as the owner. Common with Flask (5000) and Rails/others on 7000.
Common causes
- AirPlay Receiver enabled (default)
- Flask default port 5000
- Docker registry/other services on 5000
- Another app on 7000
- Multiple dev servers
⚡ Quick fix
- Disable AirPlay Receiver in System Settings
- Use another port:
flask run -p 5001 - Check:
lsof -nP -iTCP:5000 -sTCP:LISTEN
Detailed fix by platform
macOS
lsof -nP -iTCP:5000 -sTCP:LISTEN
How to diagnose
- Owner — ControlCenter?
- Setting — AirPlay Receiver on?
- Alternative — Different 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
- bind() failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
- Homebrew Cask: It seems there is already an App at Homebrew: Error: It seems there is already an App at '/Applications/Chrome.app'
- Homebrew: No available formula with the name Homebrew: Error: No available formula with the name "x". Did you mean ...?
Most viewed in macOS
- is damaged and can’t be opened macOS: “App” is damaged and can’t be opened. You should move it to the Trash.
- Operation not permitted (macOS privacy) macOS: Operation not permitted — Terminal/app lacks Full Disk Access (TCC privacy protection)
- zsh: command not found: brew macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon)
Other ways to find it
Where this error sits
Origin: Platform & cloud. 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 5 Nov 2026