See what's listening on your local ports, which project it belongs to, and stop it in one click.
A small, native macOS menu bar app for developers.
No more lsof -i :3000 followed by kill -9 <PID>.
Find
- Lists every process listening on a local TCP port, with PID, uptime and memory use.
- Shows the project behind each port by finding the nearest
.git,package.json,Package.swift,pyproject.toml,Pipfile,Cargo.toml,go.mod,Gemfile,composer.json,pom.xml,build.gradle(.kts)ormix.exsabove the process's working directory. - Groups a process's ports on one row. Ports published by Docker show the container name and image (the row is read-only; copy
docker stop <name>). - Optionally lists UDP sockets.
- Filters by port, command or project name.
Act
- Kills with
SIGTERMfirst. If the process is still running after 3 seconds, offers Force Kill (SIGKILL). - Click a port badge to copy
localhost:<port>. Hover a row to open it in your browser. - Click a row for details: command, user, start time, project folder, Reveal in Finder, Copy Path, Open in Terminal, and copyable
kill <PID>/lsofsnippets. ⌘Fsearches,Escclears,⌘Rrefreshes. The gear menu has Launch at Login, an optional port count in the menu bar, a system-process toggle, a terminal picker, and an in-app language switcher.
Stay out of the way
- Runs
docker psonly when Docker is actually publishing a port, and only against a local Docker socket (never a remoteDOCKER_HOST). - Polls only while the popover is open. The optional menu bar count adds one light
lsofevery 10 seconds while it is closed. - No analytics or third-party dependencies. The only network request is the optional "Check for Updates…" (one request to
api.github.com), and only when you choose it. PortKill never checks on its own. - Follows system light and dark appearance.
- Supports 7 languages: English, 简体中文, 日本語, Deutsch, Español, Français, and Türkçe.
The popover also shows your chip, memory and live CPU load. On M1–M4 Macs it adds a rough GPU compute estimate.
Get the latest PortKill-<version>.dmg from Releases, open it and drag PortKill to Applications.
PortKill is not notarized by Apple, so macOS blocks it the first time you open it. To allow it:
- Try to open PortKill once, then dismiss the warning.
- Open System Settings → Privacy & Security, scroll down, and click Open Anyway next to PortKill.
- Confirm with your password.
Or remove the quarantine flag from a terminal:
xattr -dr com.apple.quarantine /Applications/PortKill.appIf you'd rather not trust a prebuilt binary, build it from source below. That build runs without a warning on your own Mac.
Needs macOS 14+ and Swift 6 (Xcode or the Command Line Tools).
git clone https://github.com/fr3on/portkill.git
cd portkill
./scripts/build-app.sh # builds build/PortKill.app (universal: Apple silicon + Intel)
open build/PortKill.appPortKill has no Dock icon. Look for it in the menu bar.
PortKill only signals processes it is sure about:
- Read-only rows. PID 0 and 1, PortKill itself, processes owned by other users or root, and known macOS system services can't be killed. They show a lock.
- Two stages. A graceful
SIGTERMalways comes beforeSIGKILL, and Force Kill is a separate click. - No recycled PIDs. Before signalling, PortKill checks that the PID still belongs to the process you saw. If it doesn't, nothing is sent.
- One process at a time. There is no "kill all".
System processes and other users' processes are hidden by default.
PortKill runs lsof, ps and, when Docker is publishing ports, docker ps on your Mac and sends signals to your own processes. It collects nothing and makes no network requests, except the one to api.github.com when you choose "Check for Updates…". Docker is only queried through a local socket. It isn't sandboxed because it has to inspect other processes. It uses the Hardened Runtime with no extra entitlements. See SECURITY.md to report a problem.
swift build # compile
swift test # run the tests
./scripts/build-app.sh # package build/PortKill.app
./scripts/make-dmg.sh # wrap it in dist/PortKill-<version>.dmgSources/
PortKillCore/ Scanning, lsof parsing, project detection, kill rules. No UI imports.
PortKill/ SwiftUI app: menu bar item, views, design system.
Tests/ Swift Testing suites. lsof samples live in Fixtures/.
scripts/ build-app, make-dmg, release, make-icon
docs/images/ README screenshots
Contributions are welcome. Read CONTRIBUTING.md first, and follow the Code of Conduct.
