Skip to content

Repository files navigation

πŸ“ Pi Dashboard

Real-time, responsive system monitoring dashboard for any Linux system β€” with built-in watchdog.

Live WebSocket metrics, service management, auto-restart on crash, HTTPS, token auth. Works on Raspberry Pi, Ubuntu servers, Debian, Arch, Proxmox β€” anything running systemd.

License Python Platform

Features

  • Real-time metrics β€” WebSocket updates every 2 seconds
    • CPU usage (per-core breakdown)
    • CPU temperature (ARM /sys/class/thermal, x86 lm-sensors/hwmon, auto-detected)
    • RAM + Swap
    • Disk usage
    • Network speed (upload/download rate)
    • System uptime
    • Load average
    • Top processes by CPU
  • Service management β€” view, restart, and stop systemd services from the UI
  • Watchdog β€” automatically restarts crashed services (configurable threshold)
  • System health alerts β€” logs warnings for high temp, disk, and memory
  • Responsive UI β€” works on phone, tablet, and desktop (dark theme, PWA-ready)
  • Secure β€” HTTPS (self-signed cert), token-based auth, Tailscale VPN access
  • One-command install β€” ./install.sh sets up everything
  • Cross-platform β€” ARM (Pi, Odroid, NanoPi) and x86 (Intel/AMD servers, VPS)

Quick Start

git clone https://github.com/pitee33/pi-dashboard.git
cd pi-dashboard
chmod +x install.sh
./install.sh

The installer will:

  1. Create a Python venv and install dependencies
  2. Generate a self-signed TLS certificate
  3. Create config.json with a random token
  4. Install systemd services (pi-dashboard + pi-watchdog)
  5. Set up sudoers for service restart permissions
  6. Start everything

After install, open:

https://localhost:8443

Enter the token shown at the end of the install script.

Configuration

Edit config.json (created from config.example.json):

{
    "token": "your-secure-token",
    "host": "0.0.0.0",
    "port": 8443,
    "services": {
        "SSH": "ssh.service",
        "Docker": "docker.service",
        "Nginx": "nginx.service",
        "PostgreSQL": "postgresql.service"
    },
    "watchdog_services": {
        "Nginx": "nginx.service",
        "PostgreSQL": "postgresql.service"
    },
    "watchdog_max_fails": 3,
    "watchdog_check_interval": 30,
    "temp_threshold": 85,
    "disk_threshold": 95,
    "mem_threshold": 95
}
Key Description
token Auth token for dashboard access
host Bind address (0.0.0.0 = all interfaces)
port HTTP/HTTPS port
services Services shown in the dashboard UI
watchdog_services Services the watchdog monitors and auto-restarts
watchdog_max_fails Consecutive failures before restart
watchdog_check_interval Seconds between service checks
temp_threshold Β°C β€” log warning above this
disk_threshold % β€” log warning above this
mem_threshold % β€” log warning above this

After editing, restart:

sudo systemctl restart pi-dashboard pi-watchdog

Temperature Sensor Support

The dashboard auto-detects CPU temperature from multiple sources:

Platform Source Requirements
Raspberry Pi (ARM) /sys/class/thermal/thermal_zone0/temp None (built-in)
x86 (Intel/AMD) psutil.sensors_temperatures() lm-sensors installed (sudo apt install lm-sensors && sudo sensors-detect)
Other ARM (Odroid, NanoPi) /sys/class/hwmon/hwmon*/temp1_input None
VPS / Cloud Often not available Shows "N/A" in the UI

If temperature shows "N/A" on an x86 system, install lm-sensors:

sudo apt install lm-sensors
sudo sensors-detect --auto
# Restart the dashboard:
sudo systemctl restart pi-dashboard

Remote Access

Via Tailscale (recommended)

The dashboard listens on all interfaces, so if Tailscale is running:

tailscale up
# Then access from any device on your tailnet:
https://<tailscale-ip>:8443

Tailscale provides WireGuard encryption, so the self-signed cert is fine β€” the connection is secured by the VPN tunnel.

Via Tailscale Serve (public HTTPS with valid cert)

