Install and Configure Zabbix on AlmaLinux 9 | Powerful Tool
This guide aims to teach you How To Install and Configure Zabbix on AlmaLinux 9. Zabbix is a robust open-source monitoring software designed for various IT components, including networks, servers, virtual machines (VMs), and cloud services. It provides crucial monitoring metrics such as network utilization, CPU load, and disk space consumption, enabling proactive identification and resolution of potential issues.
Zabbix supports monitoring operations on Linux, Hewlett Packard Unix (HP-UX), Mac OS X, Solaris, and other operating systems (OSes). However, Windows monitoring is primarily achieved through agents installed on the target systems.
To effectively Install and Configure Zabbix on AlmaLinux 9, you must first log in to your server as a non-root user with sudo privileges and ensure a basic firewall is set up. For detailed instructions on achieving this, refer to our guide on Initial Server Setup with AlmaLinux 9.
Furthermore, you need a fully functional LAMP stack installed on your server. Our comprehensive guide on How to Install LAMP Stack on AlmaLinux 9 provides step-by-step instructions.
1. Download and Install Zabbix on AlmaLinux 9
Begin by visiting the Zabbix Downloads Page to identify the latest Long Term Support (LTS) version. Then, use the following commands to add the Zabbix repository to your AlmaLinux 9 system:
# sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-6.0-4.el9.noarch.rpm
# sudo dnf clean all
Next, install Zabbix components using the following command:
sudo dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
Upon successful installation, you must create a dedicated Zabbix database and user for optimal performance and security.
2. Create Zabbix Database and User on AlmaLinux 9
Access the MariaDB console with root privileges:
sudo mysql -u root -p
Within the MariaDB console, create a new user. In this example, we’ve named the user zabbixuser
, but you can choose any suitable name. Ensure you select a strong and unique password
for this user.
MariaDB [(none)]> CREATE USER zabbixuser@localhost IDENTIFIED BY 'password';
Create the Zabbix database:
MariaDB [(none)]> CREATE DATABASE zabbixdb character set utf8mb4 collate utf8mb4_bin;
Grant all necessary privileges to the newly created Zabbix user for the Zabbix database:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO zabbixuser@localhost;
Apply the changes and exit the MariaDB console:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Import Database Schema
Import the Zabbix database schema using the following command, replacing zabbixuser
and zabbixdb
with your chosen names:
# sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -u zabbixuser -p zabbixdb
You will be prompted to enter the password for the Zabbix user.
Change Database Settings on Zabbix Configuration File
Modify the Zabbix server configuration file to reflect your database settings.
Open the configuration file using your preferred text editor (e.g., vi
):
sudo vi /etc/zabbix/zabbix_server.conf
Locate the following lines and update them with your database credentials:
DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password
Remember to uncomment the DBHost
and DBPassword
lines by removing the #
character at the beginning of each line. Save and close the file when finished.
3. Configure PHP-FPM for Zabbix
Specify the appropriate timezone within the PHP-FPM configuration file for Zabbix.
Open the file:
sudo vi /etc/php-fpm.d/zabbix.conf
Find the line php_value[date.timezone] =
and uncomment it (remove the ;
) and set your desired timezone. For example:
php_value[date.timezone] = America/New_York
Save and close the file.
Restart the relevant services to apply the configuration changes:
sudo systemctl restart zabbix-server zabbix-agent httpd php-fpm
Enable the services to start automatically at boot:
sudo systemctl enable zabbix-server zabbix-agent php-fpm
4. Configure SELinux and Firewall for Zabbix
Configure SELinux to allow access to the Zabbix frontend. For simplicity, you can set SELinux to permissive mode:
# sudo setenforce 0
# sudo sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
Allow traffic on ports 10050
and 10051
through the AlmaLinux firewall:
# sudo firewall-cmd --add-service=http --permanent
# sudo firewall-cmd --add-port={10051,10050}/tcp --permanent
Reload the firewall to activate the new rules:
sudo firewall-cmd --reload
5. Access Zabbix Monitoring Dashboard
Access the Zabbix web interface by entering your server’s IP address in your web browser, followed by /zabbix
:
http://server-ip/zabbix
The Zabbix welcome page will appear. Click "Next Step."

Verify that all required PHP extensions are installed in the next window, and then click "Next Step."

