Port Killer: The Minimalist's Swiss Army Knife for Processes and Ports
Ever had a stubborn process hogging a port, and you find yourself juggling between lsof, netstat, and kill -9 just to free it up? Or maybe you've lost track of all the SSH tunnels and port forwards you've spun up for local development. We've all been there, and the context switching adds up.
Enter Port Killer. It's a single, focused tool designed to solve these exact problems with minimal fuss. No bloat, no complicated flagsājust a straightforward way to kill processes and clean up network tunnels.
What It Does
Port Killer is a command-line utility that does two things exceptionally well. First, it can kill any process by its PID or, more usefully, by the port number it's occupying. Second, it provides a clear overview and management for all your active port forwards and tunnels, letting you list them and shut them down easily. It consolidates what usually takes multiple commands and a bit of parsing into one simple interface.
Why It's Cool
The beauty of Port Killer is in its simplicity and direct approach. Instead of stitching together shell commands, you get a dedicated tool that speaks the language of ports and tunnels directly.
- Port-Centric Killing: The classic
kill -9 $(lsof -ti:3000)incantation is powerful, but you have to remember it. With Port Killer, it's justport-killer kill 3000. It's a small quality-of-life win that saves brain space. - Tunnel Management: It shines in development environments where you might have multiple SSH tunnels (
-L,-R,-D) or other forwards running for databases, microservices, or APIs. Getting a clean list and being able to terminate them from one place is a huge help for staying organized. - Minimalist by Design: It doesn't try to be a system monitor or a full network diagnostics suite. It has a clear scope and executes it well, which makes it reliable and easy to understand.
How to Try It
Getting started is straightforward. The project is on GitHub, and you can clone it and run it directly with Go.
# Clone the repository
git clone https://github.com/productdevbook/port-killer.git
cd port-killer
# Run it directly with Go
go run main.go
# Or, build and install it
go build -o port-killer main.go
sudo mv port-killer /usr/local/bin/ # Or another directory in your PATH
Once installed, you can start exploring:
port-killer listto see active tunnels.port-killer kill <port-number>to free up a port.- Check the
README.mdin the repo for the full command set and examples.
Final Thoughts
Port Killer is one of those tools that feels obvious once you see it. It doesn't solve a new problem, but it solves a common one more elegantly. For developers who frequently work with local servers, microservices architectures, or remote development setups, it's a utility that can easily earn a permanent spot in your toolkit. It's the kind of focused, no-nonsense tool that makes your development flow just a little bit smoother.
Follow us for more cool projects: @githubprojects
Repository: https://github.com/productdevbook/port-killer