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.

LicensePythonPlatform

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
}
KeyDescription
tokenAuth token for dashboard access
hostBind address (0.0.0.0 = all interfaces)
portHTTP/HTTPS port
servicesServices shown in the dashboard UI
watchdog_servicesServices the watchdog monitors and auto-restarts
watchdog_max_failsConsecutive failures before restart
watchdog_check_intervalSeconds 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:

PlatformSourceRequirements
Raspberry Pi (ARM)/sys/class/thermal/thermal_zone0/tempNone (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_inputNone
VPS / CloudOften not availableShows "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{listen443ssl;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

ActionCommand
View dashboardhttps://<ip>:8443
Dashboard logsjournalctl -u pi-dashboard -f
Watchdog logsjournalctl -u pi-watchdog -f
Watchdog log filecat ~/pi-dashboard/watchdog.log
Stopsudo systemctl stop pi-dashboard pi-watchdog
Startsudo systemctl start pi-dashboard pi-watchdog
Restartsudo systemctl restart pi-dashboard
Check statussystemctl 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

PlatformStatusNotes
Raspberry Pi (all models)βœ… FullTemp works out of the box
Ubuntu / Debian serversβœ… FullInstall lm-sensors for temp
Arch Linuxβœ… FullInstall lm-sensors for temp
Proxmox VEβœ… FullRun in a VM or CT with systemd
Odroid / NanoPi (ARM)βœ… FullTemp via hwmon
VPS (DigitalOcean, Hetzner)βœ… FullTemp usually N/A (no sensor)
Non-systemd (Alpine, Void)⚠️ PartialService 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