How to find what is using a port

Identify the process listening on a port with ss, lsof and netstat, then free the port safely on Linux, macOS and Windows.

Beginner · about 4 min · Linux, Windows, macOS

"Port already in use" stops a server from starting. The fix is two steps: find the process ID holding the port, then decide whether to stop it or move your service to a different port.

What this guide covers

Common pitfalls covered

Questions answered

This is a limited preview. The full walkthrough, command syntax and copy-ready examples are available to signed-in users.

Sign in to read the full page