To expose the dashboard publicly with a Tailscale-issued certificate:

  1. Enable Serve on your tailnet: https://login.tailscale.com/f/serve
  2. Run:
tailscale serve --bg --https 8443 http://127.0.0.1:8443
  1. Access via https://<hostname>.<tailnet>.ts.net

Via reverse proxy (Nginx/Caddy)

For internet-facing deployments, put a reverse proxy with a real TLS cert (Let's Encrypt) in front:

server {
    listen 443 ssl;
    server_name monitor.example.com;
    ssl_certificate /path/to/cert.pem;
    ssl_certificate_key /path/to/key.pem;

    location / {
        proxy_pass https://127.0.0.1:8443;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Never expose the dashboard directly to the internet without a strong token.

Usage

Action Command
View dashboard https://<ip>:8443
Dashboard logs journalctl -u pi-dashboard -f
Watchdog logs journalctl -u pi-watchdog -f
Watchdog log file cat ~/pi-dashboard/watchdog.log
Stop sudo systemctl stop pi-dashboard pi-watchdog
Start sudo systemctl start pi-dashboard pi-watchdog
Restart sudo systemctl restart pi-dashboard
Check status systemctl is-active pi-dashboard pi-watchdog

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Browser (phone/desktop)                β”‚
β”‚  https://<ip>:8443?token=...            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ HTTPS + WebSocket (2s updates)
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Dashboard (FastAPI + Uvicorn)          β”‚
β”‚  β”œβ”€β”€ /api/metrics  β†’ JSON snapshot       β”‚
β”‚  β”œβ”€β”€ /ws          β†’ WebSocket stream    β”‚
β”‚  β”œβ”€β”€ /api/service β†’ restart/stop        β”‚
β”‚  └── /            β†’ HTML dashboard       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚ psutil + systemctl
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Watchdog (background daemon)           β”‚
β”‚  β”œβ”€β”€ Checks services every 30s          β”‚
β”‚  β”œβ”€β”€ Restarts after 3 consecutive fails  β”‚
β”‚  β”œβ”€β”€ Checks dashboard health every 10s  β”‚
β”‚  └── Logs CPU temp / disk / mem warnings β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Requirements

  • Python 3.11+
  • Linux (systemd-based β€” Debian, Ubuntu, Raspberry Pi OS, Arch, Proxmox, etc.)
  • systemd (for service management)
  • Optional: Tailscale for remote access
  • Optional: uv for faster dependency installation
  • Optional: lm-sensors for CPU temperature on x86

Supported Platforms

Platform Status Notes
Raspberry Pi (all models) βœ… Full Temp works out of the box
Ubuntu / Debian servers βœ… Full Install lm-sensors for temp
Arch Linux βœ… Full Install lm-sensors for temp
Proxmox VE βœ… Full Run in a VM or CT with systemd
Odroid / NanoPi (ARM) βœ… Full Temp via hwmon
VPS (DigitalOcean, Hetzner) βœ… Full Temp usually N/A (no sensor)
Non-systemd (Alpine, Void) ⚠️ Partial Service management won't work

Project Structure

pi-dashboard/
β”œβ”€β”€ app.py              # FastAPI dashboard backend + embedded frontend
β”œβ”€β”€ watchdog.py         # Service watchdog daemon
β”œβ”€β”€ install.sh          # One-command installer
β”œβ”€β”€ requirements.txt    # Python dependencies
β”œβ”€β”€ config.example.json # Template config (committed)
β”œβ”€β”€ config.json         # Your config (gitignored)
β”œβ”€β”€ certs/              # TLS certs (gitignored, auto-generated)
β”œβ”€β”€ LICENSE             # MIT
└── README.md

License

MIT β€” free for personal and commercial use.

Contributing

PRs welcome! Fork β†’ branch β†’ PR.

git checkout -b feat/my-feature
# ... changes ...
git commit -m "feat: add my feature"
git push -u origin feat/my-feature
# Then create a PR on GitHub

Author

Built by pitee33.

About

πŸ“ Real-time Linux system monitoring dashboard with watchdog β€” WebSocket metrics, service management, auto-restart, HTTPS, token auth. Works on Raspberry Pi, Ubuntu, Debian, any systemd Linux. One-command install.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages