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

  1. 1On macOS: Go to System Settings -> AirDrop & AirPlay -> Turn off "AirPlay Receiver".
  2. 2Or kill the process running on port 5000 using the command below.
  3. 3Or configure Flask to use port 5001 ("flask run --port=5001").
Dedicated Companion Tool

Troubleshoot using the Port 5000 Process Killer

Use our client-side utility with zero server upload for instant debugging.

Open Tool

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.