A powerful CLI and web dashboard to list, monitor, and manage running ports on your system.
- CLI Interface - Quick terminal access to port information
- Web Dashboard - Beautiful, real-time web UI with filtering and sorting
- Cross-Platform - Works on Linux, macOS, and Windows
- Process Information - See which process is using each port
- Filtering - Filter by port, protocol, state, or process name
- Kill Processes - Terminate processes directly from the dashboard
- Demo Mode - Safe mode for public deployments with sample data
pnpm add -g port-scanner-clipnpm add port-scanner-cligit clone https://github.com/codellyson/port-scanner.git
cd port-scanner
pnpm install
pnpm run build
pnpm link --globalports listports list --protocol tcp
ports list -P udpports list --port 3000
ports list -p 80ports list --state LISTEN
ports list -s ESTABLISHEDports list --process node
ports list -n nginxports list --jsonports list --protocol tcp --state LISTEN --jsonStart the web dashboard:
ports webWith custom port and host:
ports web --port 8080 --host 0.0.0.0- Real-time port listing
- Auto-refresh (every 5 seconds, toggleable)
- Sortable columns (click headers)
- Search across all fields
- Filter by protocol and state
- Copy port to clipboard
- Kill processes directly
- Statistics overview
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Web server port |
HOST |
localhost |
Web server host |
DEMO_MODE |
false |
Enable demo mode with sample data |
ENABLE_KILL_ENDPOINT |
true |
Enable/disable process kill endpoint |
RATE_LIMIT_WINDOW_MS |
60000 |
Rate limit window in milliseconds |
RATE_LIMIT_MAX_REQUESTS |
100 |
Max requests per window |
CORS_ORIGINS |
* |
Allowed CORS origins (comma-separated) |
For public deployments, enable demo mode to show sample data instead of real system information:
DEMO_MODE=true ports webOr use the pnpm script:
pnpm run web:demodocker build -t port-scanner .# Normal mode (scans container's ports)
docker run -p 3000:3000 port-scanner
# Demo mode (recommended for public deployments)
docker run -p 3000:3000 -e DEMO_MODE=true port-scanner
# With host network (scans host's ports - Linux only)
docker run --net=host -e PORT=3000 port-scannerWhen deploying publicly:
- Always enable demo mode (
DEMO_MODE=true) to prevent exposing real system information - Disable the kill endpoint (
ENABLE_KILL_ENDPOINT=false) in production - Use rate limiting - enabled by default
- Configure CORS appropriately for your use case
- Run behind a reverse proxy (nginx, Caddy) with HTTPS
# Install dependencies
pnpm install
# Run in development mode
pnpm run dev
# Build for production
pnpm run build
# Start production server
pnpm start
# Start web dashboard
pnpm run web
# Start in demo mode
pnpm run web:demo- Node.js 18+
- Linux:
ssornetstatcommand - macOS:
lsofornetstatcommand - Windows:
netstatcommand
MIT License
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request