8

I need to use the port 5000 with flask but it seems to be already in use by some process.

This is my output when I run sudo lsof -i:5000:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

ControlCe 1897 manu 32u IPv4 0x4ab7b80aa5149af7 0t0 TCP *:commplex-main (LISTEN)

ControlCe 1897 manu 32u IPv4 0x4ab7b80aa5149af7 0t0 TCP *:commplex-main (LISTEN)

Whenever I try to kill the process by running kill -9 $PID it restarts immediately.

I don't know what this process is and why is occupying the port 5000.

Of course I could set flask to use another port but I would really like to know what this process is and why I can't kill it.

1 Answer 1

24

macOS Monterey has a new feature called "AirPlay Receiver" that uses port 5000. You can disable this feature in System Preferences -> Sharing -> AirPlay Receiver. After this, you should find port 5000 free again.

Sign up to request clarification or add additional context in comments.

1 Comment

yup confirmed. RIP to running flask on port 5000 on Monterey.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.