See every dev server and port running on your Mac

List all listening ports with lsof or netstat, then see what each one is with Portfox.

After a day of work you can have a Vite server, an API, a database, a Docker container and a forgotten worker on your Mac. This guide shows how to list them all with built-in tools, and where those tools stop helping.

List every listening TCP port with lsof

lsof -nP -iTCP -sTCP:LISTEN

Each row is one listening socket: the command, the PID, the user and the address, such as 127.0.0.1:5173. As your user you see only your own processes. For the whole machine, add sudo.

For a shorter view:

lsof -nP -iTCP -sTCP:LISTEN | awk 'NR > 1 { print $2, $1, $9 }' | sort -n

This prints PID, command and address. A server bound to 127.0.0.1 accepts only local connections. A server bound to * accepts connections from your network too.

List ports with netstat

netstat -anv -p tcp | grep LISTEN

On macOS, netstat takes the protocol with -p tcp. The -v flag adds the PID columns. It works, but the output is wide. The lsof output is easier to read.

Find which project a server belongs to

The port and the command rarely tell you the project. Ask for the working directory of the PID:

lsof -a -p 48213 -d cwd

The NAME column is the folder where the process started. For a Node server it is usually the project root.

Where these commands stop helping

  • Every server is called node. You see the port, not that it is Next.js, Vite or Expo.
  • Docker Desktop publishes all containers through one host process, so many ports share one PID. Use docker ps to see which container owns which port.
  • A server whose parent has exited is easy to miss. Nothing marks it as abandoned.
  • You get a snapshot. To watch changes, you run the command again.
  • Stopping a server is a separate command.

See everything in one list with Portfox

Portfox runs the same kind of lsof query for you, as your user, then adds what the raw output lacks. It refreshes while a window is open.

  • Each listener is named from the process and project files, not the port. It detects more than 70 service types, so a custom port needs no setup.
  • Services are grouped by project. Databases and daemons sit in their own section.
  • Docker shows one row per container, with a badge for the runtime.
  • A server whose launcher exited is marked Orphaned.
  • Servers started by Claude Code or Codex carry a badge with the agent name.
  • Open the project in your editor or the folder in a terminal from the row. Stop it, or restart it with the same command.
  • An ignore list hides services you do not want to see.
  • A global shortcut (default Control Option P) opens the popover from any app, with search.

The dashboard has search by port, framework or path, and shows the process ancestry, memory and the working directory of the selected service.

brew install --cask xergic/tap/portfox

No Homebrew? Download the app from portfox.kandera.cz/download. Portfox needs macOS 15 or later and an Apple Silicon Mac. It is free and open source (MIT).

Next: free a busy port or compare port manager apps.