Grafana — Service Documentation

Dashboards, data sources, and visualization practices.

What Is Grafana + How I Use It

Grafana is a visualization platform for time-series metrics and logs. I use it to monitor my homelab (Proxmox, LXC containers, Pi-hole, Jellyfin) with dashboards and alerts.

Prometheus is my primary data source; Grafana connects to it on the LAN and serves dashboards internally without public exposure.

Install — LXC (Debian)

Debian 12 LXC with a reserved/static IP recommended. Grafana listens on port 3000 by default and runs as a systemd service inside the container.

Prerequisites

  • Proxmox LXC: Debian 12, unprivileged, 1 vCPU / 1–2 GB RAM, 5–10 GB disk.
  • Networking: DHCP reservation or static lease from Proxmox; expose only on LAN.
  • Optional hardening: reverse proxy/Tailscale for access; avoid Internet exposure.

Add Repository + Install

sudo apt update && sudo apt install -y curl gnupg2 ca-certificates
      curl -fsSL https://packages.grafana.com/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/grafana.gpg
      echo "deb [signed-by=/usr/share/keyrings/grafana.gpg] https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
      sudo apt update && sudo apt install -y grafana
      sudo systemctl enable --now grafana-server

Verify Service

systemctl status grafana-server --no-pager
      ss -lntp | grep 3000 || true
      curl -I http://127.0.0.1:3000 || true
      journalctl -u grafana-server -n 50 --no-pager

Access: http://<container-ip>:3000 (default admin/admin → you will be prompted to set a new password on first login).

Configuration Basics

Main paths:

  • Config: /etc/grafana/grafana.ini
  • Data (SQLite DB, dashboards): /var/lib/grafana
  • Logs: /var/log/grafana

Common tweaks in /etc/grafana/grafana.ini[server]: set http_port, domain, and if reverse proxying, root_url (e.g. https://grafana.example.com/), then restart.

sudo systemctl restart grafana-server

Optional: Reverse Proxy (Nginx)

# On your reverse proxy host
      server {
          listen 80;
          server_name grafana.example.com;
          location / {
        proxy_pass http://<grafana-lxc-ip>:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
          }
      }

Then set root_url = https://grafana.example.com/ in Grafana to match.

Persistence & Backups

  • Back up /etc/grafana and /var/lib/grafana regularly (includes grafana.db).
  • In Proxmox, optionally bind-mount a host path to /var/lib/grafana for durable storage.
  • Before upgrades, snapshot the LXC or copy the data directory.

Add Data Sources

In Grafana UI → Connections → Data sources → Add new:

  • Prometheus: URL http://<prometheus-ip>:9090 → Save & test.
  • Others (optional): Loki (logs), InfluxDB, MySQL, etc.
  • Dashboards: Import via Grafana.com ID or JSON export files.

Upgrades & Maintenance

sudo apt update && sudo apt install -y grafana
      sudo systemctl restart grafana-server

Major version jumps can include breaking changes—review release notes before upgrading.

Uninstall (if needed)

sudo systemctl stop grafana-server
      sudo apt purge -y grafana
      sudo rm -f /etc/apt/sources.list.d/grafana.list /usr/share/keyrings/grafana.gpg
      # Optional: remove data/config (this deletes dashboards/users!)
      sudo rm -rf /etc/grafana /var/lib/grafana