← Back to Deployment Guides
    Monitoring
    ~45 min

    Deploy VictoriaMetrics on a RamNode VPS

    High-performance time series database and monitoring solution — a drop-in Prometheus replacement with lower resource usage, better compression, and faster queries.

    Prerequisites

    • A RamNode VPS running Ubuntu 22.04 LTS (1 vCPU / 1GB RAM minimum; 2GB recommended)
    • Root or sudo access
    • A domain or subdomain pointed at your VPS (optional, but recommended for Grafana)
    • Basic familiarity with the Linux command line
    1

    Choose Your RamNode Plan

    VictoriaMetrics single-node is extremely memory-efficient. For personal monitoring or small infrastructure:

    • Starter (1GB RAM) — adequate for monitoring up to ~10 hosts with 15-second scrape intervals
    • Standard (2GB RAM) — comfortable for 20-50 hosts or longer retention periods
    • Performance (4GB+ RAM) — suitable for larger fleets or high-cardinality metrics

    Storage is the more likely bottleneck. VictoriaMetrics compresses time series data at roughly 0.4 bytes per data point on average. A single host emitting 1,000 metrics every 15 seconds will consume roughly 2.3GB per month of retention.

    2

    Initial Server Setup

    Log into your VPS and update the system:

    Update system packages
    apt update && apt upgrade -y

    Create a dedicated system user for VictoriaMetrics:

    Create system user
    useradd --system --no-create-home --shell /usr/sbin/nologin victoriametrics

    Create the directories VictoriaMetrics will use:

    Create directories
    mkdir -p /opt/victoriametrics
    mkdir -p /var/lib/victoriametrics
    chown victoriametrics:victoriametrics /var/lib/victoriametrics
    3

    Download and Install VictoriaMetrics

    Check the VictoriaMetrics GitHub releases page for the latest stable version.

    Download and install
    cd /tmp
    VM_VERSION="v1.101.0"
    wget "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/${VM_VERSION}/victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz"
    tar -xzf "victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz"
    mv victoria-metrics-prod /opt/victoriametrics/victoria-metrics
    chmod +x /opt/victoriametrics/victoria-metrics

    Verify the binary runs:

    Verify installation
    /opt/victoriametrics/victoria-metrics --version
    4

    Create the systemd Service

    Create a systemd unit file to manage the VictoriaMetrics process:

    /etc/systemd/system/victoriametrics.service
    [Unit]
    Description=VictoriaMetrics
    After=network.target
    
    [Service]
    Type=simple
    User=victoriametrics
    Group=victoriametrics
    ExecStart=/opt/victoriametrics/victoria-metrics \
      -storageDataPath=/var/lib/victoriametrics \
      -retentionPeriod=3 \
      -httpListenAddr=127.0.0.1:8428 \
      -selfScrapeInterval=10s \
      -loggerLevel=INFO
    Restart=on-failure
    RestartSec=5
    LimitNOFILE=65536
    
    [Install]
    WantedBy=multi-user.target
    FlagPurpose
    -storageDataPathDirectory where VictoriaMetrics stores its data
    -retentionPeriodHow many months of data to retain (3 = 3 months)
    -httpListenAddrBind only to localhost — do not expose directly
    -selfScrapeIntervalVictoriaMetrics scrapes its own metrics every 10 seconds
    Enable and start
    systemctl daemon-reload
    systemctl enable --now victoriametrics
    systemctl status victoriametrics

    Confirm it is listening:

    Verify
    curl -s http://127.0.0.1:8428/metrics | head -20
    5

    Install and Configure node_exporter

    node_exporter exposes host-level metrics (CPU, memory, disk, network) in Prometheus format.

    Download node_exporter
    NODE_EXPORTER_VERSION="1.8.0"
    cd /tmp
    wget "https://github.com/prometheus/node_exporter/releases/download/v${NODE_EXPORTER_VERSION}/node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64.tar.gz"
    tar -xzf "node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64.tar.gz"
    mv "node_exporter-${NODE_EXPORTER_VERSION}.linux-amd64/node_exporter" /usr/local/bin/
    Create system user
    useradd --system --no-create-home --shell /usr/sbin/nologin node_exporter
    /etc/systemd/system/node_exporter.service
    [Unit]
    Description=Prometheus Node Exporter
    After=network.target
    
    [Service]
    Type=simple
    User=node_exporter
    Group=node_exporter
    ExecStart=/usr/local/bin/node_exporter --web.listen-address=127.0.0.1:9100
    Restart=on-failure
    RestartSec=5
    
    [Install]
    WantedBy=multi-user.target
    Enable and start
    systemctl daemon-reload
    systemctl enable --now node_exporter
    6

    Configure VictoriaMetrics to Scrape Metrics

    VictoriaMetrics supports Prometheus-compatible scrape configurations.

    Create config directory
    mkdir -p /etc/victoriametrics
    /etc/victoriametrics/scrape.yml
    global:
      scrape_interval: 15s
      scrape_timeout: 10s
    
    scrape_configs:
      - job_name: node
        static_configs:
          - targets:
              - 127.0.0.1:9100
            labels:
              instance: my-ramnode-vps
    
      - job_name: victoriametrics
        static_configs:
          - targets:
              - 127.0.0.1:8428
            labels:
              instance: my-ramnode-vps

    Update the systemd service to load this config by adding the -promscrape.config flag to ExecStart:

    Updated ExecStart
    ExecStart=/opt/victoriametrics/victoria-metrics \
      -storageDataPath=/var/lib/victoriametrics \
      -retentionPeriod=3 \
      -httpListenAddr=127.0.0.1:8428 \
      -promscrape.config=/etc/victoriametrics/scrape.yml \
      -selfScrapeInterval=10s \
      -loggerLevel=INFO
    Reload and restart
    systemctl daemon-reload
    systemctl restart victoriametrics

    Verify scraping is working:

    Verify scraping
    curl -s "http://127.0.0.1:8428/api/v1/query?query=up" | python3 -m json.tool

    You should see up{job="node"} and up{job="victoriametrics"} with a value of 1.

    7

    Install Grafana

    Grafana is the standard visualization layer for VictoriaMetrics.

    Install Grafana
    apt install -y apt-transport-https software-properties-common
    wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor > /etc/apt/keyrings/grafana.gpg
    echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" > /etc/apt/sources.list.d/grafana.list
    apt update
    apt install -y grafana
    Enable and start
    systemctl enable --now grafana-server
    systemctl status grafana-server

    By default Grafana listens on port 3000. Configure a firewall rule or proceed to the Nginx reverse proxy step before accessing it.

    8

    Set Up Nginx as a Reverse Proxy

    Avoid exposing VictoriaMetrics or Grafana directly. Use Nginx with a domain and TLS.

    Install Nginx and Certbot
    apt install -y nginx certbot python3-certbot-nginx
    /etc/nginx/sites-available/grafana
    server {
        listen 80;
        server_name metrics.yourdomain.com;
    
        location / {
            proxy_pass http://127.0.0.1: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;
        }
    }
    Enable site and get TLS certificate
    ln -s /etc/nginx/sites-available/grafana /etc/nginx/sites-enabled/
    nginx -t && systemctl reload nginx
    certbot --nginx -d metrics.yourdomain.com
    9

    Configure Grafana

    Navigate to https://metrics.yourdomain.com. Default credentials: admin / admin.

    Add VictoriaMetrics as a Data Source

    1. Go to Connections → Data Sources → Add data source
    2. Select Prometheus (VictoriaMetrics is fully Prometheus-compatible)
    3. Set the URL to http://127.0.0.1:8428
    4. Click Save & Test — you should see a green confirmation

    Import a Node Exporter Dashboard

    1. Go to Dashboards → Import
    2. Enter dashboard ID 1860 (Node Exporter Full)
    3. Select your VictoriaMetrics data source
    4. Click Import
    10

    Configure the Firewall

    Only ports 80 and 443 should be publicly accessible:

    UFW firewall rules
    ufw allow OpenSSH
    ufw allow 'Nginx Full'
    ufw enable
    ufw status

    Confirm that ports 8428, 9100, and 3000 are not reachable from the public internet:

    Verify local binding
    ss -tlnp | grep -E '8428|9100|3000'

    All three should show 127.0.0.1 as the bound address, not 0.0.0.0.

    11

    Monitor VictoriaMetrics Itself

    VictoriaMetrics ships with a built-in UI at http://127.0.0.1:8428/vmui. It provides:

    • A MetricsQL query interface (compatible with PromQL)
    • An explorer for active time series
    • Cardinality analysis to identify expensive metrics
    • Storage and ingestion stats

    You can also import VictoriaMetrics' own Grafana dashboard (ID 10229) to track internal performance metrics.

    Tuning for Low-Memory VPS Nodes

    If you are running on a 1GB RAM plan, apply these additional flags:

    Low-memory ExecStart
    ExecStart=/opt/victoriametrics/victoria-metrics \
      -storageDataPath=/var/lib/victoriametrics \
      -retentionPeriod=1 \
      -httpListenAddr=127.0.0.1:8428 \
      -promscrape.config=/etc/victoriametrics/scrape.yml \
      -memory.allowedPercent=60 \
      -search.maxConcurrentRequests=2 \
      -search.maxQueryDuration=30s \
      -loggerLevel=WARN
    FlagPurpose
    -memory.allowedPercent=60Caps internal caches to 60% of available RAM
    -search.maxConcurrentRequests=2Prevents query storms from exhausting memory
    -search.maxQueryDuration=30sKills runaway queries automatically
    -retentionPeriod=1Reduces retention to 1 month to limit disk/memory pressure

    Upgrading VictoriaMetrics

    VictoriaMetrics upgrades are safe and fast — the storage format is backward compatible.

    Upgrade process
    systemctl stop victoriametrics
    
    VM_VERSION="v1.102.0"   # replace with the new version
    cd /tmp
    wget "https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/${VM_VERSION}/victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz"
    tar -xzf "victoria-metrics-linux-amd64-${VM_VERSION}.tar.gz"
    mv victoria-metrics-prod /opt/victoriametrics/victoria-metrics
    chmod +x /opt/victoriametrics/victoria-metrics
    
    systemctl start victoriametrics
    systemctl status victoriametrics

    Monitoring Remote Hosts

    Install node_exporter on each remote host and bind it to a private or WireGuard IP. Then add entries to the scrape config:

    Add remote targets to scrape.yml
      - job_name: node
        static_configs:
          - targets:
              - 127.0.0.1:9100
              - 10.0.0.2:9100
              - 10.0.0.3:9100
            labels:
              cluster: ramnode-fleet

    Send a SIGHUP to reload the scrape config without downtime:

    Reload config
    kill -HUP $(pidof victoria-metrics)