Skip to content

Zabbix Server (PostgreSQL)

This document describes how we deploy Zabbix Server using Docker Compose with PostgreSQL.

Components

  • PostgreSQL: stores Zabbix configuration + history/trends
  • Zabbix Server: core engine (polling, preprocessing, discovery, receiving data from proxies)
  • Zabbix Web: UI (described in web.md)

Docker images: - postgres:15-alpine - zabbix/zabbix-server-pgsql:ubuntu-7.2.4

Network / Ports

  • Zabbix Server listens on TCP 10051
  • PostgreSQL listens on TCP 5432 (internal use; expose only if needed)
  • Both services are attached to iims_zbx_net with static IPs from environment variables:
  • ${WLAN_VLAN_ZABBIX_DB}
  • ${WLAN_VLAN_ZABBIX_SERVER}

Docker Compose (reference)

Passwords must be changed from default placeholders.

services:
  zabbix-db:
    image: postgres:15-alpine
    container_name: zabbix-db
    restart: always
    environment:
      POSTGRES_USER: zabbix
      POSTGRES_PASSWORD: CHANGE_ME_STRONG_PASSWORD
      POSTGRES_DB: zabbix
    volumes:
      - zabbix-db-data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      iims_zbx_net:
        ipv4_address: ${WLAN_VLAN_ZABBIX_DB}

  zabbix-server:
    image: zabbix/zabbix-server-pgsql:ubuntu-7.2.4
    container_name: zabbix-server
    restart: always
    depends_on:
      - zabbix-db
    environment:
      DB_SERVER_HOST: zabbix-db
      POSTGRES_USER: zabbix
      POSTGRES_PASSWORD: CHANGE_ME_STRONG_PASSWORD
      POSTGRES_DB: zabbix

      # Performance tuning
      ZBX_STARTPOLLERS: "50"
      ZBX_STARTTRAPPERS: "10"
      ZBX_STARTPREPROCESSORS: "20"
      ZBX_STARTDISCOVERERS: "10"
      ZBX_STARTPINGERS: "10"
      ZBX_STARTHTTPAGENTPOLLERS: "10"
      ZBX_STARTHISTORYPOLLERS: "10"
      ZBX_STARTDBSYNCERS: "4"
      ZBX_CACHESIZE: "1G"

    ports:
      - "10051:10051"
    networks:
      iims_zbx_net:
        ipv4_address: ${WLAN_VLAN_ZABBIX_SERVER}

volumes:
  zabbix-db-data:

networks:
  iims_zbx_net:
    external: true

Deploy / Start

From the folder containing docker-compose.yml:

docker compose up -d
docker ps

Follow server logs:

docker logs -f zabbix-server

On first startup, the server initializes the database schema. This may take a few minutes.

Validation

1) Check listening port

From the host (or any machine that can reach the server):

nc -vz <ZABBIX_SERVER_IP> 10051

2) Check logs for DB connection success

docker logs --tail=200 zabbix-server

Performance / Tuning Notes

Zabbix Server performance depends heavily on:

  • number of items (especially SNMP)
  • history/trend storage volume
  • preprocessing load
  • database performance (disk/IOPS)

Tuning parameters used here:

  • ZBX_STARTPOLLERS: parallel polling workers
  • ZBX_STARTPREPROCESSORS: preprocessing pipelines
  • ZBX_STARTDISCOVERERS: network discovery workers
  • ZBX_STARTPINGERS: ICMP workers
  • ZBX_STARTDBSYNCERS: DB write sync processes
  • ZBX_CACHESIZE: in-memory cache for config/history

If queue grows or items become delayed, review: Monitoring → Queue (UI) and adjust pollers/preprocessors accordingly.