Why always something is running at port 5000 on my mac
Asked Answered
C

3

29

I am a developer and I need to run my ruby app at port 5000, but always I try to run my app I get:

Address already in use - bind(2) (Errno::EADDRINUSE)

I know that the easiest way for solving this; is just change the port that I am using for running my app, but I want to know what happens, because every time I execute lsof -i tcp:5000 and kill the process, automatically a new process starts running in that port.

I am using a macbook pro with MacOs Monterrey with version 12.0.1

Cabinda answered 24/5, 2022 at 20:51 Comment(0)
A
84

This happens because Control Center on Monterey listening to port 5000 and port 7000.

For fixing this you need to turn off System Settings > General > AirDrop & Handoff > AirPlay Receiver.

More info

Athirst answered 24/5, 2022 at 20:53 Comment(2)
I'm unsure exactly how long that would have taken me without this answer. Thank you, kind person.Linhliniment
resolved the error in docker "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. ERRO[0000] error waiting for container: context canceled"Nickey
T
1

Goto System Settings > General > AirPlay Receiver > Disable AirPlay Receiver option.

Tamaru answered 4/11, 2023 at 0:59 Comment(0)
O
-1

change the port number to 5001 and try

Oak answered 17/6 at 8:20 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewAmorist

© 2022 - 2024 — McMap. All rights reserved.