Portmole blog
Practical guides for developers who run localhost servers on a Mac.
- How to fix “EADDRINUSE: address already in use” on MacEADDRINUSE means another process is already listening on that port. Find it with lsof, stop it with kill, or run your server on a different port. Step by step for macOS.
- How to find what is using a port on MacUse lsof to see which process is listening on a port on macOS, list every listening port, and understand the output. Includes netstat and the menu bar alternative.
- How to kill the process on a port on MacFree a port on macOS: find the PID with lsof, stop it with kill, force it with kill -9, or use npx kill-port. Plus a one-click menu bar way.
- Port 5000 already in use on macOS? It's AirPlay ReceiverSince macOS Monterey, AirPlay Receiver listens on ports 5000 and 7000, which breaks Flask and other servers. Turn it off in System Settings or use another port.
- Default dev server ports: 3000, 5173, 8000, 8080 and moreThe default localhost port for Next.js, Vite, Create React App, Angular, Django, Flask, Rails, Astro and more, plus common database ports.
- How to run a dev server on a different portThe exact flag or environment variable to change the port for Vite, Next.js, Create React App, Angular, Astro, Django, Flask, Rails and uvicorn.