How to Install VictoriaMetrics on Debian Latest
Overview
VictoriaMetrics is an open-source and fast Prometheus compatible distributed TSDB and query engine. This tutorial will guide you through the installation process of VictoriaMetrics on Debian Linux.
Prerequisites
Before proceeding with the installation, ensure that you have the following prerequisites:
- A Debian Linux system
- A user account with sudo privileges
- A stable internet connection
Step 1: Update your Debian System
Before installing VictoriaMetrics on your system, it is recommended to update your Debian Linux system to the latest version. To update your Debian system, use the following commands:
sudo apt update
sudo apt upgrade
Step 2: Install Go
VictoriaMetrics requires Go to be installed on the system. To install Go, follow the below steps:
Download the latest version of Go from the official website. You can download the tar file from the following link:
https://golang.org/dl/Extract the downloaded file to the /usr/local directory:
sudo tar -C /usr/local -xzf go*.tar.gzSet the environment variables for Go:
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc echo 'export GOPATH=$HOME/go' >> ~/.bashrc echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc source ~/.bashrcVerify the Go installation by running the following command:
go versionIf Go is installed properly, the output should be similar to the following:
go version go1.17.2 linux/amd64
Step 3: Install VictoriaMetrics
To install VictoriaMetrics on Debian Linux, follow the below steps:
Download the latest version of VictoriaMetrics from the Github repository:
wget https://github.com/VictoriaMetrics/VictoriaMetrics/releases/download/v1.64.0/victoria-metrics-1.64.0.tar.gzEnsure that you have downloaded the latest release version from the repository.
Extract the downloaded file to the installation directory:
tar -xvf victoria-metrics-*.tar.gz cd victoria-metrics-*Run the following command to build VictoriaMetrics:
makeThis will build the VictoriaMetrics binary executable.
Create a systemd unit file to run VictoriaMetrics:
sudo nano /etc/systemd/system/victoria-metrics.servicePaste the following contents into the file:
[Unit] Description=VictoriaMetrics [Service] User=root Group=root Restart=always ExecStart=/path/to/victoria-metrics-*/victoria-metrics [Install] WantedBy=multi-user.targetReplace /path/to with the actual path where VictoriaMetrics is installed.
Reload the systemd daemon:
sudo systemctl daemon-reloadEnable and start VictoriaMetrics to run on system boot:
sudo systemctl enable victoria-metrics sudo systemctl start victoria-metricsVerify the VictoriaMetrics installation by accessing the following URL via a web browser:
http://your-server-ip:8428If VictoriaMetrics is installed correctly, you should see the VictoriaMetrics web user interface.
That's it! You have successfully installed VictoriaMetrics on your Debian Linux system. You can now start ingesting data into VictoriaMetrics and start querying it using the Prometheus Query Language.