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
- Create the project directory:
mkdir -p ~/docker/grafana && cd ~/docker/grafana
mkdir -p data provisioning/datasources provisioning/dashboards
- 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
- 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
- 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
- Deploy:
docker compose up -d
- Access Grafana:
- Open
http://your-server-ip:3000 - Login:
admin/Change...3!
Step 2: Import Community Dashboards
Objective
Get instant visualizations without building dashboards from scratch.
Step-by-Step Instructions
- Go to Dashboards → Import
- 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 |
- Select your Prometheus data source and click Import
- 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
- Go to Dashboards → New → New Dashboard
- Add a panel:
- Title: “CPU Usage”
- Query:
100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) - Visualization: Gauge
-
Thresholds: 0–60 green, 60–80 yellow, 80–100 red
-
Add another panel:
- Title: “Memory Usage”
- Query:
(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes) / node_memory_MemTotal_bytes * 100 -
Visualization: Time series
-
Add a third panel:
- Title: “Disk Free Space”
- Query:
node_filesystem_avail_bytes / node_filesystem_size_bytes * 100 - Legend:
{{mountpoint}} -
Visualization: Bar gauge
-
Save the dashboard as “Homelab Overview”
Step 4: Configure Alerting
Objective
Set up Grafana alerts for critical conditions.
Step-by-Step Instructions
- Go to Alerting → Contact points
- Create a contact point:
- Name: “Email Alerts”
- Type: Email
-
Addresses:
[email protected] -
Go to Alerting → Alert rules → New alert rule
- Create a rule:
- Name: “High CPU Usage”
- Query:
100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) - Condition: IS ABOVE 80
- Evaluate every: 1m
- For: 5m
-
Contact point: “Email Alerts”
-
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
- Add Loki for log aggregation and error tracking
- Compare with InfluxDB as an alternative data source
- 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
intro→prometheus-monitoring-homelabfor metrics collectionstep-2→grafana-dashboard-homelabfor advanced dashboard ideasconclusion→grafana-loki-logsfor log aggregation
CTA
- [comment] What’s your favorite Grafana dashboard? Share IDs and screenshots!
- [newsletter] Subscribe for weekly homelab visualization and dashboard guides.