Subscribe

Thank you, Apple, for hijacking port 5000 😣

✍️

How to fix the port 5000 is already in use error in Mac OS Moneterey

3 Dec, 2021 · 2 min read

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

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. I researched 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. 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

Spread the knowledge with fellow developers on Twitter
Tweet this tip
Powered by Webmentions - Learn more

Read next 📖

Streaming desktop sound and microphone on Mac with Streamlabs

25 Nov, 2021 · 2 min read

Streaming desktop sound and microphone on Mac with Streamlabs

5 Things you need to know about screenshots on a Mac

24 Nov, 2021 · 3 min read

5 Things you need to know about screenshots on a Mac

Join 2099 devs and subscribe to my newsletter