It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In RegisterIt looks like you're new here. If you want to get involved, click one of these buttons!
Zabbix is a popular open source IT infrastructure and application monitoring system used by small, medium and large companies around the world.
This guide will guide you through the steps of installing Zabbix on AlmaLinux 9 and Rocky Linux 9, covering database setup, Zabbix server and web frontend configuration, and ensuring the required services are running.
MariaDB: To run Zabbix, you will need MariaDB. If MariaDB is not installed on your server , you can install it using our guide.
Please note: The Nginx web server will be installed automatically during Zabbix configuration.
Start by updating your system to ensure all existing packages are up-to-date:
dnf update -y
The Zabbix packages provided by EPEL repository may conflict with those from the Zabbix official repository. To avoid this, we will exclude Zabbix packages from the EPEL repository. Open the EPEL repository configuration file:
nano /etc/yum.repos.d/epel.repo
Under the [epel] section, add the following line to exclude Zabbix packages:
excludepkgs=zabbix*
Save and close the file.
Now, install the Zabbix repository to your system:
rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/alma/9/noarch/zabbix-release-latest-7.2.el9.noarch.rpm
Clean the package cache:
dnf clean all
Next, install the necessary Zabbix components:
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
Log in to MySQL:
mysql -u root -p
Create a Zabbix database:
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
Create a user for Zabbix and grant the necessary privileges:
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'New_Password';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
SET GLOBAL log_bin_trust_function_creators = 1;
Note: Replace New_Password with your actual strong password.
Exit MySQL:
EXIT;
Import the initial Zabbix schema and data:
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
After the import is complete, disable the log_bin_trust_function_creators option:
mysql -u root -p
Run the following SQL command:
SET GLOBAL log_bin_trust_function_creators = 0;
EXIT;
Now, we need to configure the Zabbix server by setting the database password.
Open the Zabbix server configuration file:
nano /etc/zabbix/zabbix_server.conf
Find the DBPassword directive and set it to the password you created for the zabbix MySQL user:
DBPassword=New_Password
Replace New_Password with the actual password you used.
Then save and close the file.
Next, configure Nginx to serve the Zabbix web frontend.
Open the Nginx configuration file for Zabbix:
nano /etc/nginx/conf.d/zabbix.conf
Find and uncomment the following lines to set up the Zabbix frontend on port 8080:
listen 8080;
server_name example.com;
Replace example.com with your server's hostname.
Save and close the file.
Start the Zabbix server, agent, Nginx, and PHP-FPM services:
systemctl restart zabbix-server zabbix-agent nginx php-fpm
Ensure these services start automatically on boot:
systemctl enable zabbix-server zabbix-agent nginx php-fpm
Allow traffic on port 8080 for the Zabbix frontend:
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
iptables-save > /etc/sysconfig/iptables
systemctl restart iptables
If you want to access Zabbix through HTTPS, you also need to install Let's Encrypt certificate for your server hostname.
Install EPEL repository (if not already installed):
dnf install epel-release
Install Certbot and Nginx plugin:
dnf install certbot python3-certbot-nginx
Obtain and install SSL certificate:
certbot --nginx
If locale en_US.UTF-8 is missing or not properly set up on your server, you will not be able to complete the Zabbix setup process.
Generate locale by running command:
So first of all, make sure the glibc-langpack-en package is installed:
dnf install glibc-langpack-en -y
Next, ensure that the system and environment variables use the correct locale:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> /etc/environment
echo "LC_ALL=en_US.UTF-8" >> /etc/environment
ter setting up the locale, restart the web server (Nginx/Apache) and PHP-FPM:
systemctl restart nginx
systemctl restart php-fpm
Finally, open your browser and navigate to the Zabbix web interface simply by entering your hostname.
https://your-server-hostname
You will see the page where you can set up your Zabbix.
The first page will ask you to choose your preferred language for the installation and display the version of Zabbix being installed. You can select the language and click 'Next step"
Zabbix will verify that the necessary PHP versions and settings are installed on your system. Ensure that all requirements are fulfilled before proceeding.
Next, provide the database details, including the database name, username, and password that were set up earlier:
Next, you will need to configure the server name, set the time zone, and select the default theme for the Zabbix frontend:
The system will show a summary of the configurations and checks. Click "Next step" to finish the installation process:
Now you can access your Zabbix dashboard. Enter default Admin credentials:
Username: Admin
Password: zabbix
After logging in, you will be taken to the Zabbix dashboard, where you can start configuring and monitoring your systems.
However, first of all, we recommend you to change default Admin password.
Click on "User settings" in the lower right corner:
Then, click "Profile":
Next, click on "Change password":
Enter the current password and a new one and click "Update" to save changes. Use a 12-16 character password with uppercase, lowercase, numbers, and special characters for strong Zabbix security.
After that, you will need to log in again with new credentials.
Installing Zabbix sets up a reliable monitoring system for your infrastructure. By completing the setup, configuring the database, and securing the installation, you can easily track performance and detect issues early.