Guides
The port problems Mac developers hit every week, with the commands that fix them. Each guide works without Port Monitor; the app is mentioned once, at the end.
How to kill the process on a port on Mac
Find which process is listening on a port on macOS with lsof, stop it with kill, and keep a one-liner and a shell function for next time. Works for port 3000, 8080 or any other port.
Fix EADDRINUSE: address already in use
What the EADDRINUSE error means, why port 3000 is still taken after you stopped the server, and three ways to fix it on macOS: stop the process, change the port, or stop leaving servers behind.
Port 5000 or 7000 already in use on Mac? It is AirPlay Receiver
Since macOS Monterey, ControlCenter listens on ports 5000 and 7000 for AirPlay Receiver. Confirm it with lsof, turn it off in System Settings, or move Flask and other apps to another port.