How can one install Zabbix Server 5.0 on Rocky Linux 8?. Zabbix is an open source monitoring tool used to monitor server systems/applications, network devices, IoT devices, hardware appliances etc. The tool’s backend is written in C and Java while the front end is written in PHP. This guide will discuss how to install Zabbix 5 LTS on Rocky Linux 8.

Zabbix tool works in a server/client model where the server communicates with the native agents installed on the client device. For systems without native agents SNMP or IPMI can be used.

Step 1: Add Zabbix Repository to Rocky Linux 8

Configure the repository for the latest Zabbix 5 LTS.

rpm -Uvh

Install Zabbix packages:

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

Zabbix works with the following software depandancies:

  1. Apache web server
  2. MySQL/MariaDB server
  3. PHP and PHP extensions

Step 2: Install Apache Web server

Install Apache webserver with the command below:

sudo dnf -y install @httpd

Start and enable httpd service:

sudo systemctl enable --now httpd

Step 3: Install PHP and PHP Extensions

We need to install PHP and PHP-FPM. In this article we shall use PHP 7.4.

Add Remi Repository

Add Remi repository to allow us download the latest packages of PHP for Rocky Linux 8.

sudo dnf install dnf-utils

Enable the DNF module for PHP installation.

sudo dnf module reset php
sudo dnf module enable php:remi-7.4

Install PHP and PHP extensions

sudo dnf update
sudo dnf install php php-fpm  php-gd php-mysqlnd

Configure PHP-FPM. T do this, we need to edit the file at /etc/php-fpm.d/www.conf and add the content below:

$ sudo vim /etc/php-fpm.d/www.conf

; listen =
listen = /run/php-fpm/www.sock
user = apache
group = apache
listen.allowed_clients =
listen.owner = apache = apache
listen.mode = 0660
pm = dynamic

Add timezone settings to /etc/php-fpm.d/zabbix.conf.

$ sudo vi /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Africa/Nairobi

Step 4: Install MariaDB server on Rocky Linux

A complete article about MariaDB has been discussed in the article below:

How To Install MariaDB Server on Rocky Linux 8

For a faster installation, follow the steps below:

dnf install -y mariadb-server mariadb

Secure database server:

sudo mysql_secure_installation

Start and enable MariaDB service:

systemctl enable --now mariadb

Step 5: Create Zabbix database and user

Create zabbix database and user credentials that will be used by the zabbix application.

Use the details below:

DBName: zabbixdb
DBUser: zabbixuser
DBPassword: [email protected]

Open your database shell using the root credentials:

$ mysql -u root -p

Create database and user:

create database zabbixdb character set utf8 collate utf8_bin;
create user 'zabbixdb'@'localhost' identified by '[email protected]';
grant all privileges on zabbixdb.* to [email protected] identified by '[email protected]';
flush privileges;

Step 6: Configure Zabbix server on Rocky Linux 8

We have installed Zabbix server and the required packages to run the Zabbix tool on Rocky Linux 8.

Import Zabbix Database schema

Import the database schema for zabbix:

cd /usr/share/doc/zabbix-server-mysql/
zcat create.sql.gz | mysql -u zabbixuser -p zabbixdb

Update Database Configuration

Edit zabbix_server.conf file and add the database credentials we created in the previous steps.

$ sudo vi /etc/zabbix/zabbix_server.conf
DBPassword=[email protected]

Configure SELinux

Set SELinux to permissive or disable it to allow zabbix backend to connect to its front end.

sudo setenforce 0
sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

Configure Firewall

Allow zabbix ports through the firewall:

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-port={10051,10050}/tcp --permanent
sudo firewall-cmd --reload

Start Zabbix server and dependent applications:

sudo systemctl restart zabbix-server zabbix-agent httpd php-fpm
sudo systemctl enable zabbix-server zabbix-agent httpd php-fpm

Configure Zabbix web interface

You can now access your Zabbix web interface via http://<server_ip_or_name>/zabbix.

Check that all the prerequisites are met for the zabbix installation:

Input the database details we created in the steps above for the database connection:

Choose the server name for your zabbix server in the step that follows:

Check the pre-installation summary in the next page:

Proceed to the next step to complete the installation:

Login to the Zabbix using the credentials below:

Username: Admin
Password: zabbix

We now have access to Zabbix web interface where we can configure devices for monitoring.


In the above discussion we have been able to install Zabbix server on Rocky Linux successfully.

Please these other articles from this site:

How To Install Zabbix Server 5 on Amazon Linux 2

Install Zabbix 5 LTS With Nginx on Oracle Linux 8

Add Remote Hosts to Nagios Server for Monitoring


Please enter your comment!
Please enter your name here