Reading time: ~12 minutes Audience: Homelabbers wanting visual monitoring dashboards


What Is Grafana?

Overview

Grafana is an open-source analytics and visualization platform. It connects to dozens of data sources — Prometheus, InfluxDB, MySQL, Loki, Elasticsearch — and lets you create beautiful, interactive dashboards. It is the industry standard for monitoring visualization and the perfect complement to Prometheus in your homelab.

Key Benefits

Benefit Detail
Data source agnostic Prometheus, InfluxDB, MySQL, PostgreSQL, Loki, and 50+ more
Community dashboards Thousands of pre-built dashboards on grafana.com
Alerting Built-in alert rules with email, Slack, Telegram, and webhook support
Variables Dynamic dashboards that adapt to different hosts or services
Annotations Mark events (deployments, outages) on graphs
Plugins Extend with panel types, data sources, and apps
Multi-tenant Organizations and role-based access control

Prerequisites

Hardware Requirements

  • Any Docker host (mini PC, server, or VM)
  • 512MB RAM for Grafana (1GB recommended with many dashboards)
  • 1GB storage for configuration and SQLite database

Software Requirements

  • Docker Engine 24.x+ and Docker Compose v2+
  • An existing data source (Prometheus, InfluxDB, or similar)
  • Modern web browser

Knowledge Prerequisites

  • Docker Compose basics
  • Understanding of your data source’s query language (PromQL, InfluxQL, or SQL)
  • Basic JSON/YAML editing

Step 1: Deploy Grafana with Docker Compose

Objective

Run Grafana with persistent storage and proper environment configuration.

Step-by-Step Instructions

  1. Create the project directory:
mkdir -p ~/docker/grafana && cd ~/docker/grafana
mkdir -p data provisioning/datasources provisioning/dashboards
  1. Create docker-compose.yml:
services:
  grafana:
    image: grafana/grafana:latest
    container_name: grafana
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=Change...3!
      - GF_USERS_ALLOW_SIGN_UP=false
      - GF_SERVER_ROOT_URL=http://grafana.local
      - GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource
    volumes:
      - ./data:/var/lib/grafana
      - ./provisioning/datasources:/etc/grafana/provisioning/datasources:ro
      - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
    networks:
      - monitoring

networks:
  monitoring:
    driver: bridge
  1. Create auto-provisioned data source configuration:
cat << 'EOF' > provisioning/datasources/prometheus.yml
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true
    editable: false
EOF
  1. Create dashboard provisioning configuration:
cat << 'EOF' > provisioning/dashboards/dashboards.yml
apiVersion: 1
providers:
  - name: 'default'
    orgId: 1
    folder: ''
    type: file
    disableDeletion: false
    editable: true
    options:
      path: /var/lib/grafana/dashboards
EOF

mkdir -p data/dashboards
  1. Deploy:
docker compose up -d
  1. Access Grafana:
  2. Open http://your-server-ip:3000
  3. Login: admin / Change...3!

Step 2: Import Community Dashboards

Objective

Get instant visualizations without building dashboards from scratch.

Step-by-Step Instructions

  1. Go to Dashboards → Import
  2. Enter a dashboard ID from grafana.com:
Dashboard ID Source What It Shows
Node Exporter Full 1860 Prometheus CPU, memory, disk, network, temperature
Docker Monitoring 893 Prometheus Container stats, resource usage
Proxmox VE 10347 Prometheus VM/LXC status, storage, node health
Pi-hole 10176 Prometheus DNS queries, blocked ads, client stats
AdGuard Home 14284 Prometheus Query log, filtering stats, clients
Homelab 3D 15287 Prometheus 3D visual overview of your lab
  1. Select your Prometheus data source and click Import
  2. The dashboard appears immediately with live data

Step 3: Create a Custom Dashboard

Objective

Build a homelab overview dashboard tailored to your services.

Step-by-Step Instructions

  1. Go to Dashboards → New → New Dashboard
  2. Add a panel:
  3. Title: “CPU Usage”
  4. Query: 100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
  5. Visualization: Gauge
  6. Thresholds: 0–60 green, 60–80 yellow, 80–100 red

  7. Add another panel:

  8. Title: “Memory Usage”
  9. Query: (node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) / node_memory_MemTotal_bytes * 100
  10. Visualization: Time series

  11. Add a third panel:

  12. Title: “Disk Free Space”
  13. Query: node_filesystem_avail_bytes / node_filesystem_size_bytes * 100
  14. Legend: {{mountpoint}}
  15. Visualization: Bar gauge

  16. Save the dashboard as “Homelab Overview”


Step 4: Configure Alerting

Objective

Set up Grafana alerts for critical conditions.

Step-by-Step Instructions

  1. Go to Alerting → Contact points
  2. Create a contact point:
  3. Name: “Email Alerts”
  4. Type: Email
  5. Addresses: [email protected]

  6. Go to Alerting → Alert rules → New alert rule

  7. Create a rule:
  8. Name: “High CPU Usage”
  9. Query: 100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
  10. Condition: IS ABOVE 80
  11. Evaluate every: 1m
  12. For: 5m
  13. Contact point: “Email Alerts”

  14. Test the alert using the “Test” button


Pro Tips

Tip 1: Use Environment Variables for Secrets

Don’t hardcode passwords in docker-compose.yml. Use .env files:

# .env
GF_SECURITY_ADMIN_PASSWORD=supersecret
# docker-compose.yml
    env_file:
      - .env

Tip 2: Connect Grafana to Multiple Data Sources

Add InfluxDB, Loki, MySQL, or PostgreSQL as additional data sources. You can mix data from multiple sources in a single dashboard.

Tip 3: Set Up a Reverse Proxy

Expose Grafana through NGINX Proxy Manager or Traefik for HTTPS and custom domains:

https://grafana.yourdomain.com → http://grafana:3000

Tip 4: Use Dashboard Folders

Organize dashboards by category: - Infrastructure (Node Exporter, Proxmox) - Applications (Nextcloud, Jellyfin, Pi-hole) - Security (Wazuh, CrowdSec) - Networking (UniFi, Omada)


Troubleshooting Common Issues

Problem 1: “Dashboard Shows No Data”

Cause: Data source not configured, or queries are wrong.

Fix: - Verify data source at Configuration → Data sources - Test the query in the Explore tab - Check Prometheus targets at http://prometheus:9090/targets

Problem 2: “Permission Denied on Data Directory”

Cause: Grafana container runs as UID 472 but host directory is owned by root.

Fix:

chown -R 472:472 ~/docker/grafana/data

Problem 3: “Forgot Admin Password”

Fix:

docker exec -it grafana grafana-cli admin reset-admin-password newpassword

Conclusion

Summary

Grafana turns raw metrics into actionable insights. With Docker Compose, you can deploy it in minutes, import community dashboards, and build custom views of your homelab. Combined with Prometheus, it gives you professional-grade observability.

Next Steps

  1. Add Loki for log aggregation and error tracking
  2. Compare with InfluxDB as an alternative data source
  3. Explore Grafana Alerting for advanced notifications

Affiliate Opportunities

  • Beelink Mini S12 Pro: Mini PC for Grafana + Prometheus stack
  • Samsung 990 EVO: NVMe SSD for fast dashboard loading

Internal Linking Strategy

  • introprometheus-monitoring-homelab for metrics collection
  • step-2grafana-dashboard-homelab for advanced dashboard ideas
  • conclusiongrafana-loki-logs for log aggregation

CTA

  • [comment] What’s your favorite Grafana dashboard? Share IDs and screenshots!
  • [newsletter] Subscribe for weekly homelab visualization and dashboard guides.