Ensure MySQL and Nginx are pre-installed on your Rocky Linux 9 system. Disable SELinux before proceeding with the installation.
- If the EPEL repository is configured, prevent it from conflicting with official Zabbix packages by editing
/etc/yum.repos.d/epel.repo. Add or modify the following line under the[epel]section:
[epel]
...
excludepkgs=zabbix*
- Set up the official Zabbix repository for Rocky Linux 9:
# rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/9/x86_64/zabbix-release-latest-6.0.el9.noarch.rpm
# dnf clean all
- Install Zabbix Server, web frontend, agent, and supporting components:
# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
- Create and configure the Zabbix database and dedicated user in MySQL:
# mysql -uroot -p
Enter your MySQL root password when prompted, then run these commands:
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'StrongZabbixPass123';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;
This creates a dedicated database for Zabbix, a restricted user account, grants full permissions for the user on the Zabbix database, and temporarily enables a setting to allow stored function creation. Do not restart MySQL or the system at this stage to avoid breaking subsequent steps.
- Import the initial Zabbix database schema using the dedicated data base user:
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Enter the Zabbix database user password (StrongZabbixPass123) when prompted.
- Revert the temporary MySQL setting for stored function creasion:
# mysql -uroot -p
Enter your MySQL root password when prompted, then execute:
set global log_bin_trust_function_creators = 0;
quit;
- Configure Zabbix Server to connect to the MySQL database. Edit
/etc/zabbix/zabbix_server.conf, locate theDBPasswordline, uncomment it, and set it to your Zabbix database user's password:
DBPassword=StrongZabbixPass123
- Configure Nginx to serve the Zabbix web frontend. Edit
/etc/nginx/conf.d/zabbix.conf, uncomment and update thelistenandserver_namedirectives to match your environment:
listen 8080;
server_name monitor.example.com;
- Start the core services and enable them to launch automatically on system boot:
# systemctl restart zabbix-server zabbix-agent nginx php-fpm
# systemctl enable zabbix-server zabbix-agent nginx php-fpm
- Adjust firewall settings based on your security requirements. To temporarily disable the firewall:
# systemctl stop firewalld.service
For production environments, open the Zabbix frontend port (8080) permanently instead:
# firewall-cmd --add-port=8080/tcp --permanent
# firewall-cmd --reload
Verify the port is open with:
# firewall-cmd --list-ports
- Access the Zabbix web setup wizard via your browser using the server's IP address or hostname and the configured port. For example:
http://10.0.0.50:8080/
Use the default credentials to log in:
- Username: Admin
- Password: zabbix