Diary

[Mac] Port 5000 Unavailable in Monterey

1 Mins read

Developing with port 5000 but getting an error?

Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5000 -> 0.0.0.0:0: listen tcp 0.0.0.0:5000: bind: address already in use

lsof -i:5000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ControlCe 85856 user10 26u IPv4 0x4ff853972c8bedd 0t0 TCP *:commplex-main (LISTEN)
ControlCe 85856 user10 27u IPv6 0x4ff85430b21e97d 0t0 TCP *:commplex-main (LISTEN)

What’s this thing?

Turns out Monterey added an AirPlay feature that’s hijacking the port.

System Preference > Sharing > AirPlay Receiver > Uncheck it

That’ll free it up, but thinking ahead, other people will hit the same issue. Better to just change the dev side to use a different port.