DEV Community

Cover image for Thank you, Apple, for hijacking port 5000 ๐Ÿ˜ฃ
Chris Bongers
Chris Bongers

Posted on • Originally published at daily-dev-tips.com

Thank you, Apple, for hijacking port 5000 ๐Ÿ˜ฃ

You might have already upgraded to Mac OS Monterey. If not, there might be an unpleasant surprise awaiting you.

For me, it was running the following command.

npm run dev
Enter fullscreen mode Exit fullscreen mode

And getting a message stating port 5000 is already in use...

It took me a good couple of minutes to find out no other application was using this port, and I was baffled at this point.

Surely all I did was upgrade to Monterey...

Re-opening port 5000 on Mac OS Monterey

After doing some research, I did a portscan and noticed "AirPlay Receiver" was using this port.

That didn't sound like anything I made.
Did some more research to find out that the AirPlay receiver is on by default.

To re-enable port 5000, you can simply turn off this checkbox.

AirPlay Receiver in macOS Monterey listening on port 5000

You can find this checkbox in Settings > Sharing > AirPlay Receiver.

This is not a new thing though, Apple has been using port 5000 for AirPlay since 2004.
The only new part is the introduction to having a Mac listening to AirPlay, which, as mentioned, uses port 5000.

If you wish to use AirPlay on your Mac, I'd suggest switching your development to a different port.

Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on Facebook or Twitter

Top comments (0)