Skip to content

How to Install Zabbix Agent 2 on Ubuntu and AlmaLinux (Zabbix 7.0 LTS)

2 min read

Applies to: Zabbix Agent 2 from Zabbix 7.0 LTS on Ubuntu 24.04, Debian 13, AlmaLinux and Rocky Linux 9

Zabbix is a free, open-source monitoring system: a central Zabbix server collects data such as CPU, memory, disk and service status from agents on the servers you monitor, draws graphs and sends alerts. This guide installs Zabbix Agent 2 on a server you want to monitor. We installed Zabbix Agent 2 version 7.0.31 on AlmaLinux 9 from Zabbix’s own repository.

1. Add the Zabbix repository

AlmaLinux and Rocky Linux 9: first stop EPEL from offering its own, older Zabbix packages by adding excludepkgs=zabbix* under [epel] in /etc/yum.repos.d/epel.repo (if EPEL is installed). Then:

sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/alma/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
sudo dnf clean all
sudo dnf install zabbix-agent2

Ubuntu 24.04:

wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.0+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_latest_7.0+ubuntu24.04_all.deb
sudo apt update
sudo apt install zabbix-agent2

For other versions, pick your system on the Zabbix download page.

2. Point it at your Zabbix server

Edit /etc/zabbix/zabbix_agent2.conf:

Server=203.0.113.50          # your Zabbix server (for passive checks)
ServerActive=203.0.113.50    # your Zabbix server (for active checks)
Hostname=web01               # must match the host name you create in Zabbix

3. Start it and open the port

sudo systemctl enable --now zabbix-agent2
sudo ss -ltnp | grep 10050
sudo firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="203.0.113.50" port port="10050" protocol="tcp" accept' && sudo firewall-cmd --reload
# Ubuntu: sudo ufw allow from 203.0.113.50 to any port 10050 proto tcp

Allow port 10050 only from your Zabbix server.

4. Test it

zabbix_agent2 -t agent.version

It printed [s|7.0.31] in our test. Then add the host in the Zabbix web interface (Data collection › Hosts › Create host) with the same host name and the Linux by Zabbix agent template.

Older guide for Debian 8 and 9: install Zabbix agent on Debian. Prefer to have it done for you? See our server monitoring.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket