Skip to main content

📟 htop-web

A web interface of htop: monitor Linux hosts at a glance.

Inspired by gpustat-web: run one command, list your hosts, and every host's CPU cores, memory, load and busiest processes show up in one live page. Nothing is installed on the hosts.

htop-web showing four hosts

Installation

pip install htop-web

Python 3.10+ is required on the machine that runs htop-web. The hosts need Linux and python3 (3.6 or newer), nothing else.

On Debian and Ubuntu, pip refuses to install into the system Python (error: externally-managed-environment, PEP 668). Use pipx there (sudo apt install pipx, then pipx install htop-web) or a virtual environment. For the latest code on GitHub: pip install git+https://github.com/leekyungmoon/htop-web.git.

Usage

htop-web                              # this machine, no SSH
htop-web gpu01 gpu02 alice@db01:2222  # hosts over SSH; ~/.ssh/config aliases work too
htop-web --demo                       # made-up hosts, to try it out

Then open http://127.0.0.1:48110/. python -m htop_web works the same way.

Each host gets one SSH connection. htop-web sends a small collector script (htop_web/collector.py, standard library only) over that connection's stdin and runs it with python3 -u -. The script reads /proc and prints one JSON line per interval; it exits on its own when the connection goes away. When a host fails, its panel says why (host key not trusted, authentication failed, python3 not found, timed out, ...) and htop-web reconnects with backoff.

The page follows htop's default look: per-core CPU bars, the Mem and Swp bars, tasks, load average, uptime, and the process table (PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command). The server sorts and filters, and sends each page only the rows it shows.

Key Does
/ filter by command or user (Esc clears it)
P M T sort by CPU%, MEM%, TIME+ (or click a column header)
I invert the sort order
K show or hide kernel threads
B highlight program names
Z pause updates
+ - more or fewer rows
? help

Click a host's title to fold it. Add ?nodes=gpu01,gpu02 to the address to show some hosts only.

Options

--port PORT          web server port (default: 48110)
--bind ADDR          address to listen on (default: 127.0.0.1)
--interval SEC       seconds between updates (default: 2)
--procs N            process rows per host; the page can change it (default: 15)
--ssh-port PORT      SSH port for hosts that give none (default: ~/.ssh/config, else 22)
--no-verify-host     skip SSH host key checks (not recommended)
--python PATH        Python interpreter on the hosts (default: python3)
--ssl-certfile FILE  serve HTTPS with this certificate ...
--ssl-keyfile FILE   ... and this key
--demo               show made-up hosts instead

Endpoints

  • /: the live page, updated over a websocket
  • /htop.json: the same data as JSON
  • /htop.txt: plain text
  • /htop.ansi: text in htop's colors, for a terminal: curl -s localhost:48110/htop.ansi

They all take ?nodes=a,b, sort (cpu, mem, time, pid, user, res, ...), order (asc/desc), rows, filter and kthreads=1. The text ones also take width.

Security

  • It listens on 127.0.0.1 by default. The page shows every process with its full command line, and command lines can hold secrets (tokens or passwords passed as arguments). To see it from another machine, prefer an SSH tunnel (ssh -L 48110:127.0.0.1:48110 workstation). If you use --bind 0.0.0.0, also set HTOP_WEB_AUTH=user:password in the environment for HTTP Basic auth (it is read from the environment so it never shows up in a process list) and serve HTTPS with --ssl-certfile/--ssl-keyfile.
  • It is read-only. It never kills, renices or changes anything on the hosts.
  • SSH host keys are checked against ~/.ssh/known_hosts. Run ssh HOST once (or ssh -o StrictHostKeyChecking=accept-new HOST) to trust a new host. --no-verify-host turns the check off.
  • Strings from hosts are untrusted. The page inserts them as text, never as HTML. The text endpoints replace control characters, so a process name cannot send escape sequences to your terminal. Websockets from other sites are refused, and while bound to localhost the server refuses other Host names (DNS rebinding).
  • The page loads nothing from the internet (no CDN, no web fonts) and is served with a strict Content-Security-Policy.

Requirements and limits

  • Hosts: Linux (/proc) with python3 3.6+. GPU stats are out of scope; see gpustat-web.
  • SSH settings come from ~/.ssh/config (aliases, User, Port, IdentityFile, ProxyJump, ...) and your ssh-agent, through asyncssh.
  • Cost on a host with about 700 processes: the collector used under 1% of one core at the default 2-second interval, and a snapshot is about 100 KB of JSON (htop-web asks SSH for compression).

Development

git clone https://github.com/leekyungmoon/htop-web.git && cd htop-web
python3 -m venv .venv && .venv/bin/pip install -e '.[test]'
.venv/bin/pytest

The tests check the numbers against fake and real /proc, free and top; start their own SSH server on 127.0.0.1 to run the SSH path end to end, including reconnects; and drive headless Chrome, when one is installed, to check the page on desktop and phone widths (set HTOP_WEB_CHROME to pick the browser). screenshot.png is htop-web --demo taken with python tests/chrome.py http://127.0.0.1:48110/ screenshot.png.

Credits

  • gpustat-web by Jongwook Choi (wookayin): the idea and the shape of the tool, one command, a list of hosts, one live page.
  • htop by Hisham Muhammad and the htop team: the look. No htop code is used; htop-web draws the same meters and table on its own.

License

MIT

Metadata

Release files for htop-web 0.1.0

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

Source distribution (sdist)

Source distribution for htop-web 0.1.0
File Size Uploaded Provenance Actions
htop_web-0.1.0.tar.gz 66.6 kB With provenance Details for htop_web-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for htop-web 0.1.0
File Interpreter ABI Platform Actions
htop_web-0.1.0-py3-none-any.whl Python 3 none any Details for htop_web-0.1.0-py3-none-any.whl

Total release size: 112.0 kB

Release files / htop_web-0.1.0.tar.gz

Download URL htop_web-0.1.0.tar.gz
Size 66.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2071b8f87aa88ef16478bda20e01b088307b79da95dec0b7d23c7f0e13093af4
BLAKE2b-256 checksum
How to use checksums
b4561d50a9b705d495b66631f19dfe5e1b193cadbde2af2876706a86bd171dd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / htop_web-0.1.0-py3-none-any.whl

Download URL htop_web-0.1.0-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3d09dfefd43bf75a2b429539c891060f35598171b0d76871e6b6a58702530cd
BLAKE2b-256 checksum
How to use checksums
5fba2b917dec3efecbc93827273fab344100e9bd03de6592fffd5dcb78fca090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for htop-web 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for htop_web-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

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

0.1.0 This release

2 release files Full 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