Deployment Overview of VictoriaMetrics on Server¶
Prerequisites and Basic Requirements¶
The deployment requires a Linux-based server with the following specifications:
-
Root privileges or
sudoaccess to execute Docker commands. -
Docker and Docker Compose installed and running on the host system.
-
Network access to the
hostkey.indomain for DNS resolution. -
Ports
80,443,8427, and8428must 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:
-
Creating the base directory
/root/victoria-metrics-data. -
Generating the
compose.ymlandauthconfig.ymlfiles. -
Creating the external Docker volume named
victoriametrics. -
Starting the services using
docker compose up -dfrom the/root/victoria-metrics-datadirectory.
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-dataandvictoriametrics -
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
victoriametricscontainer.
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.don the host is mounted to/etc/nginx/user_conf.dinside the container. -
Secrets Storage: The
nginx_secretsvolume 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.ymlandauthconfig.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:
-
Stop Services:
-
Update Images and Restart:
-
View Logs: