How to Deploy Zabbix – Open-Source Monitoring Platform

Updated on 16 April, 2026
Deploy Zabbix with Docker and Traefik for secure, self-hosted infrastructure monitoring and alerts.
How to Deploy Zabbix – Open-Source Monitoring Platform header image

Zabbix is an open-source monitoring platform that tracks the health and performance of servers, networks, applications, and services. It collects metrics, triggers alerts based on configurable thresholds, and provides dashboards for visualizing infrastructure status. Zabbix supports monitoring through agents, Java Management Extensions (JMX), and custom scripts.

This article explains how to deploy Zabbix using Docker Compose with a MySQL database and a Traefik reverse proxy that provisions an HTTPS certificate through Let's Encrypt.

Prerequisites

Before you begin, you need to:

Set Up the Project Directory

The project directory holds the Docker Compose file and environment variables for the deployment.

  1. Create the project directory.

    console
    $ mkdir ~/zabbix-docker
    
  2. Enter the project directory.

    console
    $ cd ~/zabbix-docker
    
  3. Create the environment variable file.

    console
    $ nano .env
    
  4. Add the following variables:

    ini
    DOMAIN=zabbix.example.com
    LETSENCRYPT_EMAIL=admin@example.com
    MYSQL_PASSWORD=YOUR_DB_PASSWORD
    MYSQL_ROOT_PASSWORD=YOUR_ROOT_PASSWORD
    

    Replace the placeholders:

    • zabbix.example.com: Your registered domain name.
    • admin@example.com: Your email address for Let's Encrypt certificate notifications.
    • YOUR_DB_PASSWORD: A strong password for the zabbix database user.
    • YOUR_ROOT_PASSWORD: A strong password for the MySQL root account.

    Save and close the file.

Deploy with Docker Compose

The Compose file defines the Traefik reverse proxy, the Zabbix Server, the Zabbix web frontend, the MySQL database, and the Zabbix Agent.

  1. Add your user to the docker group to run Docker commands without sudo.

    console
    $ sudo usermod -aG docker $USER
    
  2. Apply the group change to your current session.

    console
    $ newgrp docker
    
  3. Create the Docker Compose file.

    console
    $ nano docker-compose.yaml
    
  4. Add the following configuration:

    yaml
    services:
      traefik:
        image: traefik:v3.6
        container_name: traefik
        restart: unless-stopped
        command:
          - "--providers.docker=true"
          - "--providers.docker.exposedbydefault=false"
          - "--entrypoints.web.address=:80"
          - "--entrypoints.websecure.address=:443"
          - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
          - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
          - "--certificatesresolvers.le.acme.httpchallenge=true"
          - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web"
          - "--certificatesresolvers.le.acme.email=${LETSENCRYPT_EMAIL}"
          - "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json"
        ports:
          - "80:80"
          - "443:443"
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - ./letsencrypt:/letsencrypt
        networks:
          - zabbix-net
    
      mysql-server:
        image: mysql:8.4.8
        container_name: zabbix-mysql
        environment:
          MYSQL_DATABASE: zabbix
          MYSQL_USER: zabbix
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
        volumes:
          - ./mysql-data:/var/lib/mysql
        networks:
          - zabbix-net
        restart: unless-stopped
    
      zabbix-server:
        image: zabbix/zabbix-server-mysql:7.4.8-alpine
        container_name: zabbix-server
        environment:
          DB_SERVER_HOST: mysql-server
          MYSQL_DATABASE: zabbix
          MYSQL_USER: zabbix
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
          MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
        ports:
          - "10051:10051"
        volumes:
          - ./zabbix-server-data:/var/lib/zabbix
        networks:
          - zabbix-net
        depends_on:
          - mysql-server
        restart: unless-stopped
    
      zabbix-web:
        image: zabbix/zabbix-web-apache-mysql:7.4.8-alpine
        container_name: zabbix-web
        environment:
          DB_SERVER_HOST: mysql-server
          MYSQL_DATABASE: zabbix
          MYSQL_USER: zabbix
          MYSQL_PASSWORD: ${MYSQL_PASSWORD}
          ZBX_SERVER_HOST: zabbix-server
          PHP_TZ: UTC
        networks:
          - zabbix-net
        depends_on:
          - mysql-server
          - zabbix-server
        restart: unless-stopped
        labels:
          - "traefik.enable=true"
          - "traefik.http.routers.zabbix.rule=Host(`${DOMAIN}`)"
          - "traefik.http.routers.zabbix.entrypoints=websecure"
          - "traefik.http.routers.zabbix.tls=true"
          - "traefik.http.routers.zabbix.tls.certresolver=le"
          - "traefik.http.services.zabbix.loadbalancer.server.port=8080"
    
      zabbix-agent:
        image: zabbix/zabbix-agent:7.4.8-alpine
        container_name: zabbix-agent
        environment:
          ZBX_HOSTNAME: "Zabbix server"
          ZBX_SERVER_HOST: zabbix-server
        ports:
          - "10050:10050"
        networks:
          - zabbix-net
        depends_on:
          - zabbix-server
        restart: unless-stopped
    
    networks:
      zabbix-net:
        driver: bridge
    

    Save and close the file.

    The configuration defines the following services:

    • traefik: Handles all external web traffic on ports 80 and 443. It provisions and renews TLS certificates from Let's Encrypt and routes HTTPS requests to the Zabbix web interface using Docker labels.
    • mysql-server: Runs MySQL 8.4 and stores all Zabbix configuration and monitoring data. Database credentials are read from the .env file.
    • zabbix-server: Collects metrics from agents, processes data, and evaluates alert triggers.
    • zabbix-web: The Apache-based web frontend. Traefik routes HTTPS traffic from ${DOMAIN} to port 8080 on this container.
    • zabbix-agent: Monitors the local host and sends metrics to zabbix-server.
  5. Start all services in detached mode.

    console
    $ docker compose up -d
    
  6. Verify that all containers are running.

    console
    $ docker compose ps
    

    The output displays five running containers: Traefik, MySQL, Zabbix Server, Zabbix Web, and Zabbix Agent.

