Zabbix on Docker
Zabbix is an enterprise-class, open-source monitoring and observability platform — agents, SNMP, IPMI, JMX, HTTP checks, and trapper data feeding a single web frontend with templating, triggers, and alerting. This guide deploys the official multi-container stack with Docker Compose: a database backend (MySQL or PostgreSQL), the Zabbix server, and an Nginx-based web frontend, each in its own Alpine container, with optional profiles for the agent, SNMP traps, Java gateway, and web service.
| Requirement | Notes |
|---|---|
| Docker + Compose | Docker Engine v1.12+ and the Compose v2 plugin (v2.24.0 or greater) on the host |
| git + make | git to clone the official repo; make is optional but enables the convenience targets |
| Linux server | Any modern distribution; 2 vCPU / 4 GB RAM is a comfortable starting point for a small install |
| Open ports | 8080/TCP (web), 10051/TCP (server, for agents and proxies to connect in), 10050/TCP (agent), 162/UDP (SNMP traps, if used) |
Zabbix maintains ready-to-use Compose files in the zabbix-docker repository. Clone it and check out the version branch you want — pinning to a specific release rather than tracking a moving branch keeps upgrades deliberate.
compose.yaml for MySQL/MariaDB, compose_pgsql.yaml for PostgreSQL. This guide uses the MySQL file; substitute the PostgreSQL one wherever it appears if you prefer Postgres.Configuration is split across two layers. Compose-level variables in .env control which images, ports, and network ranges are used. Component-level variables in the env_vars/.env_<component> files control how each Zabbix process behaves.
...PasswordHere placeholder before the first start. The database user password must be consistent across the db, server, and web components — Zabbix wires this for you through the shared env files, so set it once in .env_db_mysql and don't hand-edit copies.By default the stack starts a minimal set — server, web frontend, and database — which keeps it lightweight. Additional components are gated behind Compose profiles, so you opt into only what you need. The table lists the common ones.
| Component | Role |
|---|---|
| zabbix-server | Core engine: collects data, evaluates triggers, sends alerts (always on) |
| zabbix-web | Nginx + PHP frontend, published on port 8080 (always on) |
| db | MySQL/MariaDB or PostgreSQL backing store (always on) |
| zabbix-agent | Monitors the Zabbix host itself; useful as a first test target |
| zabbix-snmptraps | Receives SNMP traps on 162/UDP for trap-based monitoring |
| zabbix-java-gateway | Adds JMX monitoring for Java applications |
| zabbix-web-service | Generates scheduled PDF reports from dashboards |
--profile all (or naming individual profiles) pulls in the extras.Bring everything up with the chosen Compose file. The first start pulls images, builds the internal networks, initialises the database schema, and starts each container in dependency order — this takes a minute or two while the database seeds.
make up for the default MySQL stack, or make up DB=pgsql OS=ubuntu for a PostgreSQL-on-Ubuntu build. Run make help to list targets. Whatever you pass to up, pass the same DB= value to down.A JSON response carrying the version string confirms the frontend and server are wired together correctly.
Open the web frontend in your browser. On a default deployment it listens on port 8080:
Admin / zabbix login is publicly documented and identical on every fresh install. Leaving it in place is equivalent to publishing your monitoring console's keys — anyone who reaches the URL has full administrative control over hosts, scripts, and alert actions.The simplest first target is the Zabbix host itself via the bundled agent (started with the agent profile). In the UI go to Data collection → Hosts → Create host, give it a name, attach the Linux by Zabbix agent template, and set the interface.
cannot connect to [127.0.0.1]:10050. Inside Docker the agent is not on localhost relative to the server — set the host's agent interface to the agent container's name or its IP on the Zabbix network (e.g. zabbix-agent), not 127.0.0.1.For network devices, add them with an SNMP interface instead of an agent interface, attach a matching SNMP template, and supply the community string or SNMPv3 credentials. After a few collection cycles the host's availability indicator turns green and data begins populating.
| Task | Command |
|---|---|
| Start stack | docker compose -f ./compose.yaml up -d |
| Stop stack | docker compose -f ./compose.yaml down |
| View logs (live) | docker compose -f ./compose.yaml logs -f zabbix-server |
| Check status | docker compose -f ./compose.yaml ps |
| Reload server config cache | docker compose exec zabbix-server zabbix_server -R config_cache_reload |
| Test agent reachability | docker compose exec zabbix-server zabbix_get -s zabbix-agent -k system.uptime |
| Makefile shortcut (up) | make up |
| Upgrade | git pull && docker compose -f ./compose.yaml pull && docker compose -f ./compose.yaml up -d |
