Skip to content

Deployment Overview of Zabbix server on Server

Prerequisites and Basic Requirements

To ensure a successful deployment, the following requirements must be met:

  • Operating System: Ubuntu (version matching the repository availability).

  • Privileges: Root or sudo access is required for package installation and service management.

  • Locales: en_US.UTF-8 must be generated on the system.

  • Network/Ports:

  • Port 443 (HTTPS) for external access via Nginx.

  • Port 8080 (HTTP) for internal service communication.

FQDN of the final panel on the hostkey.in domain

The application is accessible via a specific subdomain template based on the server ID.

Parameter Value
Prefix (None specified)
Domain hostkey.in
Full template {Server_ID_from_Invapi}.hostkey.in/zabbix

File and Directory Structure

The following directories are used for configuration and data management:

  • /root/nginx: Contains the Docker Compose file for the Nginx proxy.

  • /data/nginx/user_conf.d: Stores custom Nginx configuration files.

  • /data/nginx/nginx-certbot.env: Environment variables for Certbot.

  • /etc/zabbix/: Location of Zabbix server configuration files.

  • /etc/apache2/: Location of Apache web server configuration files.

Application installation process

The installation is performed using a combination of the APT package manager and Docker:

  1. Repository Setup: The official Zabbix repository package is downloaded from https://repo.zabbix.com and installed to enable access to the required software versions.

  2. Package Installation: The following packages are installed via apt:

  3. zabbix-server-mysql

  4. zabbix-frontend-php

  5. zabbix-apache-conf

  6. zabbix-sql-scripts

  7. zabbix-agent

  8. python3-mysqldb

  9. mariadb-server

  10. Database Initialization:

  11. MariaDB is installed, enabled, and started.

  12. A database named zabbix is created with utf8mb4 character encoding.

  13. A dedicated user zabbix is created for the application.

  14. The initial SQL schema is imported from /usr/share/zabbix-sql-scripts/mysql/server.sql.gz.

  15. Configuration:

  16. The Zabbix server configuration file (/etc/zabbix/zabbix_server.conf) is updated with the database password.

  17. Apache is configured to listen on port 8080 for internal routing.

  18. Proxy Setup: A Docker container running Nginx and Certbot is deployed to handle SSL termination and external traffic.

Access Rights and Security

  • Firewall/Ports: The application listens internally on port 8080 and exposes the web interface externally via port 443.

  • Database Security:

  • Anonymous MySQL users are removed.

  • The test database is removed.

  • The root user password is set to ensure secure local access.

  • Service Permissions: Zabbix services and Apache are configured to start automatically on system boot.

Databases

The application utilizes MariaDB as the primary data store.

Component Details
Database Name zabbix
Character Set utf8mb4
Collation utf8mb4_bin
Connection Method Localhost socket/TCP
User zabbix@localhost

Docker Containers and Their Deployment

The deployment utilizes a single application container managed via Docker Compose:

Nginx-Certbot Container

  • Image: jonasal/nginx-certbot:latest

  • Ports: Uses host network mode.

  • Volumes:

  • nginx_secrets:/etc/letsencrypt (External volume for SSL certificates)

  • /data/nginx/user_conf.d:/etc/nginx/user_conf.d

  • Environment Variables:

  • [email protected]

  • Restart Policy: unless-stopped

Application Update Instructions

To update the main application, perform the following steps:

  1. For the Nginx proxy component:

    docker compose pull && docker compose up -d
    

  2. For the Zabbix server and related system packages:

    apt update && apt upgrade zabbix-server-mysql zabbix-agent apache2
    

Location of configuration files and data

  • Zabbix Server Config: /etc/zabbix/zabbix_server.conf

  • Nginx Compose File: /root/nginx/compose.yml

  • SSL Certificates: Managed via the nginx_secrets Docker volume.

Available ports for connection

Port Service Access Type
443 HTTPS (via Nginx) External
8080 Apache/Zabbix Frontend Internal

Starting and Stopping the application

The following commands are used to manage the core services:

Starting Services:

systemctl start zabbix-server zabbix-agent apache2 mariadb

Stopping Services:

systemctl stop zabbix-server zabbix-agent apache2 mariadb

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×