docker.recipes

Zabbix Monitoring

advanced

Enterprise-class monitoring solution for networks and applications.

Overview

Zabbix is an enterprise-grade monitoring platform developed since 2001 that provides comprehensive network, server, and application monitoring capabilities. The Zabbix server acts as the central processing engine, collecting and analyzing metrics from monitored hosts through multiple protocols including SNMP, IPMI, JMX, and custom agent communications. It processes trigger conditions, generates alerts, and maintains historical data for trend analysis and capacity planning. This stack combines the Zabbix server with PostgreSQL as the backend database and the Nginx-based web frontend, creating a complete monitoring infrastructure. PostgreSQL serves as the robust data repository for storing configuration data, historical metrics, events, and user settings, while the web interface provides visualization through dashboards, graphs, and administrative controls. The architecture supports distributed monitoring with proxy servers and can scale to monitor thousands of devices across multiple network segments. Organizations deploy this combination when they need enterprise-level monitoring with advanced features like predictive triggering, complex event correlation, and detailed performance analytics. The PostgreSQL backend ensures ACID compliance for critical monitoring data, while the Zabbix server's flexible template system and auto-discovery capabilities make it suitable for dynamic environments where infrastructure changes frequently.

Key Features

  • Multi-protocol data collection supporting Zabbix agents, SNMP v1/v2c/v3, IPMI, JMX, and SSH checks
  • Advanced trigger expressions with predictive functions and complex mathematical calculations
  • Auto-discovery of network devices, services, and file systems with automated host provisioning
  • Template inheritance system allowing hierarchical monitoring configuration management
  • PostgreSQL backend with partitioned tables for efficient storage of time-series monitoring data
  • Real-time and historical data visualization with customizable dashboards and graph widgets
  • Flexible notification system supporting email, SMS, Slack, and custom webhook integrations
  • Distributed monitoring architecture with proxy support for monitoring remote networks

Common Use Cases

  • 1Enterprise network operations centers monitoring thousands of network devices and servers
  • 2Cloud infrastructure monitoring with auto-discovery of dynamic AWS, Azure, or GCP resources
  • 3Application performance monitoring for web services with custom JMX and database metrics
  • 4IoT device monitoring using SNMP and custom protocols for industrial equipment
  • 5Compliance monitoring for SOX, HIPAA, or PCI-DSS requiring detailed audit trails
  • 6Hybrid cloud monitoring spanning on-premises data centers and public cloud instances
  • 7MSP (Managed Service Provider) multi-tenant monitoring with separate client dashboards

Prerequisites

  • Minimum 2GB RAM recommended (Zabbix server requires 1GB+ for moderate loads)
  • Available ports 8080 (web interface), 10051 (Zabbix server), and 10050 (agent communications)
  • Understanding of SNMP, network protocols, and basic database administration concepts
  • PostgreSQL password configured in environment variables or .env file
  • Network access to devices you plan to monitor via SNMP, SSH, or Zabbix agent protocols
  • Time synchronization across monitored infrastructure for accurate event correlation

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 postgres:
3 image: postgres:16-alpine
4 container_name: zabbix-postgres
5 environment:
6 POSTGRES_USER: zabbix
7 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
8 POSTGRES_DB: zabbix
9 volumes:
10 - postgres_data:/var/lib/postgresql/data
11 networks:
12 - zabbix
13
14 zabbix-server:
15 image: zabbix/zabbix-server-pgsql:alpine-6.4-latest
16 container_name: zabbix-server
17 environment:
18 DB_SERVER_HOST: postgres
19 POSTGRES_USER: zabbix
20 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
21 ports:
22 - "10051:10051"
23 depends_on:
24 - postgres
25 networks:
26 - zabbix
27
28 zabbix-web:
29 image: zabbix/zabbix-web-nginx-pgsql:alpine-6.4-latest
30 container_name: zabbix-web
31 environment:
32 DB_SERVER_HOST: postgres
33 POSTGRES_USER: zabbix
34 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
35 ZBX_SERVER_HOST: zabbix-server
36 ports:
37 - "8080:8080"
38 depends_on:
39 - zabbix-server
40 networks:
41 - zabbix
42
43volumes:
44 postgres_data:
45
46networks:
47 zabbix:
48 driver: bridge

