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
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.
Initial Server Setup
Log into your VPS and update the system:
apt update && apt upgrade -yCreate a dedicated system user for VictoriaMetrics:
useradd --system --no-create-home --shell /usr/sbin/nologin victoriametricsCreate the directories VictoriaMetrics will use:
mkdir -p /opt/victoriametrics
mkdir -p /var/lib/victoriametrics
chown victoriametrics:victoriametrics /var/lib/victoriametricsDownload and Install VictoriaMetrics
Check the VictoriaMetrics GitHub releases page for the latest stable version.
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-metricsVerify the binary runs:
/opt/victoriametrics/victoria-metrics --versionCreate the systemd Service
Create a systemd unit file to manage the VictoriaMetrics process:
[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| Flag | Purpose |
|---|---|
| -storageDataPath | Directory where VictoriaMetrics stores its data |
| -retentionPeriod | How many months of data to retain (3 = 3 months) |
| -httpListenAddr | Bind only to localhost — do not expose directly |
| -selfScrapeInterval | VictoriaMetrics scrapes its own metrics every 10 seconds |
systemctl daemon-reload
systemctl enable --now victoriametrics
systemctl status victoriametricsConfirm it is listening:
curl -s http://127.0.0.1:8428/metrics | head -20Install and Configure node_exporter
node_exporter exposes host-level metrics (CPU, memory, disk, network) in Prometheus format.
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/useradd --system --no-create-home --shell /usr/sbin/nologin node_exporter[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.targetsystemctl daemon-reload
systemctl enable --now node_exporterConfigure VictoriaMetrics to Scrape Metrics
VictoriaMetrics supports Prometheus-compatible scrape configurations.
mkdir -p /etc/victoriametricsglobal:
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-vpsUpdate the systemd service to load this config by adding the -promscrape.config flag to 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=INFOsystemctl daemon-reload
systemctl restart victoriametricsVerify scraping is working:
curl -s "http://127.0.0.1:8428/api/v1/query?query=up" | python3 -m json.toolYou should see up{job="node"} and up{job="victoriametrics"} with a value of 1.
Install Grafana
Grafana is the standard visualization layer for VictoriaMetrics.
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 grafanasystemctl enable --now grafana-server
systemctl status grafana-serverBy default Grafana listens on port 3000. Configure a firewall rule or proceed to the Nginx reverse proxy step before accessing it.
Set Up Nginx as a Reverse Proxy
Avoid exposing VictoriaMetrics or Grafana directly. Use Nginx with a domain and TLS.
apt install -y nginx certbot python3-certbot-nginxserver {
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;
}
}ln -s /etc/nginx/sites-available/grafana /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d metrics.yourdomain.comConfigure Grafana
Navigate to https://metrics.yourdomain.com. Default credentials: admin / admin.
Add VictoriaMetrics as a Data Source
- Go to Connections → Data Sources → Add data source
- Select Prometheus (VictoriaMetrics is fully Prometheus-compatible)
- Set the URL to
http://127.0.0.1:8428 - Click Save & Test — you should see a green confirmation
Import a Node Exporter Dashboard
- Go to Dashboards → Import
- Enter dashboard ID
1860(Node Exporter Full) - Select your VictoriaMetrics data source
- Click Import
Configure the Firewall
Only ports 80 and 443 should be publicly accessible:
ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enable
ufw statusConfirm that ports 8428, 9100, and 3000 are not reachable from the public internet:
ss -tlnp | grep -E '8428|9100|3000'All three should show 127.0.0.1 as the bound address, not 0.0.0.0.
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:
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| Flag | Purpose |
|---|---|
| -memory.allowedPercent=60 | Caps internal caches to 60% of available RAM |
| -search.maxConcurrentRequests=2 | Prevents query storms from exhausting memory |
| -search.maxQueryDuration=30s | Kills runaway queries automatically |
| -retentionPeriod=1 | Reduces retention to 1 month to limit disk/memory pressure |
Upgrading VictoriaMetrics
VictoriaMetrics upgrades are safe and fast — the storage format is backward compatible.
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 victoriametricsMonitoring 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:
- job_name: node
static_configs:
- targets:
- 127.0.0.1:9100
- 10.0.0.2:9100
- 10.0.0.3:9100
labels:
cluster: ramnode-fleetSend a SIGHUP to reload the scrape config without downtime:
kill -HUP $(pidof victoria-metrics)Further Reading
- VictoriaMetrics Documentation
- MetricsQL Reference — VictoriaMetrics' PromQL superset
- VictoriaMetrics Grafana Dashboards
- node_exporter Collector Reference
