Skip to content

Linux VPS & VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04

Cloud Infrastructure Expert
Linux VPS & VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04

 

 

Install and Configure Grafana and Prometheus on Windows VPS

This guide provides a detailed setup for installing and configuring Grafana and Prometheus on a Windows VPS running Ubuntu 24.04, Debian 12, CentOS 9 Stream, or AlmaLinux 9. It includes Node Exporter for system metrics, Nginx as a reverse proxy for Grafana, and secure configuration practices. For reliable VPS hosting, explore Netcloud24.

Author: Łukasz Bodziony | Website: Windows VPS

Prerequisites

  • Windows VPS with root or sudo access.
  • Minimum 2GB RAM, 10GB disk space, and 2 CPU cores.
  • SSH client (e.g., PuTTY or ssh) for remote access.
  • Basic Linux command-line knowledge.
  • Ports required: 9090 (Prometheus), 9100 (Node Exporter), 3000 (Grafana), 80/443 (Nginx).
  • Optional: Domain name for Grafana with SSL (recommended).

Why Netcloud24? Netcloud24 offers high-performance VPS solutions with Intel Xeon Gold CPUs, NVMe SSDs, and 24/7 support, perfect for hosting Grafana and Prometheus. Visit Netcloud24 for scalable plans starting at €92.24/month.

Distribution Comparison

Distribution Package Manager Firewall Tool
Ubuntu 24.04 apt ufw
Debian 12 apt ufw
CentOS 9 Stream dnf firewalld
AlmaLinux 9 dnf firewalld

Part 1: Install and Configure Prometheus

1. Common Steps for All Distributions

  1. Update system:For Ubuntu/Debian:
    sudo apt update && sudo apt upgrade -y

    For CentOS/AlmaLinux:

    sudo dnf update -y
  2. Create Prometheus user and directories:
    sudo useradd --no-create-home --shell /bin/false prometheus
    sudo mkdir /etc/prometheus /var/lib/prometheus
    sudo chown prometheus:prometheus /var/lib/prometheus
  3. Download Prometheus (use latest version, e.g., 2.55.0):For x86_64 systems:
    cd /tmp
    wget https://github.com/prometheus/prometheus/releases/download/v2.55.0/prometheus-2.55.0.linux-amd64.tar.gz
    tar xvf prometheus-2.55.0.linux-amd64.tar.gz
    cd prometheus-2.55.0.linux-amd64

    For ARM64, replace with prometheus-2.55.0.linux-arm64.tar.gz.

  4. Move binaries and configs:
    sudo mv prometheus promtool /usr/local/bin/
    sudo mv consoles console_libraries prometheus.yml /etc/prometheus/
    sudo chown -R prometheus:prometheus /etc/prometheus
    sudo chmod -R 775 /etc/prometheus
  5. Configure Prometheus:Edit /etc/prometheus/prometheus.yml:
    global:
      scrape_interval: 15s
    scrape_configs:
      - job_name: 'prometheus'
        static_configs:
          - targets: ['localhost:9090']
      - job_name: 'node_exporter'
        static_configs:
          - targets: ['localhost:9100']
  6. Create systemd service:
    sudo nano /etc/systemd/system/prometheus.service

    Add:

    [Unit]
    Description=Prometheus Monitoring
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    User=prometheus
    Group=prometheus
    Type=simple
    ExecStart=/usr/local/bin/prometheus \
        --config.file=/etc/prometheus/prometheus.yml \
        --storage.tsdb.path=/var/lib/prometheus/ \
        --web.console.templates=/etc/prometheus/consoles \
        --web.console.libraries=/etc/prometheus/console_libraries
    
    [Install]
    WantedBy=multi-user.target
  7. Start and enable Prometheus:
    sudo systemctl daemon-reload
    sudo systemctl start prometheus
    sudo systemctl enable prometheus
  8. Verify Prometheus:Access http://your-vps-ip:9090 in a browser (temporary firewall rule required).

Part 2: Install and Configure Node Exporter

1. Common Steps for All Distributions

  1. Create Node Exporter user:
    sudo useradd --no-create-home --shell /bin/false node_exporter
  2. Download Node Exporter (e.g., version 1.8.2):For x86_64 systems:
    cd /tmp
    wget https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz
    tar xvf node_exporter-1.8.2.linux-amd64.tar.gz
    cd node_exporter-1.8.2.linux-amd64

    For ARM64, replace with node_exporter-1.8.2.linux-arm64.tar.gz.

  3. Move binary:
    sudo mv node_exporter /usr/local/bin/
    sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
  4. Create systemd service:
    sudo nano /etc/systemd/system/node_exporter.service

    Add:

    [Unit]
    Description=Node Exporter
    Wants=network-online.target
    After=network-online.target
    
    [Service]
    User=node_exporter
    Group=node_exporter
    Type=simple
    ExecStart=/usr/local/bin/node_exporter
    
    [Install]
    WantedBy=multi-user.target
  5. Start and enable Node Exporter:
    sudo systemctl daemon-reload
    sudo systemctl start node_exporter
    sudo systemctl enable node_exporter
  6. Verify Node Exporter:Access http://your-vps-ip:9100/metrics to confirm metrics are available.

