How To Install Zabbix Server 4 on Debian 10 Buster
(: August 17, 2019)
Welcome to our guide on how to install Zabbix Server 4.x on Debian 10 Buster. Zabbix is an open-source, enterprise-grade monitoring application for monitoring applications, Network devices, Web servers, Application servers, IoT devices, e.t.c. Zabbix server backend is written in C and Java, and its frontend is powered by PHP.
The Zabbix complete Architecture has both Server and Client. The Server communicates to the native software agents available for various Operating systems like Linux, Unix, and Windows. It is also possible to perform monitoring from Simple Network Management Protocol (SNMP) or Intelligent Platform Management Interface (IPMI).
Install Zabbix Server 4 on Debian 10 (Buster)
This section will discuss the complete steps you’ll require to install Zabbix 4 on Debian 10 Buster. The dependencies for this setup are:
- Apache web server
- PHP with required extensions
- MySQL/ MariaDB database server
Step 1: Install Apache httpd server
Update your system then install the apache2 package by running the following commands:
sudo apt update sudo apt -y upgrade sudo apt install -y apache2
After installing Apache, configure basic security by allowing Prod ServerTokens only on
sudo sed -i "s/^ServerTokens OS$/ServerTokens Prod/" /etc/apache2/conf-enabled/security.conf sudo sed -i "s/^ServerSignature On$/ServerSignature Off/" /etc/apache2/conf-enabled/security.conf
ServerTokens configures what is returned as the Server HTTP response. Valid options are Full | OS | Minimal | Minor | Major | Prod.
Restart apache2 service.
sudo systemctl restart apache2
Step 2: Install php for Apache
Configure Apache2 to use PHP scripts by installing the following packages:
sudo apt-get -y install php php-pear php-cgi php-common libapache2-mod-php
This will install php v7.3 on Debian 10. This can be confirmed by running the command:
$ php -v PHP 7.3.4-2 (cli) (built: Apr 13 2019 19:05:48) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.4-2, Copyright (c) 1999-2018, by Zend Technologies
sud sudo a2enconf php7.3-cgi sudo systemctl reload apache2
Ensure you set correct timezone for PHP:
$ grep date.timezone /etc/php/7.3/apache2/php.ini ; http://php.net/date.timezone date.timezone = "Africa/Nairobi"
Restart apache2 after this change:
sudo systemctl restart apache2
Step 3: Install MariaDB server
Install MariaDB on Debian 10 Buster:
sudo apt -y install mariadb-server
After database installation, create a database/user for Zabbix:
$ mysql -u root CREATE DATABASE zabbix; GRANT ALL PRIVILEGES ON zabbix.* TO [email protected]'localhost' identified by '[email protected]'; FLUSH PRIVILEGES; QUIT
Step 4: Install Zabbix Server on Debian 10 (Buster)
We will install Zabbix 4 from binary packages on Debian 10 Buster. We’ll need to add repository first.
LTS release – 4.0
wget https://repo.zabbix.com/zabbix/4.0/debian/pool/main/z/zabbix-release/zabbix-release_4.0-3+buster_all.deb sudo dpkg -i zabbix-release_4.0-3+buster_all.deb sudo apt update sudo apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Development release – 4.2:
wget https://repo.zabbix.com/zabbix/4.2/debian/pool/main/z/zabbix-release/zabbix-release_4.2-2+buster_all.deb sudo dpkg -i zabbix-release_4.2-2+buster_all.deb sudo apt update sudo apt -y install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Import Zabbix Server database schema
For Zabbix server and Zabbix proxy daemons, a database is required. It is not needed to run Zabbix agent. If Zabbix server and proxy are installed on the same host, their databases must be created with different names!
Import initial schema and data for the server with MySQL:
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
You will be prompted to enter your newly created password for Zabbix database user.
Step 5: Configure and start Zabbix server on Debian 10 Buster
Edit your Zabbix configuration file /etc/zabbix/zabbix_server.conf and set database connection settings.
DBUser=zabbix [email protected]
Also configure right timezone for Zabbix frontend.
$ sudo vim /etc/zabbix/apache.conf php_value date.timezone Africa/Nairobi
Then start Zabbix server and agent processes.
sudo systemctl restart zabbix-server zabbix-agent apache2 sudo systemctl enable zabbix-server zabbix-agent apache2
Step 6: Configure Zabbix frontend
Open the URL http://server_ip_or_name/zabbix on your browser.
Check of pre-requisites:
Configure DB connection
Set the host name or host IP address and port number of the Zabbix server
Confirm post-installation summary:
Click next to start the installation.
You’ll then get the login page.
Default logins are:
Username: "admin" Password: "zabbix"
Step 7: Change Admin Password
Login to Zabbix admin dashboard with admin user and password zabbix. You need to change the password for admin user after the first login for security reasons.
Navigate to Administration > Users > Admin > Password > Change Password
Configure Monitoring Target host
Now that we have our Zabbix server ready for monitoring, you can start configuring first monitoring target host. By default, the Zabbix server is added to monitoring.
To add other host devices, login to Zabbix admin dashboard with the username admin and click on Configuration > Hosts.
Read in the documentation: Quickstart guide to get started with Zabbix configuration and monitoring.