*Cube-Host– full cloud services!!

Zabbix is a full-featured monitoring platform that can track servers, network devices, applications, logs, and business metrics, then alert you when something is wrong (before users notice). In this guide, you’ll deploy a production-ready Zabbix stack on Ubuntu Server with a database + web interface, then do the “first 30 minutes” of hardening and initial setup.
What this tutorial covers: installing the latest Zabbix packages on Ubuntu Server (recommended: Ubuntu 24.04 LTS), configuring MariaDB, configuring NGINX/PHP-FPM for the frontend, starting services, opening the right ports, and connecting your first host with encrypted agent traffic. If you’re deploying on a fresh Linux VPS, this flow is especially smooth because you control firewall, PHP version, and server resources end-to-end.
monitor.your-domain.com for HTTPS later.| Port | Who listens | Why it’s needed | Typical firewall rule |
|---|---|---|---|
| 80/tcp | NGINX | Web UI (HTTP) | Allow from your IPs (or everyone if public) |
| 443/tcp | NGINX | Web UI (HTTPS) | Allow from your IPs (recommended) |
| 10051/tcp | Zabbix server | Trappers, proxies, active agents | Allow from proxies/agents that use active checks |
| 10050/tcp | Zabbix agent (on monitored hosts) | Passive checks (server polls agent) | Allow on monitored hosts, not necessarily on the Zabbix server |
Start with updates, correct time, and a clean baseline. Accurate time matters because Zabbix correlates events, trends, and alerts by timestamps.
sudo apt update
sudo apt -y upgrade
# Set timezone (example: Europe/Berlin)
sudo timedatectl set-timezone Europe/Berlin
# Time sync (Chrony is a solid default on servers)
sudo apt -y install chrony
sudo systemctl enable --now chrony
# Optional but recommended: basic tools
sudo apt -y install curl wget gnupg lsb-release unzip
Tip for VPS: if you’re running Zabbix on VPS hosting, use provider-side monitoring too (CPU/RAM/Disk graphs in the control panel). It helps you understand whether Zabbix alerts are caused by the host itself or by the application inside the VPS.
Zabbix stores configuration + metrics in a database. MariaDB is a popular choice for Linux monitoring stacks. For small/medium installations it’s fast, predictable, and easy to maintain.
sudo apt -y install mariadb-server
sudo systemctl enable --now mariadb
# Basic hardening wizard (set root password, remove test DB, etc.)
sudo mysql_secure_installation
Create the Zabbix database and a dedicated user. Use a strong password (treat it like a production secret).
sudo mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'REPLACE_WITH_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Zabbix frontend is a PHP application. The easiest approach on Ubuntu is NGINX + PHP-FPM. We’ll also install Certbot later (optional) to enable HTTPS.
sudo apt -y install nginx php-fpm
sudo systemctl enable --now nginx
Now tune a few PHP parameters that often cause “requirements not met” warnings in the Zabbix installer (timezone and input limits). Your PHP version may differ (Ubuntu 24.04 usually uses PHP 8.3).
# Find your installed PHP-FPM version directory
ls /etc/php/
# Example for PHP 8.3:
sudo nano /etc/php/8.3/fpm/php.ini
# Set/verify:
# date.timezone = Europe/Berlin
# max_execution_time = 300
# max_input_time = 300
# post_max_size = 16M
# max_input_vars = 10000
sudo systemctl restart php8.3-fpm
Zabbix provides official repositories for Ubuntu. The standard pattern is: install the zabbix-release package, refresh APT, then install server + frontend + SQL scripts + agent.
Note: if your company prefers long-term stability, choose the latest LTS branch. If you prefer the newest features and improvements, choose the latest stable branch. The installation flow is the same — the repository link changes.
# Example: Zabbix 7.4 repository for Ubuntu 24.04 (adjust version if needed)
cd /tmp
wget https://repo.zabbix.com/zabbix/7.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.4-1+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_7.4-1+ubuntu24.04_all.deb
sudo apt update
# Install Zabbix server + frontend + NGINX config + SQL scripts + Agent 2
sudo apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2
This step creates tables and baseline data Zabbix needs. It can take a few minutes depending on disk speed.
# Import schema (recommended: use zcat to avoid manual unpacking)
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
If import fails, check the error message. Common causes: wrong password, not enough disk space, or MySQL/MariaDB settings that are too strict for your environment.
Open the server config and set the DB password you created earlier.
sudo nano /etc/zabbix/zabbix_server.conf
# Set:
# DBPassword=REPLACE_WITH_STRONG_PASSWORD
Performance tip: once you monitor more hosts, you’ll likely tune values like CacheSize and StartPollers. Don’t optimize blindly on day one — measure first (CPU, DB load, queue size), then adjust.
With zabbix-nginx-conf, Zabbix ships an NGINX site template. Update the server name (your domain) and ensure the PHP-FPM socket/version matches your system.
sudo nano /etc/zabbix/nginx.conf
# Common edits:
# listen 80;
# server_name monitor.your-domain.com;
# (and verify the PHP-FPM socket path if your distro differs)
Then restart NGINX:
sudo systemctl restart nginx
sudo systemctl enable --now zabbix-server zabbix-agent2
sudo systemctl status zabbix-server --no-pager
sudo systemctl status zabbix-agent2 --no-pager
If Zabbix server does not start, immediately check logs:
sudo tail -n 200 /var/log/zabbix/zabbix_server.log
On Ubuntu, UFW is often the simplest option. Ideally, limit the web interface to your office/VPN IPs and limit port 10051 to known proxies/agents.
sudo apt -y install ufw
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
# Zabbix server port (only if you use proxies/active agents from outside)
sudo ufw allow 10051/tcp
sudo ufw enable
sudo ufw status
Open in a browser:
http://SERVER_IP/
# or
http://monitor.your-domain.com/
Follow the Zabbix installer steps, point it to your MariaDB database, then log in. Immediately change the default admin password, create a separate admin user for yourself, and keep the original “Admin” account as an emergency account (or disable it if your policy requires).
Zabbix Agent 2 is the modern agent with plugin support and better extensibility. On the same server, you can enable PSK encryption so metrics are not sent in plain text.
On the agent (this server): generate a PSK file and update agent settings.
sudo openssl rand -hex 32 | sudo tee /etc/zabbix/agent2.psk > /dev/null
sudo chmod 600 /etc/zabbix/agent2.psk
sudo nano /etc/zabbix/zabbix_agent2.conf
# Set/verify:
# Server=127.0.0.1
# ServerActive=127.0.0.1
# TLSConnect=psk
# TLSAccept=psk
# TLSPSKIdentity=PSK-LOCAL-001
# TLSPSKFile=/etc/zabbix/agent2.psk
sudo systemctl restart zabbix-agent2
In the Zabbix UI: go to Data collection → Hosts, open your host, then set the interface to Agent and configure Encryption with the same PSK identity and the PSK value (contents of /etc/zabbix/agent2.psk). Attach a Linux template (for example, “Linux by Zabbix agent”) and confirm data starts flowing.
Even for internal monitoring, HTTPS is worth it (credentials and dashboards should not travel unencrypted). If your Zabbix UI is reachable via a domain name, you can issue a certificate with Let’s Encrypt.
sudo apt -y install certbot python3-certbot-nginx
sudo certbot --nginx -d monitor.your-domain.com
If you’re still choosing server software for your monitoring stack, also read about Linux VPS options and consider whether your environment needs Windows-specific tooling (in that case, a Windows VPS may be a better fit).
/etc/zabbix/zabbix_server.conf, verify schema import completed, check /var/log/zabbix/zabbix_server.log.systemctl status php8.3-fpm) and update socket path.php.ini, then restart PHP-FPM.