September 02, 2026 · by Alex M.
Server monitoring is one of the most critical DevOps practices you should implement from day one. Without real-time metrics, performance issues — excessive CPU consumption, memory exhaustion, full disks — can go unnoticed until your site or application crashes entirely.
Prometheus and Grafana together form one of the most widely used open-source monitoring stacks. Prometheus collects and stores metrics, while Grafana visualizes them in elegant, interactive dashboards. In this complete guide, you'll learn how to install and configure both tools step by step on a SSD VPS running Ubuntu 22.04.
There are many monitoring solutions — Zabbix, Netdata, Nagios — but the Prometheus + Grafana combination continues to gain ground because of:
If you're running an NVMe VPS with critical applications, these tools can save you hours of troubleshooting.
Before you start, make sure you have:
sudo privilegesUpdate your system before anything else:
sudo apt update && sudo apt upgrade -y
Never run Prometheus as root. Create a system user with no login shell:
sudo useradd --no-create-home --shell /bin/false prometheus
Check the latest release at prometheus.io/download, then:
cd /tmp
wget https://github.com/prometheus/prometheus/releases/download/v2.52.0/prometheus-2.52.0.linux-amd64.tar.gz
tar xvf prometheus-2.52.0.linux-amd64.tar.gz
cd prometheus-2.52.0.linux-amd64
Copy the binaries and configuration files:
sudo cp prometheus /usr/local/bin/
sudo cp promtool /usr/local/bin/
sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus
sudo cp -r consoles/ /etc/prometheus/
sudo cp -r console_libraries/ /etc/prometheus/
sudo cp prometheus.yml /etc/prometheus/
Set correct ownership:
sudo chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus
sudo chown prometheus:prometheus /usr/local/bin/prometheus /usr/local/bin/promtool
Edit the main configuration file:
sudo nano /etc/prometheus/prometheus.yml
Basic content:
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'node'
static_configs:
- targets: ['localhost:9100']
sudo nano /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus Monitoring
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \n --config.file=/etc/prometheus/prometheus.yml \n --storage.tsdb.path=/var/lib/prometheus/ \n --web.console.templates=/etc/prometheus/consoles \n --web.console.libraries=/etc/prometheus/console_libraries
Restart=on-failure
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable prometheus
sudo systemctl start prometheus
sudo systemctl status prometheus
Prometheus is now running on port 9090. If UFW is active:
sudo ufw allow 9090/tcp
Node Exporter exposes operating system metrics (CPU, RAM, disk, network) to Prometheus.
cd /tmp
wget https://github.com/prometheus/node_exporter/releases/download/v1.8.0/node_exporter-1.8.0.linux-amd64.tar.gz
tar xvf node_exporter-1.8.0.linux-amd64.tar.gz
sudo cp node_exporter-1.8.0.linux-amd64/node_exporter /usr/local/bin/
sudo useradd --no-create-home --shell /bin/false node_exporter
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
sudo nano /etc/systemd/system/node_exporter.service
[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
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter
Node Exporter runs on port 9100 and exposes hundreds of metrics about your server's health.
Grafana transforms raw Prometheus data into intuitive visual charts. This is where you'll actually see — in real time — everything happening on your VPS.
sudo apt 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
sudo apt install grafana -y
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
sudo systemctl status grafana-server
Grafana runs on port 3000:
sudo ufw allow 3000/tcp
Open http://YOUR-VPS-IP:3000 in your browser. Default credentials: admin / admin. You'll be prompted to change the password on first login.
http://localhost:9090Instead of building charts from scratch, import the popular Node Exporter Full dashboard (ID: 1860):
1860 and click LoadYou'll instantly see graphs for CPU usage, load average, available memory, disk I/O, network traffic and much more.
Don't expose Grafana and Prometheus directly to the internet without protection. Set up Nginx as a reverse proxy and add an SSL certificate for an encrypted connection.
sudo apt install nginx -y
sudo nano /etc/nginx/sites-available/grafana
server {
listen 80;
server_name monitoring.yourdomain.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;
}
}
sudo ln -s /etc/nginx/sites-available/grafana /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Add SSL with Certbot:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d monitoring.yourdomain.com
Prometheus can send alerts when metrics exceed defined thresholds. For example, an alert when CPU > 85% for 5 minutes:
# /etc/prometheus/alert.rules.yml
groups:
- name: server_alerts
rules:
- alert: HighCPUUsage
expr: 100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 85
for: 5m
labels:
severity: warning
annotations:
summary: "High CPU on {{ $labels.instance }}"
description: "CPU usage > 85% for 5 minutes"
- alert: LowDiskSpace
expr: (node_filesystem_avail_bytes / node_filesystem_size_bytes) * 100 < 10
for: 2m
labels:
severity: critical
annotations:
summary: "Critical disk space on {{ $labels.instance }}"
Reference the file in prometheus.yml:
rule_files:
- "/etc/prometheus/alert.rules.yml"
--storage.tsdb.retention.time=30d in the systemd service# Verify Prometheus is scraping data
curl http://localhost:9090/api/v1/targets
# Check Node Exporter metrics
curl http://localhost:9100/metrics | grep node_cpu
# Check the status of all services
sudo systemctl status prometheus node_exporter grafana-server
You've now built a complete server monitoring system: metric collection through Prometheus, real-time visualization through Grafana, and automatic alerting via custom rules. This stack gives you full visibility into your VPS's health, helping you act proactively before issues impact your users.
If you'd rather focus on your application than your infrastructure, CLIQHOST server management services include monitoring, maintenance and specialized technical support. Or you can get started right now with a high-performance SSD VPS and implement this setup yourself. Need help? Contact us — we're here for you.
Real reviews from customers who trust CLIQHOST for performance, reliability and expert technical support.
"We moved our online shop from a foreign host and the difference is night and day — pages load instantly and support replies in minutes, in Romanian."
"Migrated 12 client sites to CLIQHOST. Free migration, zero downtime, and the cPanel setup is exactly what my team needed. Highly recommend."
"Our NVMe VPS handles traffic spikes without a sweat. Full root, local datacenter, and billing in MDL — everything we wanted from a provider."