RHEL BasedRocky Linux

How To Install Zabbix on Rocky Linux 9

Install Zabbix on Rocky Linux 9

In this tutorial, we will show you how to install Zabbix on Rocky Linux 9. For those of you who didn’t know, Zabbix, a renowned open-source monitoring solution, plays a pivotal role in maintaining the health and performance of your network infrastructure.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Zabbix open-source monitoring tool on Rocky Linux 9 or RHEL-based.

Prerequisites

  • A server running one of the following operating systems: Rocky Linux 9.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for Zabbix.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Zabbix on Rocky Linux 9

Step 1. The first step is to update your system to the latest version of the package list. To do so, run the following commands:

sudo dnf update
sudo dnf upgrade

Step 2. Installing Dependencies.

Begin by installing the required dependencies for Zabbix:

sudo dnf install epel-release
sudo dnf install httpd wget mariadb-server mariadb php php-common php-mysqlnd php-gd php-xml php-mbstring php-bcmath php-json php-ldap php-pear php-xmlrpc php-ldap php-net-ldap2 php-gd php-gettext -y

Now, start and enable the Apache and MariaDB services:

sudo systemctl start httpd mariadb
sudo systemctl enable httpd mariadb

Step 3. Configuring MariaDB for Zabbix.

Before creating the Zabbix database, it’s crucial to secure your MariaDB installation. Run the following command to set a secure password for the MariaDB root user:

sudo mysql_secure_installation

Next, create Zabbix Database and user:

sudo mysql -u root -p

Enter the MariaDB root password when prompted. Once inside the MariaDB shell, create a database and a dedicated user for Zabbix:

MariaDB [(none)]> CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
MariaDB [(none)]> CREATE USER 'zabbixuser'@'localhost' IDENTIFIED BY 'your-strong-password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbixuser'@'localhost';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Step 4. Installing Zabbix on Rocky Linux 9.

To install Zabbix, you need to add the official Zabbix repository. Here’s how:

sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.5/rocky/9/x86_64/zabbix-release-6.5-2.el9.noarch.rpm

Now, it’s time to install the Zabbix server, frontend, and agent packages:

sudo dnf install zabbix-server-mysql zabbix-web-mysql zabbix-agent

Step 5. Database Initialization.

Import the initial database schema for Zabbix into the newly created zabbixdb:

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

Step 6. Configuring Zabbix Server.

Edit the Zabbix server configuration file to specify the database connection details:

sudo nano /etc/zabbix/zabbix_server.conf

Find the following lines and modify them accordingly:

DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=your-strong-password

Step 7. Configuring Zabbix Frontend.

Now edit the Zabbix frontend configuration file:

sudo nano /etc/zabbix/web/zabbix.conf.php

Find and modify the following lines:

$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'localhost';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbixdb';
$DB['USER'] = 'zabbixuser';
$DB['PASSWORD'] = 'your-strong-password';

Finally, start the Zabbix server and enable it to start automatically at boot time by running the following commands:

sudo systemctl start zabbix-server zabbix-agent
sudo systemctl enable zabbix-server zabbix-agent

Step 8. Accessing the Zabbix Web Interface.

Once successfully installed, open your web browser and navigate to your Rocky Linux server’s IP address or hostname followed by /zabbix (e.g., http://your_server_ip/zabbix). You’ll be greeted with the Zabbix login page.

Use the following default credentials to log in:

  • Username: Admin
  • Password: zabbix

Install Zabbix on Rocky Linux 9

Congratulations! You have successfully installed Zabbix. Thanks for using this tutorial for installing the Zabbix monitoring tool on your Rocky Linux 9 system. For additional help or useful information, we recommend you check the official Zabbix website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button