Skip to content

Deployment Overview of VictoriaMetrics on Server

Prerequisites and Basic Requirements

The deployment requires a Linux-based server with the following specifications:

  • Root privileges or sudo access to execute Docker commands.

  • Docker and Docker Compose installed and running on the host system.

  • Network access to the hostkey.in domain for DNS resolution.

  • Ports 80, 443, 8427, and 8428 must be available and not blocked by external firewalls.

FQDN of the Final Panel

The application is accessible via the following Fully Qualified Domain Name (FQDN):

  • victoriametrics<Server ID>.hostkey.in:443

The external path for the application is set to /.

File and Directory Structure

All configuration files, data, and certificates are located within the root directory structure as follows:

  • Base Directory: /root/victoria-metrics-data

  • Docker Compose File: /root/victoria-metrics-data/compose.yml

  • Authentication Configuration: /root/victoria-metrics-data/authconfig.yml

  • Data Storage: /root/victoria-metrics-data (mounted to the container)

  • Nginx User Configuration: /data/nginx/user_conf.d (mounted to the Nginx container)

Application Installation Process

The application is deployed using Docker Compose with the following components and versions:

  • VictoriaMetrics: victoriametrics/victoria-metrics:latest

  • vmauth: victoriametrics/vmauth (latest version)

  • Nginx with Certbot: jonasal/nginx-certbot:latest

The deployment process involves:

  1. Creating the base directory /root/victoria-metrics-data.

  2. Generating the compose.yml and authconfig.yml files.

  3. Creating the external Docker volume named victoriametrics.

  4. Starting the services using docker compose up -d from the /root/victoria-metrics-data directory.

Docker Containers and Their Deployment

The system utilizes three primary containers managed via Docker Compose:

  • nginx:

  • Image: jonasal/nginx-certbot:latest

  • Function: Handles SSL termination and reverse proxying.

  • Restart Policy: unless-stopped

  • Environment: [email protected]

  • victoriametrics:

  • Image: victoriametrics/victoria-metrics:latest

  • Function: Core metrics storage and processing.

  • Restart Policy: unless-stopped

  • Volume Mounts: /root/victoria-metrics-data and victoriametrics

  • vmauth:

  • Image: victoriametrics/vmauth

  • Function: Authentication layer for VictoriaMetrics.

  • Restart Policy: unless-stopped

  • Command: -auth.config=/root/victoria-metrics-data/authconfig.yml

  • Dependencies: Starts after the victoriametrics container.

Proxy Servers

The deployment includes an Nginx container configured with Certbot for SSL management:

  • SSL Provider: Let's Encrypt via Certbot.

  • Email for Renewals: [email protected].

  • Configuration Path: /data/nginx/user_conf.d on the host is mounted to /etc/nginx/user_conf.d inside the container.

  • Secrets Storage: The nginx_secrets volume stores Let's Encrypt certificates and keys.

Permission Settings

File and directory permissions are set as follows:

  • Directory: /root/victoria-metrics-data

  • Owner: root

  • Group: root

  • Mode: 0644

  • Configuration Files: compose.yml and authconfig.yml

  • Owner: root

  • Group: root

  • Mode: 0644

Available Ports for Connection

The following ports are exposed and utilized by the deployment:

Port Protocol Service Description
80 TCP Nginx HTTP traffic for SSL certificate validation
443 TCP Nginx HTTPS traffic for secure access
8427 TCP vmauth Internal authentication service
8428 TCP VictoriaMetrics Internal metrics service

Starting, Stopping, and Updating

Service management is handled via Docker Compose commands executed from the /root/victoria-metrics-data directory:

  • Start Services:

    cd /root/victoria-metrics-data
    docker compose up -d
    

  • Stop Services:

    cd /root/victoria-metrics-data
    docker compose down
    

  • Update Images and Restart:

    cd /root/victoria-metrics-data
    docker compose pull
    docker compose up -d
    

  • View Logs:

    cd /root/victoria-metrics-data
    docker compose logs -f
    

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×