Port 5000 — Flask / dev server
TCP registered
What runs on port 5000
Default for Flask, and for the .NET development server. Also AirPlay Receiver on macOS, which is why Flask often fails to bind there.
Security considerations
On macOS, disable AirPlay Receiver in System Settings or pick another port.
Checking whether something is listening
# Linux / macOS — what is bound to the port
sudo lsof -i :5000
sudo ss -lntp | grep :5000
# Windows
netstat -ano | findstr :5000
Get-NetTCPConnection -LocalPort 5000
# is it reachable from outside?
nc -zv example.com 5000
curl -v telnet://example.com:5000
Freeing the port
# find the process, then stop it
sudo lsof -ti :5000 | xargs kill # Linux / macOS
netstat -ano | findstr :5000 # note the PID, then:
taskkill /PID <pid> /F # Windows