What is using Port 5000 on macOS Monterey?
I’ve been fiddling a bit with Wails recently and I gave the unreleased v2 alpha a try.
Out of the box, it binds to Port 5000 and I was surprised to receive a
Definitely not what I expected.
We can use the
lsof utility to figure out what’s holding on to Port 5000. You’ll
see in the screenshot below that I use a shell function called
whomport but under the hood,
lsof -nP i4TCP:5000 | grep LISTEN. Let’s see what the output looks
This doesn’t really help us much since Control Centre could be anything but a bit of searching brings up that this change was introduced in macOS Monterey.
In particular, there’s a new setting under
System Preferences ->
Airplay Receiver. Let’s toggle it off.
Once this is done, you should find Port 5000 instantly freed up. It’s weird that Apple would pick such a commonly used port, especially for developers!