← Back to Blog

How to See Which App Is Using a Port on Mac

macOS won't tell you which app owns a busy port. Here's how to find out with lsof and a dedicated GUI tool.

You start a server, and it fails with “address already in use.” You need to know which app is using that port on your Mac, but macOS gives you nothing. No pop-up, no indicator in Finder, no entry in System Settings. The answer lives at the Unix kernel layer, and you have to ask for it directly.

Why macOS Doesn’t Tell You

Finder and System Settings have no concept of open ports. They expose files, volumes, and preferences, but network socket state is handled by the kernel. To see which process has a port bound, you need Terminal or a tool that queries the kernel directly.

Find the Process with lsof

lsof (list open files) treats network sockets as files, so it can tell you exactly which process owns a port.

Single-port lookup:

lsof -i :8080

Sample output:

COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ruby     1234  aaron   12u  IPv6 0x...            0t0  TCP *:http-alt (LISTEN)

What each column means:

  • COMMAND: the process name
  • PID: the process ID you can use with kill
  • USER: which user account owns the process
  • FD: file descriptor type (12u means file descriptor 12, opened for read/write)
  • TYPE: IPv4 or IPv6
  • NODE: TCP or UDP
  • NAME: the address and port, plus the socket state in parentheses

See all listening ports at once:

sudo lsof -iTCP -sTCP:LISTEN -n -P

This lists every process with an open TCP listener. The -n flag skips DNS lookups so it’s faster. The -P flag shows port numbers instead of service names. Useful when you’re not sure which port is conflicting.

Alternative with netstat:

netstat -an | grep LISTEN

This shows listening sockets, but on macOS netstat does not include the process name or PID in its output. You’ll see the address and port, but you’ll still need lsof to tie it back to a specific process.

Before you kill anything: confirm the process name in lsof output before running kill -9 <PID>. A typo or wrong PID can terminate a database, a background sync service, or something else entirely. Data loss is possible if a process is writing to disk when it gets killed.

Some Ports Belong to macOS Itself

Not every occupied port is yours to reclaim. A few are reserved by the OS:

  • Port 5000 and 7000: used by AirPlay Receiver on macOS Monterey and later. The process is ControlCenter. If AirPlay Receiver is enabled in System Settings, these ports are always bound.
  • Port 5353: mDNS (Bonjour), used for local network service discovery. The process is typically mDNSResponder.

If lsof shows a system process like ControlCenter or mDNSResponder, leave it alone. If port 5000 is blocking your Flask app, disable AirPlay Receiver in System Settings under General > AirDrop & Handoff.

See Every Port at a Glance with Portie

Portie shows a live view of every open port on your Mac, refreshed automatically every 3 seconds. You can toggle between a flat port list sorted by port number and a grouped-by-app view where each application is a collapsible section showing all ports it holds.

No flags to remember. No Terminal window to keep open. Local port monitoring is free. The $8.99 one-time unlock adds the ability to kill a process directly from the list, plus remote port scanning with service identification if you need to inspect other machines on your network.

When to Use Each Approach

lsof is the right tool for a quick one-off lookup. You know the port, you run the command, you see the process, you’re done.

Portie is useful when you’re running multiple services at once and want a persistent view. Instead of re-running lsof every time you start or stop something, you get a live display that updates on its own. The grouped view in particular makes it easy to see which ports belong to a single app versus which ones are spread across different processes.

Try Portie Free

See every open port on your Mac, which app owns it, and kill processes from the list.

Download Free