What is port 5000 used for?
The default for Flask and other dev servers. On recent macOS versions, AirPlay Receiver also listens on 5000.
Should port 5000 be open?
Local or internal use. It’s meant for development machines or local networks, not the public internet. If an app on a Mac says the port is in use, turn off AirPlay Receiver in System Settings or use another port.
See what is listening on port 5000
# Linux
sudo ss -tlnp | grep ':5000 '
# macOS
sudo lsof -nP -i TCP:5000 -sTCP:LISTEN
# Windows (PowerShell)
Get-NetTCPConnection -LocalPort 5000 -State Listen
Open or block port 5000 in a firewall
# Ubuntu / Debian (ufw)
sudo ufw allow 5000/tcp
sudo ufw deny 5000/tcp
# Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "Port 5000" -Direction Inbound -Protocol TCP -LocalPort 5000 -Action Allow
On cloud servers, also open the port in the provider’s security group or network firewall. At home, a service behind a router needs a port-forwarding rule to the device’s local IP.
Test it from outside
A port can be open on the server but blocked upstream. The Port Checker connects from the internet, so it shows what the world sees. From your own machine, use nc -vz example.com 5000 (macOS/Linux) or Test-NetConnection example.com -Port 5000 (Windows).