How to Set Up Grafana and Prometheus
Stand up a metrics stack with Prometheus, node_exporter and Grafana to visualize your home server's health.
What you'll build
A monitoring stack that scrapes system metrics and displays them in beautiful dashboards: Prometheus collects data, node_exporter exposes host metrics, and Grafana visualizes everything.
Prerequisites
- Docker and Docker Compose installed.
- A few minutes to import a community dashboard.
Docker Compose file
services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prom_data:/prometheus
ports:
- "9090:9090"
restart: unless-stopped
node-exporter:
image: prom/node-exporter:latest
container_name: node-exporter
pid: host
volumes:
- /:/host:ro,rslave
command:
- '--path.rootfs=/host'
restart: unless-stopped
grafana:
image: grafana/grafana-oss:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
restart: unless-stopped
volumes:
prom_data:
grafana_data:Prometheus configuration
Create prometheus.yml next to your Compose file:
global:
scrape_interval: 15s
scrape_configs:
- job_name: node
static_configs:
- targets: ["node-exporter:9100"]Then start everything:
docker compose up -dWire up Grafana
- Open
http://your-server-ip:3000and log in (defaultadmin/admin, then change it). - Add a data source → Prometheus → URL
http://prometheus:9090. - Import dashboard ID 1860 (Node Exporter Full) from the Grafana dashboard library.
- Select your Prometheus data source and load it.
You now have CPU, memory, disk, network and temperature graphs updating live.
Add container metrics (optional)
Add cAdvisor to the stack and a scrape job for it to see per-container CPU and memory. Import a cAdvisor dashboard to visualize which containers use the most resources.
Secure it
Keep Grafana behind a reverse proxy with HTTPS and a strong admin password. Prometheus and node_exporter should stay on your internal network only — never expose them to the internet.
Verwandte Artikel
Home Server Monitoring: A Complete Guide
Monitor your homelab with Uptime Kuma, Prometheus and Grafana — track uptime, temperatures, disk health and get alerts before things break.
How to Install Uptime Kuma
Monitor every homelab service and get instant alerts when something goes down, plus public status pages — all self-hosted.
How to Install Home Assistant
Run Home Assistant on your server for private, local-first smart home automation — installation methods, first integrations and automations.