How to Install VictoriaMetrics on Ubuntu 20.04 LTS [Step By Step]


In this article, I will take you through the steps to install VictoriaMetrics on Ubuntu 20.04 LTS. According to Official Documentation, VictoriaMetrics is a cost effective, high performance open series database and scalable monitoring solution. It can be used as a long term storage for Prometheus and can also be used as drop-in replacement for Prometheus in Grafana. All the configuration done in Victoriametrics can be explicitly done through command-line flags hence making it easier for all command line lovers.

Other Important Features

  • It provides high performance and faster response.
  • It provides good horizontal and vertical scalability for both data ingestion and data querying.
  • It is optimized for time series with high churn rate.
  • It is optimized for storage with high-latency IO and low IOPS.
  • It provides global query view which means multiple Prometheus Instances can ingest data into VictoriaMetrics.
  • It provides high data compression.
  • It protects the storage from data corruption on unclean shutdown.
  • It supports metrics relabeling. More on GitHub.
  • Easy and fast backups from instant snapshots to S3 or GCS can be done with vmbackup / vmrestore tools.

How to Install VictoriaMetrics on Ubuntu 20.04 LTS [Step By Step]

How to Install VictoriaMetrics on Ubuntu 20.04 LTS

Also Read: How to Install Graylog on Ubuntu 20.04 LTS [Easy Steps]


Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.


c) You should have snap utility available in your System.


Step 2: Update Server

First logical step that you can think of doing before installing any new package is checking for any latest available updates by using apt update command. This will search and install all the available stables updates from configured Repositories.

root@localhost:~# apt update
Hit:1 focal InRelease
Hit:2 focal-updates InRelease
Hit:3 focal-backports InRelease
Get:4 focal-security InRelease [114 kB]
Hit:5 stable InRelease
Ign:6 bionic/mongodb-org/4.0 InRelease
Hit:7 bionic/mongodb-org/4.0 Release
Get:9 stable InRelease [1,811 B]
Hit:8 stable InRelease
Get:10 focal-security/main amd64 DEP-11 Metadata [35.7 kB]
Get:12 focal-security/universe amd64 DEP-11 Metadata [64.5 kB]
Get:13 focal-security/multiverse amd64 DEP-11 Metadata [2,464 B]
Get:14 stable/main amd64 Packages [1,088 B]
Fetched 219 kB in 4s (56.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
8 packages can be upgraded. Run 'apt list --upgradable' to see them.


Step 3: Check Victoriametrics Info

If you want to check complete information about Victoriametrics snap then you need to use snap info victoriametrics command as shown below. This will give some important information like the snap version currently available through different channels.

root@localhost:~# snap info victoriametrics
name: victoriametrics
summary: VictoriaMetrics is fast, cost-effective and scalable time-series database.
publisher: VictoriaMetrics (f41gh7)
license: unset
description: |
* VictoriaMetrics can be used as long-term storage for Prometheus or for vmagent.
See [these docs](#prometheus-setup) for details.
* Supports Prometheus querying API, so it can be used as Prometheus drop-in replacement in


Step 4: Install VictoriaMetrics

In the next step, you need to install VictoriaMetrics snap using snap install victoriametrics command as shown below.

root@localhost:~# snap install victoriametrics
victoriametrics v1.58.0+git439.c5188581 from VictoriaMetrics (f41gh7) installed


Step 5: Verify VictoriaMetrics

You can verify the VictoriaMetrics health by checking its /metrics page using curl http://localhost:8428/metrics query. You should see a list of internal metrics in plain text format as shown below.

root@localhost:~# curl http://localhost:8428/metrics
vm_active_force_merges 0
vm_active_merges{type="indexdb"} 0
vm_active_merges{type="storage/big"} 0
vm_active_merges{type="storage/small"} 0
vm_assisted_merges_total{type="indexdb"} 0
vm_assisted_merges_total{type="storage/small"} 0
vm_blocks{type="indexdb"} 0
vm_blocks{type="storage/big"} 0
vm_blocks{type="storage/small"} 0
vm_cache_collisions_total{type="storage/metricName"} 0
vm_cache_collisions_total{type="storage/tsid"} 0
vm_cache_entries{type="indexdb/dataBlocks"} 0
vm_cache_entries{type="indexdb/indexBlocks"} 0
vm_cache_entries{type="indexdb/tagFilters"} 2
vm_cache_entries{type="promql/parse"} 1
vm_cache_entries{type="promql/regexp"} 1
vm_cache_entries{type="promql/rollupResult"} 0
vm_cache_entries{type="storage/bigIndexBlocks"} 0


Step 6: Run Sample Query

You can also run a sample API query to check the usage. If you get a response with success status like below then it confirms API request/response is working as expected.

root@localhost:~# curl http://localhost:8428/api/v1/query -d 'query={job=~".*"}'


Step 7: Remove VictoriaMetrics

Once you are done with VictoriaMetrics, you can remove the snap by using snap remove victoriametrics command as shown below.

root@localhost:~# snap remove victoriametrics
victoriametrics removed

Leave a Comment