Deploy Zabbix 6.4 with Docker‑Compose
This guide demonstrates how to deploy the enterprise‑grade Zabbix 6.4 monitoring platform using Docker‑Compose, detailing the full docker‑compose.yml configuration, required environment variables, container settings, and startup commands, enabling users to launch the service and access the web interface.
Zabbix is an enterprise‑grade, distributed, open‑source monitoring solution that can monitor applications, databases, networks, and operating systems, and since version 6.x also supports Kubernetes monitoring. The following docker‑compose.yml file defines the complete setup for Zabbix 6.4.
version: '3.9'
services:
zabbix-mysql8:
image: mysql:8.0
container_name: zabbix-mysql8
security_opt:
- seccomp:unconfined
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_bin, --default-authentication-plugin=mysql_native_password]
restart: always
networks:
- zabbix_net
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=123456
volumes:
- /etc/localtime:/etc/localtime:ro
- ./mysql8/data:/var/lib/mysql
zabbix-server:
image: zabbix/zabbix-server-mysql
container_name: zabbix-server
restart: always
networks:
- zabbix_net
depends_on:
- zabbix-mysql8
ports:
- 10051:10051
environment:
- DB_SERVER_HOST=zabbix-mysql8
- MYSQL_DATABASE=zabbix
- MYSQL_USER=zabbix
- MYSQL_PASSWORD=password
- MYSQL_ROOT_PASSWORD=123456
volumes:
- /etc/localtime:/etc/localtime:ro
- ./zabbix-server/alertscripts:/usr/lib/zabbix/alertscripts
zabbix-web:
image: zabbix/zabbix-web-nginx-mysql
container_name: zabbix-web
restart: always
networks:
- zabbix_net
depends_on:
- zabbix-mysql8
ports:
- 80:8080
environment:
- DB_SERVER_HOST=zabbix-mysql8
- MYSQL_USER=zabbix
- MYSQL_PASSWORD=password
- ZBX_SERVER_HOST=zabbix-server
- PHP_TZ=Asia/Shanghai
volumes:
- /etc/localtime:/etc/localtime:ro
zabbix-agent2:
image: zabbix/zabbix-agent2
container_name: zabbix-agent2
restart: always
networks:
- zabbix_net
environment:
- ZBX_SERVER_HOST=zabbix-server
- ZBX_SERVER_PORT=10051
volumes:
- /etc/localtime:/etc/localtime:ro
networks:
zabbix_net:
driver: bridgeAfter saving the file, start the containers with docker compose up -d (or start the MySQL service first with docker compose up zabbix-mysql -d && sleep 5 ) and wait for initialization.
When the services are up, the Zabbix web interface becomes accessible at http:// :8080 , where you can log in using the default credentials and begin monitoring your infrastructure.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
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.