How To Install Zabbix Server 4.x on CentOS 6 / RHEL 6

Zabbix is open-source software for monitoring the network services, servers, and other network devices. It helps to monitor CPU, Memory, Disk, and other resources on Windows or Unix hosts by installing Zabbix client on it.

Zabbix can also check the availability of the standard services such as SMTP or HTTP without installing any software on the remote host.

Zabbix’s back end written in C and uses PHP for the front end, supports MySQL / MariaDB, PostgreSQL, SQLite, Oracle or IBM DB2 databases.

This guide will help you to install Zabbix on CentOS 6 / RHEL 6.

Install Zabbix

PHP & PHP Extensions

Install the required PHP extensions using the following command.

rpm -ivh

yum install --enablerepo=remi-php54 php php-cli php-common php-devel php-pear php-gd php-mbstring php-mysql php-xml php-bcmath php-ldap

Configure Zabbix Repository

Install the Zabbix release package. This package contains the repository configuration to obtain Zabbix server and agent packages.

### Zabbix 4.0 (LTS) ###

rpm -Uvh

### Zabbix 4.2 (Latest) ###

rpm -Uvh

Install Zabbix Server

Use the below command to install the Zabbix server and Zabbix frontend with MySQL support package. Also, the Zabbix agent to monitor the Zabbix server.

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent


To begin using the Apache with the Zabbix server. Zabbix configuration file needs to be updated with correct timezone.

Copy the configuration file.

cp /usr/share/doc/zabbix-web-*/httpd22-example.conf /etc/httpd/conf.d/zabbix.conf

Edit the configuration file to update the timezone.

vi /etc/httpd/conf.d/zabbix.conf

Change the value data.timezone depends on your timezone.

php_value date.timezone America/New_York


Install MySQL or MariaDB

Install MariaDB or MySQL on your system.

READ: How To Install MariaDB On CentOS 6 / RHEL 6


READ: How To Install MySQL 8.x On CentOS 6 / RHEL 6

For this post, I will use MySQL database that comes with the operating system.

yum install -y mysql-server mysql

Create Zabbix database and Import Schema

Start the MySQL service.

service mysqld start 

If you are configuring the MySQL / MariaDB for the first time, take a look at how to secure the MariaDB / MySQL.

mysql -u root -p

Create a database with the following details.

DBName: zabbixdb
DBUser: zabbixuser
DBPassword: zabbixpassword

create database zabbixdb character set utf8 collate utf8_bin;

GRANT ALL ON zabbixdb.* TO zabbixuser@localhost IDENTIFIED BY 'zabbixpassword';


Import initial schema and data to the newly created database.

cd /usr/share/doc/zabbix-server-mysql*/

zcat create.sql.gz | mysql -u zabbixuser -p zabbixdb

Update Database Configuration

Edit the zabbix_server.conf file to set the database details.

vi /etc/zabbix/zabbix_server.conf

Make sure you set as follows.


Start the Zabbix Server service.

service zabbix-server start

service zabbix-agent start

service httpd start

Start the services are system boot.

chkconfig zabbix-server on

chkconfig zabbix-agent on

chkconfig httpd on

chkconfig mysqld on


If you have SELinux enabled on your server, you need to add custom SELinux rules to allow successful connection of Zabbix web frontend to the Zabbix server.

yum install -y policycoreutils-python

Add a few custom rules.

curl > zabbix_server_add.te

checkmodule -M -m -o zabbix_server_add.mod zabbix_server_add.te

semodule_package -m zabbix_server_add.mod -o zabbix_server_add.pp

semodule -i zabbix_server_add.pp

Thanks to catonrug blog.


Configure the firewall to allow the Zabbix agent to reach the Zabbix server.

iptables -I INPUT -p tcp -m tcp --dport 10051 -j ACCEPT

iptables -I INPUT -p tcp -m tcp --dport 10050 -j ACCEPT

iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT

/etc/init.d/iptables save

Setup Zabbix via Web Installer

Visit the following URL to start setting up the Zabbix


Click Next to continue.

Install Zabbix on CentOS 6 – Zabbix Welcome Screen

Zabbix setup will check the prerequisites, will give you the status like below.

Install Zabbix on CentOS 6 – Zabbix Pre-Checks

Enter the database information.

Install Zabbix on CentOS 6 – Zabbix Database Configuration

Configure the server information.

Install Zabbix on CentOS 6 – Zabbix Server Details

Check out the installation summary.

Install Zabbix on CentOS 6 – Zabbix Pre-Installation Summary

Finish the setup.

Zabbix Installation Completed

Access Zabbix

Login with Zabbix’s default credential.

Username: Admin

Password: zabbix

Zabbix Login Screen

This how the Zabbix dashboard looks like.

Zabbix Monitoring Dashboard


That’s All. You have learned how to install Zabbix on CentOS 6 / RHEL 6. Now, you can install Zabbix agent on client machines for monitoring.

centos 6monitoring-toolszabbix
Comments (1)
Add Comment
  • Javed Shaikh

    Hi Thanks for the article..I have installed the zabbix on my RHEL 6.5. I have done all the mentioned configuration but when I login to zabbix server the Zabix server running value is always showing No. I restarted the zabbix-server from the server several times, but immediately after restarting when I checked the status of zabbix-server it always shows as stopped. Please help