In this article, we will have explained the necessary steps to install and configure Zabbix Server on CentOS 8. Before continuing with this tutorial, make sure you are logged in as a user with sudo
privileges. All the commands in this tutorial should be run as a non-root user.
Zabbix is a free and open-source monitoring solution designed for real-time monitoring of servers, virtual machines, networks, and cloud services. It was developed by Alexei Vladishev and actively supported by Zabbix SIA. It is based on the client-server model and capable of monitoring millions of metrics, such as CPU load, network utilization, and disk space consumption from tens of thousands of servers.
Install Zabbix Server on CentOS
Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.
sudo dnf update
Step 2. Install the LAMP stack on CentOS.
It is assumed that you have already installed the LAMP stack on CentOS 8. If not, please check out the following tutorial:
Once the Database server is installed, you need to create a database for Zabbix user:
$ mysql -u root -p CREATE DATABASE zabbix; GRANT ALL PRIVILEGES ON zabbix.* TO [email protected]'localhost' IDENTIFIED BY 'StrongPassword'; FLUSH PRIVILEGES; QUIT;
Step 3. Install Zabbix.
Zabbix packages are not available in the base OS repository. So, to get Zabbix packages, we need to install the Zabbix repository configuration package:
sudo dnf install https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm
Then install Zabbix server packages on CentOS:
sudo dnf install zabbix-server-mysql zabbix-agent zabbix-web-mysql
Step 4. Configure Zabbix Server.
Now we edit the Zabbix configuration file /etc/zabbix/zabbix_server.conf
and set the database name, user and password:
nano /etc/zabbix/zabbix_server.conf
DBName=zabbix DBUser=zabbix DBPassword=Your-Strong-Password
Finally, start and set Zabbix services to start at boot:
sudo systemctl enable --now zabbix-server zabbix-agent
Step 5. Configure Firewall for Zabbix.
Configure the firewall to allow the Zabbix agent to reach the Zabbix server:
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --add-port={10051,10050}/tcp --permanent sudo firewall-cmd --reload
Step 5. Accessing Zabbix.
That’s it. It is time to use your favorite web browser and navigate to:
http://your_IP_address.com/zabbix
Congratulation, you have learned how to install and configure Zabbix Server on CentOS 8. If you have any questions, please leave a comment below.