Find and kill processes occupying ports. Instantly resolve port conflicts.
You're ready to start your dev server, but... Error: Port 3000 is already in use.
Then you need to:
- Find the PID (
lsof -i :3000ornetstat) - Copy the PID
- Kill it (
kill -9 <PID>) - Restart your server
Portpeek does this in one command.
pip install portpeekOr install from source:
git clone https://github.com/Ak-dude/portpeek.git
cd portpeek
pip install -e .# Check if a port is in use
portpeek 3000
# Kill whatever's on port 3000
portpeek 3000 --kill
# Force kill (SIGKILL instead of SIGTERM)
portpeek 3000 --kill --force
# List all listening ports
portpeek --list$ lsof -i :3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 1234 user 20u IPv4 12345 0t0 TCP *:3000 (LISTEN)
$ kill -9 1234$ portpeek 3000 --kill
✗ Port 3000 is in use
PID: 1234
Process: node
Killing 1234... Done!
✓ Port 3000 is now freeportpeek # Interactive port browser
portpeek 3000 # Check if port 3000 is in use
portpeek 3000 --kill # Kill process on port 3000
portpeek --list # List all listening ports
portpeek 8080 -f # Force kill port 8080
portpeek --version # Show version
- ⚡ Fast - One command instead of three
- 🎯 Focused - Does one thing, does it well
- 🔒 Safe - Uses SIGTERM by default (graceful)
- 📦 No deps - Pure Python, no external requirements
- 🖥️ Cross-platform - Works on Linux, macOS (and Windows with WSL)
- Python 3.8+
lsof(Linux/macOS) ornetstat/ss(Linux fallback)
MIT License - see LICENSE for details.
Made with ❤️ by Ak-dude