Building Zabbix 6 with Docker Compose

Zabbix6.2 Docker Containers

* This page contains promotional content

The Zabbix server I keep running all the time was on the old version 4, and partly because of template-related issues it seems the data cannot be migrated to 6.x, so I built Zabbix 6.x from scratch with Docker.
Maybe the data could be carried over by upgrading zabbix4 -> 5 –> 6 one step at a time, but in my case I do not monitor that many servers, so building 6.x in one go and configuring the monitoring again seemed more efficient.

Docker Zabbix

$ git clone https://github.com/zabbix/zabbix-docker.git
$ cd zabbix-docker
$ git branch
* 6.2

I use docker-compose_v3_alpine_pgsql_latest.yaml

$ cp docker-compose_v3_alpine_pgsql_latest.yaml docker-compose.yaml

PHP timezone setting

env_vars/.env_web

PHP_TZ=Asia/Tokyo

Editing docker-compose.yml

Ports 80 and 443 are used for something else so I changed them, but change them as appropriate.
I also changed agent to agent2

diff -u docker-compose_v3_alpine_pgsql_latest.yaml docker-compose.yaml
--- docker-compose_v3_alpine_pgsql_latest.yaml	2022-08-26 10:16:11.522715450 +0900
+++ docker-compose.yaml	2022-08-26 10:27:01.808759547 +0900
@@ -226,8 +226,8 @@
 zabbix-web-nginx-pgsql:
  image: zabbix/zabbix-web-nginx-pgsql:alpine-6.2-latest
  ports:
-   - "80:8080"
-   - "443:8443"
+   - "8081:8080"
+   - "8443:8443"
  volumes:
   - /etc/localtime:/etc/localtime:ro
   - /etc/timezone:/etc/timezone:ro
@@ -278,7 +278,7 @@
   com.zabbix.os: "alpine"

 zabbix-agent:
-  image: zabbix/zabbix-agent:alpine-6.2-latest
+  image: zabbix/zabbix-agent2:alpine-6.2-latest
  profiles:
   - full
   - all

Checking that it starts

$ docker-compose up -d

Check that you can log in (Admin/zabbix) at http://IP:8081
(At first it creates the DB and so on, so it takes a while.)

Starting the agent

The zabbix-agent container does not seem to start automatically, so start it manually

$ docker-compose up -d zabbix-agent

Set the interface of the host itself as follows in Zabbix host administration

Under Administration -> Hosts -> Interface, set the following
DNS name: zabbix-agent Connect to: DNS

Graphs turn into tofu

When you set the language to Japanese, the characters in the graph display turn into tofu boxes, so fix it by referring to the article below

See also