CloudLinux.ro
Applications

How to install Prometheus + Grafana on a Cloud VPS

Updated 7/18/2026

Prometheus and Grafana together form the standard open-source monitoring stack: metrics collection, alerting and beautiful dashboards.

Monitoring on your own server gives you alerts and history without host limits or per-monitor monthly fees.

One-click install on cloudlinux.ro

The fastest way: Prometheus + Grafana installs automatically at the first boot of a new server.

  1. Create a Cloud VPS from the control panel.
  2. In the configuration step, pick Prometheus + Grafana from the app catalog.
  3. Start the server. The install runs in the background for a few minutes and its status shows on the server page.
  4. Access details and generated passwords are saved on the server in /root/app-credentials.txt. The app will be available on port 3000.

Manual install on any Ubuntu server

If you prefer doing it yourself, below is the exact script our automatic install runs. Execute it as root on a fresh Ubuntu server (24.04 recommended). It stops at the first error, and when it finishes you will find the access details in /root/app-credentials.txt.

export DEBIAN_FRONTEND=noninteractive
curl -fsSL https://get.docker.com | sh
GRAFANA_PASS=$(openssl rand -base64 24 | tr -dc 'A-Za-z0-9' | cut -c1-16)
docker network create monitoring
docker volume create prometheus_data
docker volume create grafana_data
mkdir -p /opt/monitoring/provisioning/datasources
cat > /opt/monitoring/prometheus.yml <<EOF
global:
  scrape_interval: 15s
scrape_configs:
  - job_name: prometheus
    static_configs:
      - targets: ['localhost:9090']
  - job_name: node
    static_configs:
      - targets: ['node-exporter:9100']
EOF
cat > /opt/monitoring/provisioning/datasources/prometheus.yml <<EOF
apiVersion: 1
datasources:
  - name: Prometheus
    type: prometheus
    access: proxy
    url: http://prometheus:9090
    isDefault: true
EOF
docker run -d --name node-exporter --restart=always --network monitoring \
  --pid=host -v /:/host:ro,rslave \
  quay.io/prometheus/node-exporter:latest --path.rootfs=/host
docker run -d --name prometheus --restart=always --network monitoring \
  -v /opt/monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro \
  -v prometheus_data:/prometheus prom/prometheus:latest
docker run -d --name grafana --restart=always --network monitoring -p 3000:3000 \
  -e GF_SECURITY_ADMIN_PASSWORD="$GRAFANA_PASS" \
  -v grafana_data:/var/lib/grafana \
  -v /opt/monitoring/provisioning/datasources:/etc/grafana/provisioning/datasources:ro \
  grafana/grafana:latest
IP=$(hostname -I | awk '{print $1}')
printf 'Grafana: http://%s:3000\nUtilizator: admin\nParola: %s\nSursa de date Prometheus este preconfigurata (interna, neexpusa public).\n' "$IP" "$GRAFANA_PASS" > /root/app-credentials.txt

You can also save this script as a recipe in your account and reuse it on any new server.

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