If you have decided to install Zabbix from the packages, package availability and the procedure will differ based on the distribution. A few distributions will be covered here—read the distribution-specific instructions for others. For the installation, we need root rights.
Installing from the packages
Red Hat Enterprise Linux (RHEL)/CentOS
RHEL or CentOS users have two repositories to choose from: the well-known Extra Packages for Enterprise Linux (EPEL) and the Zabbix repository. EPEL might be a safer choice, but it might not always have the latest version. (In fact, at the time of writing, the latest version in EPEL was still 3.0.22, so it's possible that 4.0 will not be available in EPEL). In production, most of the time you will encounter setups with Security-Enhanced Linux (SELinux) enabled. However, SELinux is rather complex on its own, so it's out of the scope of this book; please disable SELinux before you start with the installation of Zabbix. If you have no clue how to do so, this can be done by editing the /etc/selinux/config file and putting disable or permissive instead of enabled. Don't forget to reboot afterwards so that changes are applied to the system. You can verify the status with the getenforce command.
EPEL
If EPEL is not set up already, it must be added. For RHEL/CentOS 7, the command is similar to this:
# rpm -Uvh http://ftp.colocall.net/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
For CentOS7 only, run the following command:
# yum install epel-release
If you would like to check the available Zabbix versions in EPEL, it is possible with the next command:
# yum --disablerepo="*" --enablerepo="epel" search zabbix
Once the repository has been set up, you may install the packages (except the following is for 3.0 not for 4.0 as it was not available when this book was written):
# yum install zabbix30-agent zabbix30-dbfiles-mysql zabbix30-server-mysql zabbix30-web-mysql
The Zabbix repository
First, the package that will define that the Zabbix repository should be installed:
# rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
Once the repository has been set up, you may install the packages:
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
Ubuntu/Debian
Zabbix has repositories available for Debian and Ubuntu just as it does for CentOS/Red Hat, so both are equally supported. Just be aware that Zabbix SIA has a slight preference lately for CentOS/Red Hat, and that this is the preferred OS for their training as well, but both are equally supported and tested:
# For Ubuntu 18.04
# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-1+bionic_all.deb
# For Debian 9
# wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-1+stretch_all.deb
# dpkg -i zabbix-release_4.0-1+bionic_all.deb
Once the repository has been set up, you may want to update the cache and install the packages, as follows:
# apt update
# add-apt-repository universe # (This is needed
# for package
# like fping ...)
# apt install zabbix-server-mysql zabbix-agent zabbix-frontend-php