How to Install Zabbix Server in (Ubuntu 22.04 / 24.04)

admin • May 15, 2026
| 8 min read | 30 views views

Part 1 — Install Zabbix Server (Ubuntu 22.04 / 24.04)

Step 1: Add Zabbix repo

bash

wget https://repo.zabbix.com/zabbix/7.2/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.2+ubuntu24.04_all.deb
dpkg -i zabbix-release_latest_7.2+ubuntu24.04_all.deb
apt update

Adjust the URL for your Ubuntu version (22.04 / 24.04). Check repo.zabbix.com for the latest.

Step 2: Install server, frontend, agent

bash

apt install -y zabbix-server-mysql zabbix-frontend-php \
  zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2

Step 3: Setup MySQL database

sql

mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongPass123!';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
EXIT;

bash

# Import schema
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | \
  mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Step 4: Configure Zabbix server

bash

nano /etc/zabbix/zabbix_server.conf

Set these values:

ini

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=StrongPass123!

Step 5: Configure Nginx

bash

nano /etc/zabbix/nginx.conf

nginx

listen 80;
server_name your-server-ip-or-domain;

Step 6: Start & enable services

bash

systemctl restart zabbix-server zabbix-agent2 nginx php8.3-fpm
systemctl enable zabbix-server zabbix-agent2 nginx php8.3-fpm

Step 7: Open firewall ports

bash

ufw allow 10050/tcp   # agent passive
ufw allow 10051/tcp   # server
ufw allow 80/tcp      # web UI

Web setup wizard: go to http://<server-ip> and complete the setup (DB credentials, timezone). Default login: Admin / zabbix.


Part 2 — Install Zabbix Agent on Clients

Linux client (Ubuntu/Debian)

bash

# Add repo (same as server)
wget https://repo.zabbix.com/zabbix/7.2/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.2+ubuntu24.04_all.deb
dpkg -i zabbix-release_latest_7.2+ubuntu24.04_all.deb
apt update
apt install -y zabbix-agent2

# Configure
nano /etc/zabbix/zabbix_agent2.conf

Set these:

ini

Server=<zabbix-server-ip>          # passive: server polls agent
ServerActive=<zabbix-server-ip>    # active: agent pushes to server
Hostname=client-hostname           # must match what you set in Zabbix UI

bash

systemctl restart zabbix-agent2
systemctl enable zabbix-agent2
ufw allow 10050/tcp

Windows client

  1. Download the .msi installer from zabbix.com/download
  2. During install, set:
    • Zabbix server IP: your server IP
    • Hostname: the Windows hostname
  3. The service Zabbix Agent 2 starts automatically.
  4. Allow port 10050 in Windows Firewall.

Oracle Linux / RHEL / CentOS

bash

rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/el/9/x86_64/zabbix-release-latest-7.2.el9.noarch.rpm
dnf install -y zabbix-agent2
# same config as Linux above
systemctl enable --now zabbix-agent2
firewall-cmd --permanent --add-port=10050/tcp && firewall-cmd --reload

Part 3 — Add Host in Zabbix UI

  1. Go to Configuration → Hosts → Create host
  2. Fill in:
    • Host name — must match Hostname in agent config
    • Interfaces → Agent — enter client IP, port 10050
  3. Under Templates, add Linux by Zabbix agent (or Windows equivalent)
  4. Click Add

Within a minute the host status turns green (ZBX icon) if the agent is reachable.


Quick reference

ComponentPortDirection
Zabbix Server10051receives from active agents
Zabbix Agent (passive)10050server polls agent
Web UI80/443browser → nginx

Passive mode = server initiates, pulls data from agent (default).
Active mode = agent initiates, pushes data to server (better for NAT/firewall scenarios).

#linux #monitoring system #opensource #ubuntu #zabbix #zabbix server

admin

Author at The Sharing KH

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *