Set Up a Complete Monitoring Stack with Grafana and Prometheus
Learn how to deploy Grafana, Prometheus, and Node Exporter using Docker Compose for comprehensive infrastructure monitoring with beautiful dashboards.

Monitoring is essential for any self-hosted setup. In this tutorial, we'll build a complete monitoring stack using Grafana and Prometheus that gives you real-time visibility into your infrastructure.
Architecture Overview
Docker Compose Setup
services:
prometheus:
image: prom/prometheus:v2.51.0
volumes:
ports:
command:
grafana:
image: grafana/grafana:10.4.0
ports:
volumes:
environment:
depends_on:
node-exporter:
image: prom/node-exporter:v1.7.0
ports:
volumes:
command:
volumes:
prometheus_data:
grafana_data:
Prometheus Configuration
Create prometheus.yml:
global:
scrape_interval: 15s
scrape_configs:
static_configs:
static_configs:
Setting Up Grafana Dashboards
http://localhost:3000http://prometheus:9090)Adding Alerts
Configure Alertmanager for Slack, email, or webhook notifications when metrics cross thresholds. This ensures you're notified before issues become critical.
Conclusion
This monitoring stack gives you enterprise-grade observability for your homelab. Extend it by adding cAdvisor for container metrics, Blackbox Exporter for endpoint monitoring, and Loki for log aggregation.