CloudLinux.ro
Monitoring & logging

How to set up Prometheus and Grafana for metrics

Updated 7/20/2026

Prometheus and Grafana are the industry standard for monitoring. Prometheus collects and stores metrics, and Grafana turns them into clear dashboards.

How they connect

  1. An "exporter" (for example node_exporter) exposes the server's metrics.
  2. Prometheus scrapes them periodically and stores them.
  3. Grafana connects to Prometheus and draws them.

1. Start with Docker Compose

services:
  prometheus:
    image: prom/prometheus
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
  grafana:
    image: grafana/grafana
    ports:
      - "3000:3000"
docker compose up -d

2. Configure Prometheus

In prometheus.yml, you add the targets it scrapes metrics from (the servers running node_exporter).

3. Connect Grafana

In Grafana (port 3000), you add Prometheus as a data source, then import a ready-made dashboard (there are many free ones for node_exporter).

Securing it

Put both behind a reverse proxy with HTTPS and authentication, see Nginx as a reverse proxy. For something simpler, see Netdata.

Put this guide into practice on your own VPS

EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.

See pricing

Related tutorials