HTTPfy

Port 5000 (Flask / Docker Registry / AirPlay)

Default port of the Flask development server and of the Docker Registry. Since macOS Monterey, the AirPlay Receiver also listens on 5000 and 7000, which is why Flask apps on a Mac suddenly get 403 errors. Synology DSM also uses 5000.

Registered (user) port, 1024-49151 TCP Development tools Expose only to trusted sources

What port 5000 is used for

Default port of the Flask development server and of the Docker Registry. Since macOS Monterey, the AirPlay Receiver also listens on 5000 and 7000, which is why Flask apps on a Mac suddenly get 403 errors. Synology DSM also uses 5000.

Security: should port 5000 be open?

Expose only to trusted sources. The Flask dev server (especially with debug=True and its Werkzeug console) must never be exposed: the debugger allows code execution. A registry on 5000 without auth lets anyone pull or push images.

IANA assignment

IANA lists port 5000 as unassigned. No service is registered for it.

Check what is listening on port 5000

Linux: is anything listening on TCP 5000?
sudo ss -tlnp 'sport = :5000'
Linux / macOS: which process owns the port
sudo lsof -nP -i :5000
Older Linux / BSD (net-tools)
sudo netstat -tlnp | grep ':5000 '
Windows (Command Prompt)
netstat -ano | findstr :5000
Windows (PowerShell)
Get-NetTCPConnection -LocalPort 5000 -State Listen | Select LocalAddress,OwningProcess

Test it from outside

From another machine
nc -vz -w 5 HOST 5000
From Windows
Test-NetConnection HOST -Port 5000

Allow only trusted sources on port 5000 in the firewall

Replace 203.0.113.10 with the address or network you trust. With ufw, make sure the default incoming policy is deny.

ufw (one trusted source)
sudo ufw allow from 203.0.113.10 to any port 5000 proto tcp
iptables
sudo iptables -A INPUT -p tcp --dport 5000 -s 203.0.113.10 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 5000 -j DROP
nftables
sudo nft add rule inet filter input ip saddr 203.0.113.10 tcp dport 5000 accept
sudo nft add rule inet filter input tcp dport 5000 drop
Windows Firewall
New-NetFirewallRule -DisplayName 'TCP 5000 trusted' -Direction Inbound -Protocol TCP -LocalPort 5000 -RemoteAddress 203.0.113.10 -Action Allow

Related ports

All port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.