🗂️ VPS › VPS Monitoring Setup  |  Updated: Nov 9, 2026

Install VPS Monitoring: Netdata or Prometheus + Grafana

Running a VPS without monitoring is like driving a car without a dashboard — you won't know you're running out of fuel until the engine stops. This guide walks you through installing Netdata (simple and fast) or Prometheus + Grafana (powerful and flexible) on Ubuntu VPS, step by step.

Install VPS Monitoring with Netdata or Prometheus

📋 Table of Contents

  1. Why You Need VPS Monitoring
  2. Netdata vs Prometheus: Comparison
  3. Installing Netdata on Ubuntu
  4. Configuring Netdata (Alerts + Security)
  5. Installing Prometheus + Node Exporter
  6. Installing Grafana and Connecting to Prometheus
  7. Key Metrics to Monitor
  8. Setting Up Alerts
  9. Securing Your Dashboard
  10. Frequently Asked Questions

Why You Need VPS Monitoring

Without monitoring, you won't discover problems until your website is already down. The most common VPS failure scenarios:

💡 Benefits of Monitoring Detect problems before downtime, plan scale-up at the right time, debug performance issues with precision, and prove uptime to stakeholders.

Netdata vs Prometheus: Comparison

FeatureNetdataPrometheus + Grafana
Installation difficulty⭐⭐⭐⭐⭐ Very easy (1 command)⭐⭐⭐ Multi-step setup
Real-time Dashboard✅ Instant UI included❌ Requires dashboard import
FlexibilityModerate⭐⭐⭐⭐⭐ Very high
Long-term storageLimited (default 24h)✅ Configurable retention
Resource usage~50-100 MB RAM~300-700 MB RAM
Multi-serverNetdata Cloud (free)✅ Native support
Best forSingle VPS, beginnersClusters, large production
✅ Recommendation Single VPS or a few servers → use Netdata. Multiple servers needing custom dashboards and complex alerts → use Prometheus + Grafana.

Installing Netdata on Ubuntu

Free Ubuntu 20.04/22.04/24.04

Netdata provides a one-line installer that detects your OS and installs automatically:

# Update package list first
sudo apt update

# Install Netdata with one-line installer
wget -O /tmp/netdata-kickstart.sh https://get.netdata.cloud/kickstart.sh
sh /tmp/netdata-kickstart.sh --stable-channel --no-updates

Verify the service is running:

sudo systemctl status netdata
# Should show: active (running)

Open the dashboard at http://YOUR_VPS_IP:19999 — real-time graphs appear immediately.

⚠️ Do Not Expose Port 19999 Publicly By default, Netdata opens port 19999 to all IPs. Restrict access immediately (see Security section below).

Alternative: Install via Package Manager

# Add Netdata repository
curl -s https://packagecloud.io/install/repositories/netdata/netdata/script.deb.sh | sudo bash

# Install
sudo apt install netdata -y

# Enable and start
sudo systemctl enable netdata
sudo systemctl start netdata

Configuring Netdata (Alerts + Security)

Restrict Dashboard Access

Edit /etc/netdata/netdata.conf:

[web]
    # Allow only localhost (use SSH tunnel to access)
    bind to = 127.0.0.1
    # Or specify allowed IPs
    allow connections from = localhost 192.168.1.*
sudo systemctl restart netdata

Access Dashboard via SSH Tunnel

# Run on your local machine
ssh -L 19999:127.0.0.1:19999 user@YOUR_VPS_IP

# Then open in browser:
# http://localhost:19999

Configure Email Alerts

sudo nano /etc/netdata/health_alarm_notify.conf
SEND_EMAIL="YES"
DEFAULT_RECIPIENT_EMAIL="[email protected]"
SENDMAIL="$(which sendmail)"

Installing Prometheus + Node Exporter

Prometheus requires two components: Prometheus itself (metric storage) and Node Exporter (OS metric collection).

Step 1: Install Node Exporter

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
sudo cp node_exporter-1.8.2.linux-amd64/node_exporter /usr/local/bin/

# Create service user
sudo useradd -rs /bin/false node_exporter

Create systemd service file:

sudo nano /etc/systemd/system/node_exporter.service
[Unit]
Description=Node Exporter
After=network.target

