pf

June 23, 2026 Β· View on GitHub

A modern CLI tool to identify and manage processes using network ports.
Built with Go for speed, clarity, and zero runtime dependencies.

Go Version License Platform

🎬 Preview

pf in action


✨ Features

  • πŸ” Smart Process Detection β€” Instantly find what's using your ports
  • πŸ“ Project Awareness β€” Shows which project/directory owns the process
  • 🐳 Docker Support β€” Identifies containerized processes
  • 🎯 Quick Actions β€” Kill processes interactively or directly
  • πŸ“Š Port Overview β€” Check all common development ports
  • πŸš€ Fast & Lightweight β€” Single binary, no runtime dependencies

πŸ“¦ Installation

βœ… Using Homebrew (macOS/Linux)

brew tap doganarif/tap
brew install pf

πŸͺŸ Windows

Download the latest .exe file from the Releases Page:

  • For 64-bit Windows: pf-windows-amd64.exe
  • For ARM64 Windows: pf-windows-arm64.exe

Rename it to pf.exe and add to your PATH.

🧰 Using Go

go install github.com/doganarif/portfinder/cmd/portfinder@latest

This installs the binary as pf.

πŸ“ Download Binary

Grab the latest release from the Releases Page.


πŸ§ͺ Usage

πŸ” Check a specific port

pf 3000

Output:

πŸ” Port 3000 is in use by:

Process     node
PID         48291
Command     npm run dev
Project     ~/projects/my-react-app
Started     3 hours ago

Kill this process? [y/n]

πŸ“Š Check common development ports

pf check

Example output:

πŸ“Š Common Development Ports:

Frontend:
  ❌ 3000: node (my-react-app)
  βœ… 3001: free
  βœ… 4200: free
  ❌ 5173: vite (my-vue-app)
  βœ… 8080: free

Backend:
  βœ… 4000: free
  ❌ 5000: python (flask-api)
  βœ… 8000: free
  βœ… 9000: free

Databases:
  βœ… 3306: free
  ❌ 5432: postgres (docker)
  ❌ 6379: redis
  βœ… 27017: free

πŸ“‹ List all ports in use

pf list

πŸ’€ Kill a process

pf kill 3000

βš™οΈ Common Ports Reference

PortCommon Use
3000React, Node.js, Rails
3001Create React App fallback
4200Angular
5173Vite
5000Flask, Python servers
8000Django
8080General web development
3306MySQL/MariaDB
5432PostgreSQL
6379Redis
27017MongoDB
9200Elasticsearch
9090Prometheus
3100Grafana Loki
8983Solr

πŸ› οΈ Configuration

You can override the default list of common ports by creating a config file at:

~/.config/portfinder/config.json

Example:

{
  "common_ports": [3000, 3001, 5173, 5000, 8000]
}

πŸ§‘β€πŸ’» Development

Prerequisites

  • Go 1.21+
  • Make (optional)

Building from source

# Clone the repository
git clone https://github.com/doganarif/portfinder.git
cd portfinder

# Build
make build

# Run tests
make test

# Install locally
make install

πŸ“ Project Structure

pf/
β”œβ”€β”€ cmd/
β”‚   └── portfinder/     # CLI entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ config/         # Configuration management
β”‚   β”œβ”€β”€ process/        # Process detection logic
β”‚   └── ui/             # Terminal UI components
β”œβ”€β”€ Makefile            # Build automation
└── README.md           # This file

🀝 Contributing

Contributions are welcome! Please open an issue or pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file.


πŸ™Œ Acknowledgments

  • Inspired by the frustration of "port already in use" errors
  • Built using Cobra for CLI
  • Terminal UI powered by Bubbletea

πŸ§‘ Author

Arif Doğan

If you find this tool useful, please consider giving it a ⭐️ on GitHub!


Built by Arif Dogan - production AI and backend engineer.

I help SaaS teams ship production AI features, fast backends, and reliable developer tools.

Work with me | Book a 30-min intro