A lightweight Flask and HTMX dashboard for monitoring a Linux host from a browser
224
A lightweight Flask and HTMX dashboard for monitoring a Linux host from a browser. It is built for small servers, home lab machines, nodes, and services where you want a quick read on system health without installing a full observability stack.
The dashboard shows CPU, memory, network throughput, storage usage, disk I/O, selected systemd service state, recent service logs, and top resource-heavy processes. It stores short-term metric history locally in SQLite so the graphs remain useful across refreshes while keeping the setup simple and self-contained.

systemctl and journalctlCreate and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Run the app:
python3 app.py
Open:
http://localhost:5000
Direct python3 app.py listens on 0.0.0.0:5000 by default so it can be opened
from another machine on the same network. Set STATS_DASHBOARD_HOST and
STATS_DASHBOARD_PORT if you need a different bind address.
Tracked services are configured in src/config.py:
SERVICES_TO_TRACK = ["xmr"]
Update that list with the systemd unit names you want displayed.
Metric history is stored in a local SQLite database at data/stats.sqlite3.
The app runs a background sampler while the server process is running, keeps one sample every 10 seconds, and deletes samples older than one day.
The SQLite database is ignored by Git so runtime metric data is not committed.
For a production-style run from the project directory:
source .venv/bin/activate
gunicorn --workers 2 --bind 0.0.0.0:5000 app:app
An example unit file is provided at stats-dashboard.service.example.
Copy it to systemd:
sudo cp stats-dashboard.service.example /etc/systemd/system/stats-dashboard.service
Edit these values in /etc/systemd/system/stats-dashboard.service:
User=your-user
Group=your-user
WorkingDirectory=/opt/stats
ExecStart=/opt/stats/.venv/bin/gunicorn --workers 2 --bind 0.0.0.0:5000 app:app
Then enable and start it:
sudo systemctl daemon-reload
sudo systemctl enable --now stats-dashboard
sudo systemctl status stats-dashboard
View logs:
sudo journalctl -u stats-dashboard -f
Content type
Image
Digest
sha256:4c51967fa…
Size
23.5 MB
Last updated
4 months ago
docker pull bencejob/dashy