📟 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.
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 |
F |
Fit: every host on one screen, no scrolling |
C |
number of host columns: auto, 1 to 6 |
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.
For a wall display, open /?fit=1: the hosts share one screen without scrolling, each panel
shows as many processes as fit, and the text shrinks when it has to. &cols=4 puts four hosts
side by side. Fit is meant for big screens; on a phone it may leave room only for the meters.
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 setHTOP_WEB_AUTH=user:passwordin 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. Runssh HOSTonce (orssh -o StrictHostKeyChecking=accept-new HOST) to trust a new host.--no-verify-hostturns 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
Hostnames (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) withpython33.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
Metadata
Release files for htop-web 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| htop_web-0.1.1.tar.gz | 69.4 kB | With provenance | Details for htop_web-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| htop_web-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for htop_web-0.1.1-py3-none-any.whl |
Total release size: 116.8 kB
Release files / htop_web-0.1.1.tar.gz
| Download URL | htop_web-0.1.1.tar.gz |
|---|---|
| Size | 69.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bfc0e8c749469186238c2eb3af9dc95e73cf25496b025b9c237918b1075e85f
|
|
BLAKE2b-256 checksum How to use checksums |
0ab9b52a32fe122b7bab2d19ecb63a1a687e4c5b09650c1f74e17066bed46f75
|
| 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 logRelease files / htop_web-0.1.1-py3-none-any.whl
| Download URL | htop_web-0.1.1-py3-none-any.whl |
|---|---|
| Size | 47.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac792c7666259b3013e7b1cdff4c2fef30e12c0caa8784b947312a026b0dff8c
|
|
BLAKE2b-256 checksum How to use checksums |
fbe1f97fe12fea03615f7c2a2500fa468ae7fb1d41b12a8674da55f72e9d5435
|
| 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 logSecurity for htop-web 0.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for htop_web-0.1.1.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 logA 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.