Zabbix is a mature, enterprise-grade open-source monitoring solution capable of tracking thousands of servers, virtual machines, network devices, and applications from a single web interface. It supports agent-based and agentless monitoring, flexible alerting, and detailed graphing out of the box. This tutorial installs Zabbix 6.4 on RHEL 9 using MySQL (MariaDB) as the backend database and Apache as the web server. By the end you will have a fully functional Zabbix Server ready to monitor your infrastructure.
Prerequisites
- RHEL 9 server with at least 2 GB RAM
- Root or sudo access
- Firewalld running
- SELinux in enforcing or permissive mode (tutorial assumes permissive for simplicity)
- A resolvable hostname or static IP address
Step 1 — Add the Zabbix Repository and Install Packages
Download and install the official Zabbix 6.4 repository package for RHEL 9, then install the server, web frontend, Apache configuration, SQL scripts, and the Zabbix agent.
# Install the Zabbix repository
sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
sudo dnf clean all
# Install Zabbix server, frontend, and agent
sudo dnf install -y zabbix-server-mysql
zabbix-web-mysql
zabbix-apache-conf
zabbix-sql-scripts
zabbix-selinux-policy
zabbix-agent
Step 2 — Install and Configure MariaDB
Install MariaDB, secure the installation, then create the Zabbix database and user.
sudo dnf install -y mariadb-server
sudo systemctl enable --now mariadb
# Secure the installation (set root password, remove anonymous users, etc.)
sudo mysql_secure_installation
# Create the Zabbix database and user
sudo mysql -u root -p <<'SQL'
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongZabbixPass1!';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
SET GLOBAL log_bin_trust_function_creators = 1;
FLUSH PRIVILEGES;
SQL
Step 3 — Import the Initial Schema
Import the Zabbix SQL schema, images, and default data into the database. This step can take a few minutes on slower systems.
# Import schema (will prompt for the 'zabbix' user password)
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz |
mysql --default-character-set=utf8mb4 -u zabbix -p zabbix
# After import, disable log_bin_trust_function_creators
sudo mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 0;"
Step 4 — Configure the Zabbix Server
Edit /etc/zabbix/zabbix_server.conf to point Zabbix Server at the database you created.
sudo tee -a /etc/zabbix/zabbix_server.conf > /dev/null <<'EOF'
# Database connection settings (appended)
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=StrongZabbixPass1!
EOF
# Verify the values are set (the file already has commented defaults)
grep -E '^DB(Host|Name|User|Password)' /etc/zabbix/zabbix_server.conf
Step 5 — Configure the PHP Timezone and Start Services
Set the correct PHP timezone for the Zabbix web frontend, then start Zabbix Server, the agent, and Apache.
# Set timezone in the Zabbix Apache config
sudo sed -i 's/# php_value date.timezone Europe/Riga/php_value date.timezone America/New_York/'
/etc/httpd/conf.d/zabbix.conf
# Start and enable all services
sudo systemctl enable --now zabbix-server zabbix-agent httpd php-fpm
sudo systemctl status zabbix-server
# Open required firewall ports
sudo firewall-cmd --permanent --add-port=10050/tcp # Zabbix agent (passive)
sudo firewall-cmd --permanent --add-port=10051/tcp # Zabbix server (trapper)
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload
Step 6 — Complete the Web Installer
Open a browser and navigate to http://<your-server-ip>/zabbix. The web-based setup wizard will guide you through the final steps.
# Verify the Zabbix server process is running before opening the browser
sudo zabbix_server --version
sudo grep "zabbix_server started" /var/log/zabbix/zabbix_server.log
# Check for errors if the server fails to start
sudo tail -50 /var/log/zabbix/zabbix_server.log
In the installer wizard: confirm all prerequisites pass (fix any PHP warnings), enter the database host (localhost), database name (zabbix), user (zabbix), and password, name the server instance, review the summary, and finish. Log in with the default credentials Admin / zabbix and immediately change the password under User Settings → Profile.
Conclusion
You have successfully installed Zabbix 6.4 on RHEL 9 with a MariaDB backend and Apache web frontend. The Zabbix agent running locally is already being monitored by the server — you can see it in Configuration → Hosts. To extend coverage, install the Zabbix agent on additional servers, add them in the Zabbix web UI, and link them to pre-built templates such as Linux by Zabbix agent to get CPU, memory, disk, and network graphs immediately. Consider enabling SNMP traps or the Zabbix proxy component as your monitored infrastructure grows.
Next steps: How to Install Prometheus and Grafana on RHEL 9, How to Install Netdata on RHEL 9, and How to Set Up the ELK Stack on RHEL 9.