Access the Zabbix Web Interface

The Zabbix web interface is accessible at the domain configured in the .env file after Traefik provisions the TLS certificate.

  1. Open a web browser and navigate to the Zabbix web interface. Replace zabbix.example.com with the domain you set in DOMAIN.

    https://zabbix.example.com
  2. Log in using the default credentials.

    • Username: admin
    • Password: zabbix

    Zabbix login page

    The Zabbix Global view dashboard loads after a successful login. It displays host availability, top hosts by CPU usage, system information, and any active alerts.

  3. Change the default admin password. Expand Users in the left sidebar and click Users.

  4. Click Admin in the user list to open the user edit page.

  5. Click the Change password button next to the Password field.

    The page reveals the Current password, Password, and Password (once again) fields.

  6. Enter zabbix in the Current password field.

  7. Enter a new secure password in the Password and Password (once again) fields.

  8. Click Update to save the new password.

Verify Zabbix Is Running

Confirm that Zabbix is collecting data from the configured agent.

  1. Navigate to Monitoring > Hosts from the left sidebar.

  2. Check the ZBX availability badge for the Zabbix server host.

    In Docker deployments, this badge appears red by default because Zabbix attempts to reach the agent at 127.0.0.1:10050 — the server container's own loopback address, not the agent container's address. The next step fixes this.

    Zabbix host availability badge appearing red

  3. Update the agent interface to use the Docker service name instead of the loopback address.

    1. Click the host name Zabbix server in the Hosts list. A context menu appears.
    2. Under CONFIGURATION, click Host. The Host configuration dialog opens.
    3. In the Interfaces section, locate the Agent row. Change the Connect to option from IP to DNS and enter zabbix-agent in the DNS name field.
    4. Click Update.

    The Hosts page displays a Host updated confirmation banner.

  4. Refresh the Hosts page after a few moments. The ZBX badge turns green, confirming the agent is connected and sending data to the server.

    Zabbix Hosts page green ZBX badge

  5. Navigate to Monitoring > Latest data to view real-time metrics.

  6. In the Hosts field, type Zabbix server, select it from the results, then click Apply.

    CPU usage, memory consumption, and network traffic metrics appear in the list, confirming that Zabbix is collecting data from the agent.

  7. Navigate to Dashboard to view the default dashboard. The dashboard shows one host available with a green status, confirming the monitoring setup is complete.

    Zabbix dashboard

Conclusion

You have successfully deployed Zabbix on your Linux server using Docker Compose with Traefik providing automatic HTTPS through Let's Encrypt. The Zabbix Agent monitors the local host and reports CPU usage, memory consumption, and network traffic to the Zabbix Server. For more information, visit the official Zabbix documentation.

Comments