Skip to Content

Self-Host Grafana: Beautiful Dashboards for Your Homelab in 15 Minutes

You can't fix what you can't see. Grafana gives you beautiful, real-time dashboards for every metric in your homelab — Docker containers, system resources, network traffic, application performance — all in one place. In this guide, you'll have Grafana running behind a reverse proxy with SSL in under 15 minutes.

Why Self-Host Grafana?

Cloud monitoring solutions charge per metric, per host, per dashboard. For a homelab with 10-20 services, costs spiral fast. Self-hosted Grafana gives you:

  • Unlimited dashboards — no per-panel pricing, no metric limits
  • Total privacy — your performance data never leaves your infrastructure
  • Any data source — Prometheus, InfluxDB, Loki, MySQL, PostgreSQL, Elasticsearch, and 150+ more
  • Alerting without lock-in — route alerts to Telegram, Discord, email, or webhooks

Prerequisites

  • A VPS or dedicated server with Docker and Docker Compose installed
  • Minimum 1GB RAM (2GB+ recommended if running Prometheus on the same host)
  • A domain pointed to your server (for SSL via Traefik or Caddy)
  • 5 minutes of your time

Step 1: Create the Docker Compose File

Create a directory for Grafana and drop in a docker-compose.yml:

mkdir -p ~/grafana && cd ~/grafana
cat > docker-compose.yml << 'EOF'
version: "3.8"

services:
  grafana:
    image: grafana/grafana-oss:latest
    container_name: grafana
    restart: unless-stopped
    user: "1000:1000"
    ports:
      - "3000:3000"
    environment:
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=your-secure-password-here
      - GF_USERS_ALLOW_SIGN_UP=false
      - GF_ANALYTICS_REPORTING_ENABLED=false
      - GF_ANALYTICS_CHECK_FOR_UPDATES=false
    volumes:
      - grafana_data:/var/lib/grafana
      - ./provisioning:/etc/grafana/provisioning:ro
    networks:
      - monitoring

  # Optional: Prometheus for metrics collection
  prometheus:
    image: prom/prometheus:latest
    container_name: prometheus
    restart: unless-stopped
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--storage.tsdb.retention.time=15d'
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus_data:/prometheus
    networks:
      - monitoring

  # Optional: Node Exporter for system metrics
  node-exporter:
    image: prom/node-exporter:latest
    container_name: node-exporter
    restart: unless-stopped
    pid: host
    volumes:
      - /:/host:ro,rslave
    command:
      - '--path.rootfs=/host'
    networks:
      - monitoring

volumes:
  grafana_data:
  prometheus_data:

networks:
  monitoring:
    driver: bridge
EOF

Step 2: Configure Prometheus (Optional but Recommended)

If you're running Prometheus alongside Grafana, create a minimal prometheus.yml:

cat > prometheus.yml << 'EOF'
global:
  scrape_interval: 15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'node-exporter'
    static_configs:
      - targets: ['node-exporter:9100']

  - job_name: 'grafana'
    static_configs:
      - targets: ['grafana:3000']
EOF

Step 3: Launch the Stack

docker compose up -d

Verify everything is running:

docker compose ps
# grafana        running   0.0.0.0:3000->3000/tcp
# prometheus     running   9090/tcp
# node-exporter  running   9100/tcp

Step 4: Access Grafana and Add a Data Source

  1. Open http://your-server-ip:3000 in your browser
  2. Log in with admin / the password you set in the compose file
  3. Go to Connections → Data Sources → Add data source
  4. Select Prometheus
  5. Set URL to http://prometheus:9090 (container-to-container networking)
  6. Click Save & Test — you should see a green checkmark

Step 5: Import Your First Dashboard

Don't build from scratch — import a pre-built dashboard:

  1. Go to Dashboards → Import
  2. Enter dashboard ID 1860 (Node Exporter Full — the gold standard for system metrics)
  3. Select your Prometheus data source
  4. Click Import

You now have a full system dashboard showing CPU, memory, disk, network, and temperature metrics.

Step 6: Add SSL with Traefik (Production Setup)

If you're exposing Grafana publicly, put it behind Traefik for automatic SSL:

  grafana:
    # ... existing config ...
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.grafana.rule=Host(`grafana.yourdomain.com`)"
      - "traefik.http.routers.grafana.entrypoints=websecure"
      - "traefik.http.routers.grafana.tls.certresolver=letsencrypt"
      - "traefik.http.services.grafana.loadbalancer.server.port=3000"
    networks:
      - monitoring
      - traefik-proxy  # join your existing Traefik network

Verification Checklist

  • ✅ Grafana loads at your domain with HTTPS
  • ✅ Prometheus data source shows "Data source is working"
  • ✅ Node Exporter dashboard displays real metrics
  • ✅ docker compose logs grafana shows no errors

Next Steps

  • Add cAdvisor — container-level metrics for Docker
  • Set up alerting — CPU > 90% for 5 minutes? Get a Telegram notification
  • Add Loki — log aggregation alongside your metrics
  • Monitor Uptime Kuma — combine health checks with performance metrics

Related Guides

Questions? Drop a comment below or reach out on our contact page.

Self-Host MinIO: Your Own S3-Compatible Object Storage in 15 Minutes
Build a private, high-performance object storage server with MinIO — the open-source alternative to Amazon S3.