Install VictoriaMetrics Inside Docker Container on Linux

Install VictoriaMetrics Inside Docker Container on Linux

VictoriaMetrics is an open-source time-series database and monitoring solution designed for storing and querying large amounts of time-series data. It's known for its high performance, scalability, and efficiency, making it suitable for handling big data use cases.

This tutorial explains how to install VictoriaMetrics inside a Docker container on Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install VictoriaMetrics

  • Host network

Run the following command to create a container for VictoriaMetrics that uses host network:

docker run -d --name=victoria-metrics --restart=always --network=host \
    -v /opt/victoria-metrics/data:/victoria-metrics-data \
    victoriametrics/victoria-metrics
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, VictoriaMetrics service is listening on port 8428. It can be changed with -p option.

docker network create app-net
docker run -d --name=victoria-metrics --restart=always --network=app-net \
    -p 8080:8428 \
    -v /opt/victoria-metrics/data:/victoria-metrics-data \
    victoriametrics/victoria-metrics

Testing VictoriaMetrics

To access web UI, go to http://<IP_ADDRESS>:8428/vmui, where <IP_ADDRESS> is the IP address of the system.

VictoriaMetrics Inside Docker Container on Linux

Uninstall VictoriaMetrics

To completely remove VictoriaMetrics, remove its container:

docker rm --force victoria-metrics

Remove VictoriaMetrics image:

docker rmi victoriametrics/victoria-metrics

You can also remove VictoriaMetrics data:

sudo rm -rf /opt/victoria-metrics

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.