VictoriaMetrics is a fast, cost-efficient time-series database designed as a drop-in replacement for Prometheus storage. It supports the full Prometheus remote_write protocol, exposes its own MetricsQL query language (fully compatible with PromQL), and operates as a single binary with no external dependencies. On RHEL 8, the installation takes under five minutes and the memory footprint is significantly lower than a comparable Prometheus setup. This tutorial covers installing the single-node binary, creating a systemd service, configuring Prometheus remote_write, and exploring data with vmui and vmagent.

Prerequisites

  • RHEL 8 server with at least 2 GB RAM and 20 GB free disk space
  • Prometheus installed (optional — needed only for remote_write configuration)
  • Root or sudo access
  • Firewalld active
  • curl and tar available

Step 1 — Download and Install VictoriaMetrics

Download the single-node VictoriaMetrics binary from the official GitHub releases page. The single-node edition handles most workloads and requires no cluster configuration.

cd /tmp
curl -LO https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.101.0/victoria-metrics-linux-amd64-v1.101.0.tar.gz
tar xzf victoria-metrics-linux-amd64-v1.101.0.tar.gz
sudo cp victoria-metrics-prod /usr/local/bin/victoria-metrics
sudo chmod +x /usr/local/bin/victoria-metrics

# Create dedicated user and data directory
sudo useradd --no-create-home --shell /bin/false victoriametrics
sudo mkdir -p /var/lib/victoria-metrics
sudo chown victoriametrics:victoriametrics /var/lib/victoria-metrics

# Verify the binary works
victoria-metrics --version

Step 2 — Create the Systemd Service

Create a systemd unit file that launches VictoriaMetrics with a defined storage path, retention period, and HTTP listener address. The default port is 8428.

sudo tee /etc/systemd/system/victoria-metrics.service > /dev/null <<'EOF'
[Unit]
Description=VictoriaMetrics - time series database
Wants=network-online.target
After=network-online.target

[Service]
User=victoriametrics
Group=victoriametrics
Type=simple
ExecStart=/usr/local/bin/victoria-metrics 
  --storageDataPath=/var/lib/victoria-metrics 
  --retentionPeriod=12 
  --httpListenAddr=:8428 
  --selfScrapeInterval=10s
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now victoria-metrics
sudo systemctl status victoria-metrics

Step 3 — Open the Firewall

Allow port 8428 through firewalld so Prometheus (and other scrapers) can reach VictoriaMetrics over the network.

sudo firewall-cmd --permanent --add-port=8428/tcp
sudo firewall-cmd --reload

# Confirm VictoriaMetrics is responding
curl -s http://localhost:8428/metrics | head -20
curl -s http://localhost:8428/health

Step 4 — Configure Prometheus remote_write

Add a remote_write block to your Prometheus configuration so it ships all scraped metrics to VictoriaMetrics in real time. VictoriaMetrics acts as long-term storage while Prometheus continues scraping normally.

# Append remote_write block to /etc/prometheus/prometheus.yml
sudo tee -a /etc/prometheus/prometheus.yml > /dev/null <<'EOF'

remote_write:
  - url: http://localhost:8428/api/v1/write
    queue_config:
      max_samples_per_send: 10000
      capacity: 20000
      max_shards: 30
EOF

sudo systemctl reload prometheus

# Confirm data is flowing into VictoriaMetrics
curl -s 'http://localhost:8428/api/v1/query?query=up' | python3 -m json.tool | head -30

Step 5 — Query Data with vmui and MetricsQL

VictoriaMetrics ships with vmui, a built-in graphical query explorer available at /vmui. MetricsQL extends PromQL with additional functions like median_over_time and rollup.

# Open vmui in your browser (or use SSH port forwarding)
# http://localhost:8428/vmui

# Example MetricsQL queries via API
# CPU usage rate (compatible PromQL syntax)
curl -s 'http://localhost:8428/api/v1/query_range?query=rate(node_cpu_seconds_total{mode="idle"}[5m])&start=now-1h&end=now&step=60s' 
  | python3 -m json.tool | head -20

# MetricsQL-specific: median over time
curl -s 'http://localhost:8428/api/v1/query?query=median_over_time(node_load1[10m])' 
  | python3 -m json.tool

# List all metric names
curl -s 'http://localhost:8428/api/v1/label/__name__/values' | python3 -m json.tool | head -20

Step 6 — Install vmagent as a Lightweight Scraper and Take a Backup

vmagent is a lightweight alternative to Prometheus for scraping metrics and forwarding them to VictoriaMetrics. vmbackup creates consistent snapshots of the storage directory for offsite archiving.

# Download vmagent
cd /tmp
curl -LO https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.101.0/vmutils-linux-amd64-v1.101.0.tar.gz
tar xzf vmutils-linux-amd64-v1.101.0.tar.gz
sudo cp vmagent-prod /usr/local/bin/vmagent
sudo cp vmbackup-prod /usr/local/bin/vmbackup

# Create a snapshot (VictoriaMetrics must be running)
curl -s http://localhost:8428/snapshot/create | python3 -m json.tool

# List available snapshots
curl -s http://localhost:8428/snapshot/list | python3 -m json.tool

# Backup a snapshot to a local directory
SNAPSHOT=$(curl -s http://localhost:8428/snapshot/create | python3 -c "import sys,json; print(json.load(sys.stdin)['snapshotName'])")
sudo vmbackup 
  -storageDataPath=/var/lib/victoria-metrics 
  -snapshot.name="$SNAPSHOT" 
  -dst=fs:///var/backups/victoria-metrics/

# Check disk usage
du -sh /var/lib/victoria-metrics/

Conclusion

VictoriaMetrics is now running on RHEL 8 as a long-term storage backend for Prometheus, with data flowing in via remote_write and queryable through both the vmui web interface and the MetricsQL-compatible API. Its single-binary design, low memory overhead, and 12-month default retention make it well-suited for production monitoring without the operational complexity of a distributed system. Snapshots via vmbackup protect your historical data.

Next steps: How to Set Up Alertmanager with PagerDuty and Slack Integration on RHEL 8, How to Configure Grafana to Query VictoriaMetrics on RHEL 8, and How to Deploy vmagent as a Prometheus Scraper on RHEL 8.