Configure the database connection by entering your database details and clicking "Next Step."

Choose the server name and default theme, then click "Next Step."

Review the pre-installation summary and click "Next Step."

Click "Finish" to complete the Zabbix 6.0 installation.

You will be redirected to the Zabbix login screen. Enter "Admin" as the username and "zabbix" as the password, then click "Sign in."

Your Zabbix dashboard will be displayed.

From here, you can monitor a wide range of metrics.
Conclusion
In conclusion, the process to Install and Configure Zabbix on AlmaLinux 9 involves setting up the LAMP stack, configuring the Zabbix repository, and installing the server, frontend, and agent packages. Once correctly configured, Zabbix provides a powerful and scalable solution for monitoring networks, servers, and applications, making it ideal for long-term infrastructure management.
Hope you enjoy it. Please subscribe to us on Facebook and Twitter.
Also, you may like to read the following articles:
Install the Latest Zabbix on Ubuntu 24.04
Zabbix 6.4 Installation on Ubuntu 22.04 Server
Install and Configure Zabbix 6.0 on Ubuntu 22.04
Alternative Solutions for Monitoring on AlmaLinux 9
While the above method details a complete installation of Zabbix, here are two alternative approaches to achieve system monitoring on AlmaLinux 9:
1. Using Docker to Deploy Zabbix
Docker provides a containerized environment, simplifying deployment and management. Instead of installing Zabbix directly on the AlmaLinux 9 system, you can use Docker to run Zabbix in a container. This approach isolates Zabbix from the host system, making updates and rollbacks easier.
-
Explanation: Docker containers bundle the application with all its dependencies, ensuring consistency across different environments. Using pre-built Zabbix Docker images reduces the complexity of manual configuration.
-
Implementation:
-
Install Docker:
sudo dnf install docker-ce -y sudo systemctl start docker sudo systemctl enable docker
-
Pull the Zabbix Docker Image (e.g., Zabbix Official Image):
docker pull zabbix/zabbix-server-mysql:latest docker pull zabbix/zabbix-web-apache-mysql:latest docker pull zabbix/zabbix-agent:latest
-
Run the Zabbix Containers: You will need to configure the database connection for the server container and link the web frontend to it. This typically involves setting environment variables when running the containers. Here’s a basic example:
docker run --name zabbix-db -e MYSQL_ROOT_PASSWORD=your_root_password -e MYSQL_USER=zabbix -e MYSQL_PASSWORD=zabbix_password -d mariadb:latest docker run --name zabbix-server --link zabbix-db:db -e DB_SERVER_HOST=db -e DB_SERVER_PORT=3306 -e MYSQL_USER=zabbix -e MYSQL_PASSWORD=zabbix_password -d zabbix/zabbix-server-mysql:latest docker run --name zabbix-web -d --link zabbix-server:zabbix -p 8080:80 -e ZBX_SERVER_HOST=zabbix zabbix/zabbix-web-apache-mysql:latest
-
Access the Zabbix Frontend: Open your web browser and navigate to
http://your_server_ip:8080/
.
-
2. Using Cockpit for Basic Monitoring
Cockpit is a web-based interface that comes standard with many Linux distributions, including AlmaLinux 9. While not as comprehensive as Zabbix, Cockpit provides basic monitoring capabilities such as CPU usage, memory usage, network traffic, and disk I/O. This is a lightweight option for users who need basic monitoring without the complexity of a full Zabbix installation.
-
Explanation: Cockpit is easy to set up and provides a quick overview of system performance. It’s suitable for smaller environments or users who are new to system monitoring.
-
Implementation:
-
Install Cockpit (if not already installed):
sudo dnf install cockpit -y
-
Enable and Start Cockpit:
sudo systemctl start cockpit.socket sudo systemctl enable cockpit.socket
-
Access Cockpit: Open your web browser and navigate to
https://your_server_ip:9090
. Log in with your system user credentials. -
Navigate to the "Metrics" or "Dashboard" section: You’ll find real-time graphs and charts displaying system resource usage.
-
These alternatives offer different levels of monitoring capabilities, catering to various needs and technical expertise. The Docker approach is a good middle ground between full installation and basic monitoring, while Cockpit offers the simplest and quickest way to get started with system monitoring on AlmaLinux 9.