How to Install Zabbix on RHEL 7

Zabbix is a mature, enterprise-grade open-source monitoring platform that supports agent-based and agentless monitoring of servers, network devices, applications, and cloud resources. It combines metrics collection, event correlation, alerting, and visualisation in a single self-hosted solution — making it a compelling choice for organisations that need full control over their monitoring infrastructure without per-host licensing fees. This guide covers installing Zabbix 6 LTS on RHEL 7 using the official Zabbix YUM repository, backing the server with a MySQL database, and completing the initial web setup through the browser-based installer.

Prerequisites

  • RHEL 7 server with at least 2 GB of RAM (4 GB recommended for larger environments)
  • At least 20 GB of free disk space for the database and file system
  • Root or sudo access
  • Apache HTTP Server (httpd) installed or installable via yum
  • MySQL 5.7 or MariaDB 10.x available (covered below)
  • PHP 7.2 or later — the Zabbix web package pulls this in automatically
  • Ports 80/443 (web UI) and 10050/10051 (agent/server communication) accessible

Step 1: Add the Zabbix YUM Repository

Zabbix provides official RPMs through its own repository. Download and install the repository configuration package for RHEL 7:

rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-4.el7.noarch.rpm
yum clean all

Verify the repository was added:

yum repolist | grep zabbix

Step 2: Install the Zabbix Server, Web Front-End, and Agent

Install the Zabbix server configured to use MySQL as its back-end, the web front-end package which pulls in Apache and PHP, and the Zabbix agent for monitoring the server itself:

yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent

You should also install the Zabbix SQL scripts package which contains the schema and initial data needed to initialise the database:

yum install -y zabbix-sql-scripts

Step 3: Install and Configure MySQL

RHEL 7 ships with MariaDB 5.5 in its base repositories. For Zabbix 6.x it is strongly recommended to use MariaDB 10.x or MySQL 5.7. Add the MariaDB 10.6 repository:

cat > /etc/yum.repos.d/mariadb.repo <<'EOF'
[mariadb]
name=MariaDB
baseurl=https://downloads.mariadb.com/MariaDB/mariadb-10.6/yum/rhel7-amd64
gpgkey=https://downloads.mariadb.com/MariaDB/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF

yum install -y MariaDB-server MariaDB-client
systemctl enable mariadb
systemctl start mariadb

Run the secure installation script to set the root password:

mysql_secure_installation

Create the Zabbix Database and User

Log in to MySQL as root and create a dedicated database and user for Zabbix. Replace StrongPassword123! with a secure password of your choice:

mysql -u root -p <<'SQL'
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
SET GLOBAL log_bin_trust_function_creators = 1;
FLUSH PRIVILEGES;
SQL

Step 4: Import the Zabbix Database Schema

Import the Zabbix schema, initial data, and images into the database you just created. The SQL scripts are compressed — pipe them through zcat directly into the MySQL client:

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | 
    mysql --default-character-set=utf8mb4 -u zabbix -p zabbix

Enter the Zabbix database user password when prompted. The import may take a minute or two as it inserts the initial template and host data. After the import completes, disable the log_bin_trust_function_creators setting:

mysql -u root -p -e "SET GLOBAL log_bin_trust_function_creators = 0;"

Step 5: Configure the Zabbix Server

Edit /etc/zabbix/zabbix_server.conf to tell the Zabbix server how to connect to its database. Locate and set the following directives (they already exist in the file — just uncomment or update them):

# /etc/zabbix/zabbix_server.conf (relevant lines)

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

# Increase these for environments with many hosts
StartPollers=10
StartPingers=5
CacheSize=128M
HistoryCacheSize=64M
TrendCacheSize=32M

Enable and start the Zabbix server and agent services:

systemctl enable zabbix-server zabbix-agent
systemctl start  zabbix-server zabbix-agent
systemctl status zabbix-server

Confirm the server started successfully — the log file is the best place to look for errors:

tail -f /var/log/zabbix/zabbix_server.log

Step 6: Configure PHP Timezone for the Web Front-End

The Zabbix web installer will fail its pre-flight check if PHP does not have a timezone configured. Edit the PHP timezone setting in the Apache configuration file that the Zabbix package installs:

# /etc/httpd/conf.d/zabbix.conf
# Find the line:  # php_value date.timezone Europe/Riga
# Uncomment it and set your local timezone:

sed -i 's|# php_value date.timezone Europe/Riga|php_value date.timezone America/New_York|' 
    /etc/httpd/conf.d/zabbix.conf

Alternatively, edit the file directly with your preferred editor and update the line to match your timezone (e.g., America/Chicago, Europe/London, Asia/Tokyo).

Enable SELinux Boolean settings that allow Zabbix to communicate over the network:

setsebool -P httpd_can_connect_zabbix 1
setsebool -P httpd_can_network_connect_db 1

Start Apache and open the firewall:

systemctl enable httpd
systemctl start httpd

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --reload

Step 7: Complete the Initial Web Setup

Open your browser and navigate to http://<server-ip>/zabbix. You will see the Zabbix setup wizard with the following steps:

  1. Welcome — Click Next step.
  2. Check of pre-requisites — All items should show OK. If any PHP extension is missing, install it with yum install -y php-<extension> and restart Apache.
  3. Configure DB connection — Enter localhost for Host, zabbix for Database, zabbix for User, and your database password. Click Next step.
  4. Zabbix server details — Leave Host as localhost and Port as 10051. Give the installation a name. Click Next step.
  5. Default time zone — Select your local timezone from the dropdown. Click Next step.
  6. Pre-installation summary — Review and click Next step.
  7. Install — The wizard writes the configuration file and confirms success. Click Finish.

Log in with the default credentials: username Admin, password zabbix. Change the password immediately under User settings.

Step 8: Add Your First Host

A host in Zabbix represents any device or service you want to monitor. To add the Zabbix server itself as the first monitored host:

  1. Navigate to Configuration > Hosts and click Create host.
  2. Set Host name to the server’s hostname (e.g., elk-server.example.com).
  3. In the Groups field, add it to Linux servers.
  4. Under Interfaces, add an Agent interface with IP address 127.0.0.1 and port 10050.
  5. Click the Templates tab and search for Linux by Zabbix agent. Link that template.
  6. Click Add to save the host.

Within a minute or two, navigate to Monitoring > Latest data, select the new host, and you should see CPU, memory, and disk metrics flowing in.

Conclusion

You now have a fully operational Zabbix monitoring server running on RHEL 7, backed by a MariaDB database and served through Apache. The Zabbix agent on the server itself feeds the first stream of host metrics into the platform, and you can quickly roll out additional agents to any number of Linux, Windows, or network targets. As your monitored estate grows, explore Zabbix’s built-in template library for databases, web servers, and cloud services, configure action-based notifications to send alerts to email or chat platforms, and use Zabbix’s scheduled reports to deliver weekly summaries to your operations team automatically.