Skip to main content

Portmap

A real-time dashboard for the listening ports on your machine. Portmap shows what is listening on every port, identifies the project or service behind each one, and lets you terminate a process with a single click.

Portmap dashboard


Overview

"What is running on port 3000 — and why won't it die?" Every developer hits this eventually. On a busy machine, dozens of dev servers, watchers, and forgotten daemons compete for ports, and tracking down which one belongs to which project — then stopping it safely — usually means a chain of lsof, grep, and kill.

Portmap turns that into a glance. It keeps a live, categorized view of every listening port — which project or service owns it, and whether it is safe to kill — and lets you stop a process with one click, right from the browser.

Under the hood it is a lightweight, local, single-user tool: a FastAPI backend plus a single static HTML page. No database, no build step.


Why Portmap?

lsof, ss, and netstat already list open ports — but they stop at the PID. Portmap is built for the step after that: understanding and acting on what you find.

  • Answers "whose port is this?", not just "what PID?" — each port is traced to a git project and framework, instead of leaving you to map PIDs by hand.
  • Live, not a one-off snapshot. The view updates as servers start and stop, so you don't re-run a command and re-read its output every time.
  • Kill from the same place. No copying a PID into a separate kill command — and system-owned processes are guarded against accidental termination.
  • Less noise. IDE helpers and Chromium/Electron subprocesses are filtered out, so you see services rather than internals.

If you just need a one-off list, ss -ltnp is perfect. Portmap is for when you are juggling many services and want to watch and manage them continuously.


Quick Start

Linux with Python 3.11+:

pip install portmap-dev
portmap

Then open http://127.0.0.1:7474. See Installation and Usage for details.


Features

  • Live updates — ports are rescanned every 0.5s and pushed to the browser over a websocket; the UI updates only when something actually changes.
  • Smart identification — each listening port is categorized as:
    • Project — traced to a git repository, with framework detection (Django, Node.js, Go, Rust, Ruby, Java, PHP, …).
    • Infrastructure — known daemons like Redis, PostgreSQL, MySQL, MongoDB, Nginx, Docker.
    • System — kernel/system sockets with no owning PID.
    • Unknown — an honest fallback showing the raw process name.
  • Noise filtering — IDE helpers (VS Code, Cursor, JetBrains, …) and Chromium/Electron internal processes are skipped.
  • One-click kill — SIGTERM first, escalating to SIGKILL if the process doesn't exit within the grace period.
  • Safety guard — processes owned by privileged/system accounts (UID < 1000) are protected and cannot be killed from the UI.
  • Non-blocking scanner — scanning runs in a background thread, so the event loop stays responsive for websocket updates and kill requests.

Installation

Requirements: Linux, Python 3.11+.

Install from PyPI:

pip install portmap-dev

This installs the portmap command. To keep it isolated from your other tools, pipx is recommended:

pipx install portmap-dev

From source

git clone https://github.com/abdallah-9a/Portmap.git
cd Portmap
python3 -m venv .venv && source .venv/bin/activate
pip install -e .

Usage

Start the dashboard:

portmap

By default it binds to 127.0.0.1:7474 — a deliberately uncommon port, so it does not collide with whatever dev server you are trying to inspect. Override the host or port with flags:

portmap --port 9000        # run on a different port
portmap --host 0.0.0.0     # bind to all interfaces (see the security note below)
portmap --version          # print the installed version

You can also run it as a module:

python -m portmap

Then open the UI in your browser (default):

http://127.0.0.1:7474

Use the search box to filter by port or name, and click Kill next to a process to terminate it.

Note: psutil may need elevated privileges to see the owning PID of every socket. If some ports show up as "System" or with missing details, try running with sudo (be aware this also lets the kill endpoint act with root privileges).


Screenshots & Demo

The hero screenshot sits at the top of this README — the first thing a visitor sees. This section is for the moving picture:

Portmap in action

A short capture of the live updates and one-click kill in action.


Limitations

  • Linux only. Portmap relies on Linux semantics: /proc-based working directory lookup for git detection, real UID ownership checks, and the UID < 1000 system-account protection. It is untested on macOS/Windows.
  • No authentication. Anyone who can reach the server can kill processes. Bind it to 127.0.0.1 (the default) and do not expose it to a network.
  • Single user / local use. It is designed as a personal dev tool, not a multi-tenant service.
  • Privilege-dependent visibility. Without elevated privileges, some sockets' PIDs and metadata may be hidden by the OS.
  • Git-root heuristic. Project detection assumes a process's working directory lives inside its repository; processes started elsewhere may fall back to "Unknown".

Contributing

Issues and pull requests are welcome. For anything beyond a small fix, please open an issue first to discuss the approach. For local development, install in editable mode (pip install -e .) and run fastapi dev src/portmap/main.py to get auto-reload.


License

Released under the MIT License.

Metadata

Release files for portmap-dev 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for portmap-dev 1.1.1
File Size Uploaded Provenance Actions
portmap_dev-1.1.1.tar.gz 14.9 kB Without provenance Details for portmap_dev-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for portmap-dev 1.1.1
File Interpreter ABI Platform Actions
portmap_dev-1.1.1-py3-none-any.whl Python 3 none any Details for portmap_dev-1.1.1-py3-none-any.whl

Total release size: 31.7 kB

Release files / portmap_dev-1.1.1.tar.gz

Download URL portmap_dev-1.1.1.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c27c523a05e00f9e39ed6d490dd7bfb5da1ffd32ec18d1d79a1596900d2c60a
BLAKE2b-256 checksum
How to use checksums
7d25f174e8f8624e0c0d62fd8c492180bef0c95c9c540620fd02348dd353143e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / portmap_dev-1.1.1-py3-none-any.whl

Download URL portmap_dev-1.1.1-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82649bdb3452b6b6983ef134974e5a2846f7f250c395405b0f923bbb292e8016
BLAKE2b-256 checksum
How to use checksums
91f99442fba7bbe1315e3790e28a4058d256c07103d5831eb2d8373744c5fa85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for portmap-dev 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page