How do you see which app has a network port open on a Mac?
Last reviewed: 19 November 2026.
Run lsof -iTCP -sTCP:LISTEN -P -n in Terminal to list every TCP port your own processes are listening on, with the process name and PID. Add sudo in front to include processes owned by root and other users. In Activity Monitor, double-click a process and open Open Files and Ports to see the same for one app.
How do you list listening ports in Terminal?
- Open Terminal. Open Terminal from Applications > Utilities.
- List listening TCP ports. Run
lsof -iTCP -sTCP:LISTEN -P -n.-Pshows port numbers instead of service names and-nskips DNS lookups, which makes it faster. - Include system processes. Run the same command with
sudoin front and enter your administrator password. Without it, lsof shows only processes that run as you. - Find who uses one port. Run
lsof -i :5000 -P -n, replacing 5000 with the port, to see which process holds it.
How do you read the lsof output?
Each line has the command name (shortened to nine characters), PID, user, file descriptor, IPv4 or IPv6, and the address in the NAME column.
| NAME column | Meaning |
|---|---|
*:7000 (LISTEN) | Listening on port 7000 on every network interface. |
127.0.0.1:8080 (LISTEN) | Listening on this Mac only; other devices cannot connect. |
192.168.1.5:51644->203.0.113.7:443 (ESTABLISHED) | An open connection from this Mac to a server's port 443 (HTTPS). |
A common surprise: on macOS, ControlCenter listens on ports 5000 and 7000 when AirPlay Receiver is on. You can turn it off in System Settings > General > AirDrop & Handoff > AirPlay Receiver if you need those ports for development.
How do you see ports in Activity Monitor?
Select a process and double-click it (or click the Info button in the toolbar). In the window that opens, click Open Files and Ports. Network entries show the protocol, the address and the port. The Ports column on the CPU tab is different: it counts Mach ports, macOS's internal messaging channels, not network ports.
Is there a single command that shows the owning process for every connection?
netstat -anv -p tcp | grep LISTEN
On macOS 26, netstat -anv includes a process:pid column, and it lists processes of every user without sudo. Its columns are wider and harder to read than lsof's, so lsof is usually the better first choice.
How can Thrum help?
Thrum's Network tab shows upload and download speed for each process, and an optional second menu bar item shows the Mac's total upload and download speed.
Thrum is $4.99 once with a 14-day free trial and no account. It requires macOS 26 Tahoe on Apple silicon or Intel.
Questions
Is a listening port a security risk?
A listening port accepts connections, so it matters which app owns it and whether it listens on every interface or only on 127.0.0.1. The macOS firewall in System Settings > Network > Firewall can block incoming connections.
How do I free a port held by an app?
Quit the app that owns it. If it is a background process you started, such as a development server, stop it in the Terminal window where it runs with Control-C.
Sources
- lsof(8) and netstat(1) man pages: run man lsof and man netstat in Terminal
- Activity Monitor User Guide: View information about processes