The Zabbix agent is a lightweight daemon that runs on hosts you want to monitor. It collects metrics (CPU, memory, disk, processes, logs, and more) and sends them to the Zabbix server or proxy on demand (passive checks) or on a schedule (active checks). This guide walks you through installing and configuring the Zabbix agent (7.0 LTS) on Rocky Linux and AlmaLinux 8, 9 or 10, enabling it with systemd, and opening the correct firewall port.
In this guide you’ll learn:
- How to add the Zabbix 7.0 LTS repository and install the Zabbix agent on Rocky Linux / AlmaLinux
- Whether to use the classic
zabbix-agentor the newerzabbix-agent2 - How to configure
Server,ServerActive, andHostnameinzabbix_agentd.conf - How to allow port 10050 (firewalld), handle SELinux, and start/enable the agent
Check types:
- Passive checks – The Zabbix server or proxy connects to the agent on port 10050 and requests data.
- Active checks – The agent connects out to the server/proxy and pushes data periodically.
If you need to set up the server, see Zabbix 7 With PostgreSQL and Nginx on Rocky/Alma Linux 9. Older guides cover Zabbix Server 6 on Rocky Linux/Alma Linux 9 and Zabbix Server 5 on Rocky Linux/Alma Linux 8.
The agent version should match the server major version or be older; a 7.0 agent is the right choice for a 7.0 server.
Related Zabbix guides:
- How to Add Host in Zabbix Server to Monitor
- How to Install and Configure Zabbix Agent on OpenSUSE Leap 15.3
Ensure the server packages are up to date
Before proceeding, let us make sure that our server packages are up to date with this command:
sudo dnf -y update
Let us also install some common packages that we will need:
sudo dnf install -y vim
Install the Zabbix Agent
The Zabbix agent packages are not available under the default Rocky Linux or AlmaLinux repositories. We will need to configure the official Zabbix repository in our system before installing the agent.
When this article was first written, Zabbix 5.4 was current. 5.4 has long been end of life; as of November 2026 the current long-term support release is Zabbix 7.0 LTS (full support until June 2027, limited support until June 2029), so that is what this guide installs. Zabbix 8.0 LTS is planned for Q4 2026; check the Zabbix life cycle page before you start.
Exclude Zabbix packages from EPEL
If you have EPEL enabled, it ships its own (older) Zabbix packages that can be pulled in instead of the official ones. Edit /etc/yum.repos.d/epel.repo and add this line under the [epel] section:
[epel]
...
excludepkgs=zabbix*
Skip this step if EPEL is not installed.
Add the Zabbix 7.0 repository
Install the release package that matches your distribution and major version. On Rocky Linux 9:
sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
sudo dnf clean all
For other versions, change the distribution directory (rocky or alma) and the two 9s to 8 or 10. For example, on AlmaLinux 8:
sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/alma/8/x86_64/zabbix-release-latest-7.0.el8.noarch.rpm
sudo dnf clean all
The original command for the now-EOL 5.4 release was
sudo dnf install -y https://repo.zabbix.com/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm. Don’t use it for new installs.
zabbix-agent or zabbix-agent2?
Zabbix ships two agents, and you only need one of them on a host:
zabbix-agent– the classic agent, written in C. Small, still fully supported, and what this guide originally used.zabbix-agent2– the newer agent, written in Go. It supports everything the classic agent does, runs checks concurrently, can buffer active-check data to disk, and adds plugins for things like Docker, PostgreSQL, MySQL, Redis and MongoDB.
Both listen on port 10050 and use the same Server, ServerActive and Hostname settings. For a new host, agent 2 is a good default; stick with the classic agent if you want the smallest footprint or need parity with existing hosts.
Install the agent
Install the classic agent:
sudo dnf install -y zabbix-agent
Or install agent 2 instead (the extra plugins are optional; install only the ones you need):
sudo dnf install -y zabbix-agent2
# optional loadable plugins
sudo dnf install -y zabbix-agent2-plugin-mongodb zabbix-agent2-plugin-mssql zabbix-agent2-plugin-postgresql
Confirm the software version installed (use rpm -qi zabbix-agent2 for agent 2). The output below was captured with the original 5.4 install; on 7.0 the Version will read 7.0.x and the Release will contain release, which is how you tell official Zabbix packages apart from EPEL ones:
rpm -qi zabbix-agent
Name : zabbix-agent
Version : 5.4.9
Release : 1.el8
Architecture: x86_64
Install Date: Mon 17 Jan 2022 06:23:27 AM UTC
Group : Applications/Internet
Size : 2353430
License : GPLv2+
Signature : RSA/SHA512, Thu 23 Dec 2021 12:54:16 PM UTC, Key ID 082ab56ba14fe591
Source RPM : zabbix-5.4.9-1.el8.src.rpm
Build Date : Thu 23 Dec 2021 12:28:37 PM UTC
Build Host : 3a869a1545a8
Relocations : (not relocatable)
URL : http://www.zabbix.com/
Summary : Old Zabbix Agent
Description :
Old implementation of zabbix agent.
To be installed on monitored systems.
Configure Zabbix Agent
Now configure the agent so it knows which Zabbix server/proxy to talk to, and so the host is identified correctly.
Edit the Zabbix agent configuration file:
sudo vim /etc/zabbix/zabbix_agentd.conf
If you installed agent 2, the file is /etc/zabbix/zabbix_agent2.conf instead; the settings below are the same.
Update (or add) these settings (replace the IP and hostname with your values):
Server=10.70.5.218
ServerActive=10.70.5.218
Hostname=dev-rockysrv1
Notes:
Serveris used for passive checks (server/proxy connects to the agent).ServerActiveis used for active checks (agent connects out to server/proxy).Hostnamemust match the host name you create in the Zabbix UI (unless you use auto-registration).
Adjust the firewall (if enabled)
If firewalld is enabled, allow inbound TCP port 10050 so the server/proxy can reach the agent for passive checks.
Note: port 10051 is used by the Zabbix server/proxy, not the agent, so you usually do not need it open on an agent host.
sudo firewall-cmd --permanent --add-port=10050/tcp
sudo firewall-cmd --reload
SELinux
You do not need to disable SELinux just to run the Zabbix agent. The “frontend in a browser” applies to the Zabbix server host, not the agent host.
If you run into SELinux-related issues, check logs with sudo ausearch -m AVC -ts recent and address the specific denial rather than setting the whole system to permissive.
Start and enable the Zabbix agent
Start the agent (it is not started by default):
sudo systemctl start zabbix-agent
For agent 2 the service is zabbix-agent2, so substitute that name in the systemctl commands in this section.
Check the status to confirm that it is started.
sudo systemctl status zabbix-agent
â—Ź zabbix-agent.service - Zabbix Agent
Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2022-01-17 06:57:33 UTC; 19s ago
Process: 39725 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 39728 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 39730 (zabbix_agentd)
Tasks: 6 (limit: 23176)
Memory: 3.9M
CGroup: /system.slice/zabbix-agent.service
/usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
/usr/sbin/zabbix_agentd: collector [idle 1 sec]
/usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
/usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
/usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
/usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: zabbix-agent.service: Succeeded.
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: Stopped Zabbix Agent.
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: Starting Zabbix Agent...
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
Jan 17 06:57:33 dev-rockysrv1.inv.re systemd [1]: Started Zabbix Agent.
From the above output, we can confirm that the agent is running. To enable the agent to start on boot, use this command:
sudo systemctl enable zabbix-agent
Or start and enable it in one step:
sudo systemctl enable --now zabbix-agent
Frequently Asked Questions (FAQ)
What is the Zabbix agent?
The Zabbix agent is a small service installed on each host you want to monitor. It gathers system and application metrics and provides them to the Zabbix server (or proxy) via passive checks (server pulls) or active checks (agent pushes). It listens on TCP port 10050 by default.
What port does the Zabbix agent use?
The Zabbix agent listens on TCP port 10050. The Zabbix server uses port 10051. On the agent host you only need to open 10050 (e.g. with firewalld) so the server can perform passive checks.
Should I use zabbix-agent or zabbix-agent2?
Either works with a Zabbix 7.0 server. Agent 2 (Go) adds concurrent checks, a persistent buffer for active checks and plugins for services like Docker and databases; the classic agent (C) is lighter. Install one per host, not both.
Where is the Zabbix agent config file?
The main config file is /etc/zabbix/zabbix_agentd.conf (or /etc/zabbix/zabbix_agent2.conf for agent 2). Key settings include Server (allowed server IPs for passive checks), ServerActive (server/proxy for active checks), and Hostname (must match the host name in the Zabbix UI).
Do I need to disable SELinux for the Zabbix agent?
No. The Zabbix agent runs fine with SELinux enabled. If you see denials, use sudo ausearch -m AVC -ts recent and fix the specific rule instead of setting SELinux to permissive.
Conclusion
You now have the Zabbix agent installed and configured on Rocky Linux or AlmaLinux 8, 9 or 10, with the service enabled and (if applicable) firewall port 10050 open. Add this host in the Zabbix frontend using the same Hostname as in the agent config file; see How to Add Host in Zabbix Server to Monitor for the steps.