.env Template

.env
1POSTGRES_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://www.zabbix.com/documentation/current/
  2. 2Web UI at http://localhost:8080 - default Admin/zabbix
  3. 3Install Zabbix agents on hosts to monitor them
  4. 4Import templates from Configuration > Templates for common services
  5. 5Agent port 10050, server port 10051 for active checks
  6. 6Supports SNMP, IPMI, JMX, and custom scripts for data collection

Individual Services(3 services)

Copy individual services to mix and match with your existing compose files.

postgres
postgres:
  image: postgres:16-alpine
  container_name: zabbix-postgres
  environment:
    POSTGRES_USER: zabbix
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    POSTGRES_DB: zabbix
  volumes:
    - postgres_data:/var/lib/postgresql/data
  networks:
    - zabbix
zabbix-server
zabbix-server:
  image: zabbix/zabbix-server-pgsql:alpine-6.4-latest
  container_name: zabbix-server
  environment:
    DB_SERVER_HOST: postgres
    POSTGRES_USER: zabbix
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
  ports:
    - "10051:10051"
  depends_on:
    - postgres
  networks:
    - zabbix
zabbix-web
zabbix-web:
  image: zabbix/zabbix-web-nginx-pgsql:alpine-6.4-latest
  container_name: zabbix-web
  environment:
    DB_SERVER_HOST: postgres
    POSTGRES_USER: zabbix
    POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    ZBX_SERVER_HOST: zabbix-server
  ports:
    - "8080:8080"
  depends_on:
    - zabbix-server
  networks:
    - zabbix

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 postgres:
5 image: postgres:16-alpine
6 container_name: zabbix-postgres
7 environment:
8 POSTGRES_USER: zabbix
9 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
10 POSTGRES_DB: zabbix
11 volumes:
12 - postgres_data:/var/lib/postgresql/data
13 networks:
14 - zabbix
15
16 zabbix-server:
17 image: zabbix/zabbix-server-pgsql:alpine-6.4-latest
18 container_name: zabbix-server
19 environment:
20 DB_SERVER_HOST: postgres
21 POSTGRES_USER: zabbix
22 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
23 ports:
24 - "10051:10051"
25 depends_on:
26 - postgres
27 networks:
28 - zabbix
29
30 zabbix-web:
31 image: zabbix/zabbix-web-nginx-pgsql:alpine-6.4-latest
32 container_name: zabbix-web
33 environment:
34 DB_SERVER_HOST: postgres
35 POSTGRES_USER: zabbix
36 POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
37 ZBX_SERVER_HOST: zabbix-server
38 ports:
39 - "8080:8080"
40 depends_on:
41 - zabbix-server
42 networks:
43 - zabbix
44
45volumes:
46 postgres_data:
47
48networks:
49 zabbix:
50 driver: bridge
51EOF
52
53# 2. Create the .env file
54cat > .env << 'EOF'
55POSTGRES_PASSWORD=changeme
56EOF
57
58# 3. Start the services
59docker compose up -d
60
61# 4. View logs
62docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/zabbix/run | bash

Troubleshooting

  • Zabbix server cannot connect to PostgreSQL: Verify POSTGRES_PASSWORD environment variable matches across all services and PostgreSQL container is fully initialized
  • Web interface shows database connection error: Check that zabbix-server container has completed database schema creation before zabbix-web starts, add restart: unless-stopped to handle race conditions
  • Hosts show as unreachable in monitoring: Ensure Zabbix agent port 10050 is open on target hosts and zabbix-server container can access your network segment
  • Performance issues with large datasets: Tune PostgreSQL shared_buffers and work_mem settings, consider implementing table partitioning for history and trends tables
  • Memory usage growing continuously: Configure housekeeping settings in Administration > General > Housekeeping to automatically remove old historical data
  • Alert notifications not working: Verify media types configuration and test SMTP/webhook connectivity from within the zabbix-server container network context

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space