Part 3: Install and Configure Grafana

1. Ubuntu 24.04

  1. Add Grafana repository:
    sudo apt-get install -y apt-transport-https software-properties-common
    wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
    echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
    sudo apt update
  2. Install Grafana:
    sudo apt install grafana -y
  3. Start and enable Grafana:
    sudo systemctl start grafana-server
    sudo systemctl enable grafana-server
  4. Verify Grafana:Access http://your-vps-ip:3000 (default login: admin/admin).

2. Debian 12

Follow Ubuntu 24.04 steps for Grafana installation and configuration.

3. CentOS 9 Stream / AlmaLinux 9

  1. Add Grafana repository:
    sudo nano /etc/yum.repos.d/grafana.repo

    Add:

    [grafana]
    name=grafana
    baseurl=https://packages.grafana.com/oss/rpm
    repo_gpgcheck=1
    gpgcheck=1
    gpgkey=https://packages.grafana.com/gpg.key
    enabled=1
  2. Install Grafana:
    sudo dnf install grafana -y
  3. Follow steps 3–4 from Ubuntu 24.04.

Part 4: Configure Nginx as Reverse Proxy for Grafana

1. Install Nginx

For Ubuntu/Debian:

sudo apt install nginx -y

For CentOS/AlmaLinux:

sudo dnf install nginx -y

2. Configure Nginx

  1. Create Nginx configuration:
    sudo nano /etc/nginx/sites-available/grafana

    Add (replace your-domain.com with your domain or VPS IP):

    server {
        listen 80;
        server_name your-domain.com;
    
        location / {
            proxy_pass http://localhost:3000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
    }
  2. Enable configuration:
    sudo ln -s /etc/nginx/sites-available/grafana /etc/nginx/sites-enabled/
    sudo nginx -t
    sudo systemctl restart nginx
  3. Install SSL (recommended):Use Certbot for Let’s Encrypt:

    For Ubuntu/Debian:

    sudo apt install certbot python3-certbot-nginx -y
    sudo certbot --nginx -d your-domain.com

    For CentOS/AlmaLinux:

    sudo dnf install certbot python3-certbot-nginx -y
    sudo certbot --nginx -d your-domain.com

Part 5: Configure Grafana with Prometheus Data Source

  1. Log in to Grafana:Access https://your-domain.com or http://your-vps-ip:3000. Default credentials: admin/admin (change password immediately).
  2. Add Prometheus data source:Go to Configuration > Data Sources > Add data source, select Prometheus, set URL to http://localhost:9090, and save.
  3. Create dashboard:Go to Create > Dashboard, add panels, and use Node Exporter metrics (e.g., CPU usage, memory, disk I/O). Import dashboard ID 1860 for a pre-built Node Exporter dashboard.

Part 6: Configure Firewall

1. Ubuntu 24.04 / Debian 12

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw reload

Note: Avoid opening ports 9090/9100/3000; use Nginx and SSH tunneling for secure access.

2. CentOS 9 Stream / AlmaLinux 9

sudo firewall-cmd --permanent --add-port=80/tcp
sudo firewall-cmd --permanent --add-port=443/tcp
sudo firewall-cmd --reload

Note: Keep ports 9090/9100/3000 closed; rely on Nginx and SSH tunneling.

Netcloud24 Hosting Solutions

Plan Price (Monthly) vCPU RAM SSD RDS CALs
RDS X1 €92.24 4 8 GB 100 GiB NVMe 5
RDS X2 €179.57 8 16 GB 200 GiB NVMe 5
RDS X3 €275.52 8 32 GB 400 GiB NVMe 10
RDS X4 €405.89 8 64 GB 1 TB NVMe 25

Netcloud24 Benefits: Host your monitoring stack with Netcloud24’s high-performance VPS, featuring NVMe SSDs, Intel Xeon Gold CPUs, automated backups, VPN support, and 24/7 technical support. Compliant with GDPR and KRI standards. Visit Netcloud24 for plans starting at €92.24/month.

Troubleshooting

  • Prometheus not running: Check logs with journalctl -u prometheus. Verify prometheus.yml syntax.
  • Node Exporter no metrics: Ensure node_exporter service is running (systemctl status node_exporter).
  • Grafana inaccessible: Confirm Nginx configuration and firewall settings. Check systemctl status grafana-server.
  • Contact support: Reach out to Netcloud24 for assistance.

Security Recommendations

  • Use strong passwords for Grafana admin account.
  • Enable SSL via Let’s Encrypt for Grafana access.
  • Restrict firewall to ports 80/443 and SSH (22); use SSH tunneling for local access to Prometheus/Node Exporter.
  • Regularly update Prometheus, Node Exporter, and Grafana.
  • Enable Netcloud24’s VPN and firewall for additional security.
Guide created by Łukasz Bodziony on August 13, 2025. Visit Windows VPS for more resources. For reliable VPS hosting, explore Netcloud24.

 

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24
In this section

More in Linux

Visit category

How to Set up PostgreSQL Replication on Debian 11

  Introduction PostgreSQL is a powerful, open-source object-relational database system that offers advanced features for database management. Setting up replication is essential for ensuring high availability and load…

Comments are closed.