[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter
# Verify: curl http://localhost:9100/metrics | head -20

Step 2: Install Prometheus

cd /tmp
wget https://github.com/prometheus/prometheus/releases/download/v2.54.1/prometheus-2.54.1.linux-amd64.tar.gz
tar xvf prometheus-2.54.1.linux-amd64.tar.gz

sudo useradd -rs /bin/false prometheus
sudo mkdir /etc/prometheus /var/lib/prometheus
sudo cp prometheus-2.54.1.linux-amd64/prometheus /usr/local/bin/
sudo cp prometheus-2.54.1.linux-amd64/promtool /usr/local/bin/
sudo cp -r prometheus-2.54.1.linux-amd64/consoles /etc/prometheus
sudo cp -r prometheus-2.54.1.linux-amd64/console_libraries /etc/prometheus

Configure Prometheus:

sudo nano /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']
sudo chown -R prometheus:prometheus /etc/prometheus /var/lib/prometheus

Create systemd service:

sudo nano /etc/systemd/system/prometheus.service
[Unit]
Description=Prometheus
After=network.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/ \
  --storage.tsdb.retention.time=30d \
  --web.listen-address=127.0.0.1:9090

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable prometheus
sudo systemctl start prometheus
sudo systemctl status prometheus

Installing Grafana and Connecting to Prometheus

Install Grafana

sudo apt install -y apt-transport-https software-properties-common wget

sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com 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

Access Grafana UI

Use SSH tunnel: ssh -L 3000:127.0.0.1:3000 user@VPS_IP then open http://localhost:3000

Add Prometheus as Data Source

  1. Go to Connections → Data sources → Add data source
  2. Select Prometheus
  3. URL: http://localhost:9090
  4. Click Save & test

Import a Pre-built Dashboard

  1. Go to Dashboards → Import
  2. Enter ID: 1860 (Node Exporter Full — most popular dashboard)
  3. Select the Prometheus data source
  4. Click Import

You'll instantly have a beautiful dashboard showing CPU, RAM, Disk, and Network metrics.

Key Metrics to Monitor

MetricNormal RangeAlert Threshold
CPU Usage< 70%> 90% for 5+ minutes
RAM Usage< 80%> 90% (OOM risk)
Disk Usage< 70%> 85% (plan cleanup)
Disk I/O WaitWorkload-dependent> 20% sustained
Network In/OutNormal usage baselineUnusual spikes
Load Average< number of CPUs> 2× CPU core count
Swap Usage0-20%> 50% (insufficient RAM)

Setting Up Alerts

Netdata Alerts

Netdata includes many pre-configured alerts in /etc/netdata/health.d/. Customize thresholds as needed:

# /etc/netdata/health.d/cpu.conf
alarm: cpu_usage
on: system.cpu
lookup: average -1m percentage of user,system
units: %
warn: $this > 80
crit: $this > 95
info: CPU usage is high

Grafana Alerts

  1. Open a panel → Edit → Alert
  2. Set conditions (e.g., CPU > 90% for 5 minutes)
  3. Add Contact Point (Email, Slack, LINE, Telegram)
  4. Click Save
✅ Recommended Alerts CPU > 90% / RAM > 90% / Disk > 85% / Service Down / High Network Traffic

Securing Your Dashboard

Monitoring dashboards expose sensitive server information and must never be publicly accessible.

Method 1: SSH Tunnel (Recommended for single VPS)

# Access Netdata
ssh -L 19999:127.0.0.1:19999 user@VPS_IP &
# Access Grafana
ssh -L 3000:127.0.0.1:3000 user@VPS_IP &

Method 2: Nginx Reverse Proxy + Basic Auth

sudo apt install -y nginx apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd admin
# /etc/nginx/sites-available/netdata
server {
    listen 80;
    server_name monitor.yourdomain.com;

    auth_basic "Monitoring";
    auth_basic_user_file /etc/nginx/.htpasswd;

    location / {
        proxy_pass http://127.0.0.1:19999;
        proxy_set_header Host $host;
    }
}

Method 3: UFW Firewall Block

sudo ufw deny 19999
sudo ufw deny 9090
sudo ufw deny 3000
sudo ufw allow from YOUR_IP_ADDRESS to any port 19999

🎯 Summary: Choose the Right Tool

Frequently Asked Questions

What is the difference between Netdata and Prometheus?
Netdata focuses on real-time monitoring with an instant built-in UI, while Prometheus focuses on long-term metric storage with high flexibility but requires Grafana separately for visualization.
How much RAM does Netdata use on a VPS?
Netdata uses approximately 50-100 MB of RAM and very little CPU (1-3%), making it suitable for VPS instances starting from 1 GB RAM.
Can I set up alerts in Netdata?
Yes, Netdata includes built-in alerting supporting Email, Slack, Telegram, PagerDuty and more. Configure alerts in /etc/netdata/health.d/ or use the free Netdata Cloud.
How much RAM does Prometheus + Grafana require?
Prometheus uses 200-500 MB RAM depending on metric volume, and Grafana uses approximately 100-200 MB. A VPS with at least 2 GB RAM is recommended for this stack.
Which ports do Netdata and Prometheus use?
Netdata uses port 19999, Prometheus uses port 9090, Node Exporter uses port 9100, and Grafana uses port 3000. All should be restricted via firewall and not exposed publicly.
Can I use both Netdata and Prometheus simultaneously?
Yes, Netdata can forward metrics to Prometheus via its built-in exporter. This lets you use Netdata for real-time dashboards and Prometheus for long-term metric storage at the same time.

Related Articles: Configure UFW Firewall on VPS • Create systemd Service • Grafana + Prometheus on VPS