Deploying Zabbix Monitoring Platform with Docker Containers
This article provides a step‑by‑step guide to quickly set up the latest Zabbix monitoring platform using Docker, covering Docker installation, MySQL volume creation, deployment of Zabbix server, web UI, Java gateway, agents, and host configuration for comprehensive system monitoring.
Zabbix is a well‑known monitoring system that can uniformly monitor hardware, operating systems, databases, networks, and more, offering UI, alerting, service discovery, and other features.
Because Zabbix involves many components, manual installation can be cumbersome; this guide shows how to use Docker containers to rapidly deploy the latest Zabbix version.
Zabbix Architecture
The main components are:
Zabbix server – receives data from agents and provides core functions.
Database – stores monitoring data and configuration (MySQL or PostgreSQL).
Zabbix web – UI for control and visualization.
Zabbix Java gateway – monitors JVM metrics.
Zabbix agent – runs on target hosts to collect data.
Install Docker
Configure the official yum repository and install Docker:
$ sudo yum install -y yum-utils
$ sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo $ sudo yum install docker-ce docker-ce-cli containerd.io $ sudo systemctl start docker $ docker versionDeploy Zabbix Components
Use MySQL 8.0 as the database. Create Docker volumes for data, logs, and configuration:
$ docker volume create -d local mysql_data # store MySQL data
$ docker volume create -d local mysql_logs # store MySQL logs
$ docker volume create -d local mysql_conf # store MySQL config filesRun the MySQL container:
$ docker run --name mysql-server -t \
-v mysql_data:/var/lib/mysql \
-v mysql_logs:/var/log/mysql \
-v mysql_conf:/etc/mysql \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="zabbix_pwd" \
-e MYSQL_ROOT_PASSWORD="123456" \
--restart=unless-stopped \
-d mysql:8.0 \
--character-set-server=utf8 --collation-server=utf8_bin \
--default-authentication-plugin=mysql_native_passwordDeploy the Zabbix Java gateway:
$ docker pull zabbix/zabbix-java-gateway:alpine-6.2-latest $ docker run --name zabbix-java-gateway -t \
--restart=unless-stopped \
-d zabbix/zabbix-java-gateway:alpine-6.2-latestDeploy the Zabbix server (MySQL backend):
$ docker pull zabbix/zabbix-server-mysql:6.2-alpine-latest $ docker volume create -d local zabbix_server $ docker run --name zabbix-server-mysql -t \
-v zabbix_server:/etc/zabbix \
-e DB_SERVER_HOST="mysql-server" \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="zabbix_pwd" \
-e MYSQL_ROOT_PASSWORD="123456" \
-e ZBX_JAVAGATEWAY="zabbix-java-gateway" \
--link mysql-server:mysql \
--link zabbix-java-gateway:zabbix-java-gateway \
--restart=unless-stopped \
-p 10051:10051 \
-d zabbix/zabbix-server-mysql:alpine-6.2-latestDeploy the Zabbix web interface (NGINX + MySQL):
$ docker pull zabbix/zabbix-web-nginx-mysql:alpine-6.2-latest $ docker run --name zabbix-web-nginx-mysql -t \
-e PHP_TZ="Asia/Shanghai" \
-e ZBX_SERVER_HOST="zabbix-server-mysql" \
-e DB_SERVER_HOST="mysql-server" \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="zabbix_pwd" \
-e MYSQL_ROOT_PASSWORD="123456" \
--link mysql-server:mysql \
--link zabbix-server-mysql:zabbix-server \
-p 80:8080 \
--restart unless-stopped \
-d zabbix/zabbix-web-nginx-mysql:alpine-6.2-latestInstall Zabbix Agent
Pull the agent image and create a volume for its configuration:
$ docker pull zabbix/zabbix-agent:alpine-6.2-latest $ docker volume create -d local zabbix_agentRun the agent container (adjust ZBX_SERVER_HOST to the server IP as needed):
$ docker run --name zabbix-agent -t \
-v zabbix_agent:/etc/zabbix \
-e ZBX_HOSTNAME="host-01" \
-e ZBX_SERVER_HOST="192.168.214.112" \
-e ZBX_SERVER_PORT=10051 \
-p 10050:10050 \
--restart=unless-stopped \
--privileged \
-d zabbix/zabbix-agent:alpine-6.2-latestAdd Hosts in Zabbix UI
After agents are running, log into the Zabbix web UI (default user: Admin, password: zabbix), create a new host, and assign the appropriate templates. The host will appear in the monitoring dashboard once data is received.
Conclusion
Containerized deployment of Zabbix simplifies installation and management, allowing rapid setup of a full‑featured monitoring environment while freeing technical staff from time‑consuming manual configuration.
DevOps Operations Practice
We share professional insights on cloud-native, DevOps & operations, Kubernetes, observability & monitoring, and Linux systems.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.