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-8must 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:
-
Repository Setup: The official Zabbix repository package is downloaded from
https://repo.zabbix.comand installed to enable access to the required software versions. -
Package Installation: The following packages are installed via
apt: -
zabbix-server-mysql -
zabbix-frontend-php -
zabbix-apache-conf -
zabbix-sql-scripts -
zabbix-agent -
python3-mysqldb -
mariadb-server -
Database Initialization:
-
MariaDB is installed, enabled, and started.
-
A database named
zabbixis created withutf8mb4character encoding. -
A dedicated user
zabbixis created for the application. -
The initial SQL schema is imported from
/usr/share/zabbix-sql-scripts/mysql/server.sql.gz. -
Configuration:
-
The Zabbix server configuration file (
/etc/zabbix/zabbix_server.conf) is updated with the database password. -
Apache is configured to listen on port
8080for internal routing. -
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
8080and exposes the web interface externally via port443. -
Database Security:
-
Anonymous MySQL users are removed.
-
The
testdatabase 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
hostnetwork mode. -
Volumes:
-
nginx_secrets:/etc/letsencrypt(External volume for SSL certificates) -
/data/nginx/user_conf.d:/etc/nginx/user_conf.d -
Environment Variables:
-
Restart Policy:
unless-stopped
Application Update Instructions¶
To update the main application, perform the following steps:
-
For the Nginx proxy component:
-
For the Zabbix server and related system packages:
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_secretsDocker 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:
Stopping Services: