Find which port is whose — and which are still free — without touching a terminal.
Servers collect services — databases, admin panels, reverse proxies, automation scripts — and sooner or later nobody remembers whether port 8080 belongs to the wiki or the API, or which port is still free for the next deployment. PortViewer is built for exactly that moment.
It reads native TCP/UDP endpoints (IPv4/IPv6) on Windows and Linux and attributes every listener to the owning process, Windows service, Docker container, Nginx site or IIS application pool — searchable, filterable and exportable in a clean GUI, no netstat/ss/lsof required. It doubles as a fast evidence tool for developers, desktop admins and support engineers: locate what holds a port in seconds, copy diagnostics, and (desktop edition only) terminate the offending process safely after identity re-verification.
The desktop app has no accounts, no backend services and no telemetry — basic scanning stays local, while public software metadata is automatically enriched online and can be disabled. Scan results live in process memory; view preferences are saved locally. An optional bundled web-service adds a read-only WebGUI plus an explicitly-enabled, LAN-only, token-authenticated port-query API with CLI and MCP support: ask a host "is this port taken?" — anonymous calls get a yes/no answer, token holders get full attribution, and agents can request a currently bindable free port.
| Light | Dark |
|---|---|
![]() |
![]() |
- Full endpoint visibility — TCP connections, TCP listeners and UDP endpoints for IPv4/IPv6, with state, PID, process name, path and creation time.
- Workload attribution — map ports to Docker containers (container name, image, Compose project/service), Nginx
server_name+ config source, IIS sites and app pools, Windows services, NSSM, npm/Node.js entrypoints and Python scripts/modules, using native parent chains and SCM. - Linux workload context — identify Docker containers, systemd units, Node.js/Python projects and known system programs, with names, purpose/description, execution mode, project/config/mount paths and evidence sources. Missing permissions and descriptions are reported explicitly.
- Search that understands ports — plain text plus field syntax:
port:,pid:,process:,service:,owner:,workload:,container:,project:,mode:,ip:,state:,protocol:. - Persistent full views — all scan rows without pagination, virtual scrolling, all/any filters and color rules, multi-column sorting, draggable headers, saved search/group/column preferences, and three density levels.
- Live + safe refresh — single-shot and auto refresh (pauses while the window is hidden), keeps the last good snapshot on scan failure.
- Evidence-grade export — CSV (UTF-8 BOM, RFC 4180, formula-injection protection) and JSON of the full filtered/sorted view via the native save dialog.
- Guarded process termination — desktop only; the backend re-verifies PID + creation time and refuses system-critical or ambiguous targets. See Safety by design.
- LAN port-query API, CLI and MCP — ask a deployed host whether specific ports are in use; anonymous calls get a yes/no, bearer tokens get full listener details, and agents can request a random free bindable port above
30001.
Grab the latest artifacts from Releases:
| Artifact | What it is |
|---|---|
PortViewer-windows-x64-setup.exe |
Desktop app, online NSIS installer (downloads WebView2 if missing) |
PortViewer-windows-x64-offline.msi |
Desktop app with bundled WebView2 Runtime, fully offline |
PortViewer-WebGUI-windows-x64.zip |
Read-only WebGUI service for Windows x64 |
PortViewer-WebGUI-linux-x64.tar.gz |
Read-only WebGUI service for Linux x64, with startup script and systemd templates |
Requirements: Windows 10/11 x64 with the Microsoft Edge WebView2 Runtime (preinstalled on supported systems). The WebGUI additionally runs on Linux. Every release ships a SHA-256 manifest.
Prerequisites: Node.js 22 + npm, Rust stable 1.95+ (x86_64-pc-windows-msvc), Visual Studio 2022 Build Tools with "Desktop development with C++" and the Windows SDK.
git clone https://github.com/Diselorya/PortViewer.git
cd PortViewer
npm ci
# Desktop app (dev mode)
npm run tauri dev
# Portable release exe
npm run build:desktop
# Installers (online NSIS / offline MSI)
npm run build:installer
npm run build:installer:offlineRelease maintainers can run npm run release -- --check followed by npm run release to publish a CI-verified version, synchronize configured remotes and refresh local installers with version/SHA-256 verification. See the release guide for remote mappings and recovery.
Service names, sources, automatic public metadata, optional AI and the compact view controls are explained in the service knowledge guide.
WebGUI (Windows/Linux, read-only):
npm ci
npm run build
cargo run --release --manifest-path web-service/Cargo.toml -- --assets dist
# open http://127.0.0.1:17890The same frontend supports a reverse-proxy subpath such as /portviewer/ when the proxy strips the prefix and the entry URL has a trailing slash. On Linux, an unprivileged account can enumerate ports but often cannot attribute other users' listeners. Full attribution usually requires root and readable local /proc and Docker socket metadata; the default limited-account unit and an optional root drop-in are documented in the deployment guide.
LAN port API (API-only, opt-in):
$env:PORTVIEWER_API_TOKEN = '<at least 32 bytes of random token>'
cargo run --release --manifest-path web-service/Cargo.toml -- serve --api-only --listen 0.0.0.0:17890Quality gates: npm test, npm run typecheck, npm run build, plus cargo fmt --check / cargo test / cargo clippy -D warnings in src-tauri and web-service — the same set CI enforces on every push. Never build releases with a bare cargo build --release; production builds must enable the Tauri custom-protocol feature (the build scripts fail closed otherwise).
- Termination is treated as irreversible. The UI only unlocks it after reading a non-empty process creation time; the Rust backend then re-reads the process identity and rejects PID reuse, PID 0/4, PortViewer itself, Windows-critical processes and insufficient-permission cases. PortViewer never bypasses the Windows permission model.
- The web surface is read-only by default. The WebGUI listens on loopback only; non-loopback mode exposes just
/healthand the port API, requires a strong token, rejects cross-site origins and non-localHostheaders, and never exposes termination or elevation. Sensitive deployments should use an isolated management network or an HTTPS reverse proxy. - Frontend/backend build binding. Four verification layers (embedded
distviacustom-protocol, config integrity, source +distSHA-256 manifests re-checked bybuild.rs, and a runtime identity handshake) ensure the shipped backend only loads this repository's frontend. - Data stays local. Scans live in process memory only; exports get anti-formula-injection escaping and truncation markers.
| Document | Language |
|---|---|
| 中文 README(详细版) | 简体中文 |
| LAN port API, CLI & MCP guide | 中文 |
| OpenAPI spec | — |
| WebGUI deployment | 中文 |
| Windows installation & dependencies | 中文 |
No packet capture, protocol parsing, traffic statistics, firewall management, malware verdicts, scanning of arbitrary public hosts, history/trending, alerts, tray/auto-start, accounts, cloud sync or team features. LAN capabilities only query hosts where PortViewer's service is deliberately deployed — no subnet discovery. PortViewer reports system facts; it does not replace TCPView, Wireshark, EDR or Task Manager. Linux attribution depends on local metadata and permissions; dedicated Nginx virtual-host parsing remains a Windows feature.
Issues and pull requests are welcome — see CONTRIBUTING.md and CODE_OF_CONDUCT.md. Bug reports use the issue template.
Found a security issue? Please follow the responsible-disclosure policy in SECURITY.md — do not open a public issue.
MIT © PortViewer contributors. Desktop UI built with Vue 3, PrimeVue and Tauri 2; web service in Rust.

