Install Zabbix 5 LTS On Debian 10
Tutorial on how to install Zabbix 5 LTS on Debian 10
Add Zabbix repository
Add Zabbix Repository with the following commands
$ sudo apt update && sudo apt install wget
$ wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
$ sudo apt install ./zabbix-release_5.0-1+buster_all.deb
Install Zabbix Server with Mariadb
Install Zabbix Server
$ sudo apt update
$ sudo apt install zabbix-server-mysql
Install Mariadb and secure the database
$ sudo apt install mariadb-server mariadb-client -y
#Set Root Password
$ sudo mysql
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password;
SET PASSWORD = PASSWORD('P@ssw0rd!@#$');
flush privileges;
quit
#Secure MariaDB by enter "Y" for all options
$ sudo mysql_secure_installation
Change the root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
# Start and enable Mariadb
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb
Verify Mariadb is installed successfully
$ sudo mariadb --version
mariadb Ver 15.1 Distrib 10.3.27-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Create Database for Zabbix
Login to Mariadb
$ sudo mysql -u root -p
Create a new Zabbix Database (zabbixdb) and a new user (userzabbix). Replace SECURE_PASSWORD with your own password
CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
GRANT ALL PRIVILEGES ON zabbixdb.* TO userzabbix@localhost IDENTIFIED BY 'SECURE_PASSWORD';
FLUSH PRIVILEGES;
QUIT
Import initial schema and data
$ sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u userzabbix -p zabbixdb
Enter password: SECURE_PASSWORD
Configure Database Connection
$ sudo nano /etc/zabbix/zabbix_server.conf
DBHost=localhost ##Uncomment this option
DBName=zabbixdb ##Key in the database name you configured
DBUser=userzabbix ##Key in the username you configured
DBPassword=SECURE_PASSWORD ##Key in the password you configured
Install Zabix Frontend
Install Nginx and PHP
$ sudo apt install zabbix-frontend-php zabbix-nginx-conf
Verify Nginx & PHP version installed
$ sudo nginx -v
nginx version: nginx/1.14.2
$ sudo php -v
PHP 7.3.19-1~deb10u1 (cli) (built: Jul 5 2020 06:46:45) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.19, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.19-1~deb10u1, Copyright (c) 1999-2018, by Zend Technologies
Configure PHP date.timezone parameter that Zabbix uses in its setup
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Asia/Kuala_Lumpur
Restart PHP-FPM
$ sudo systemctl restart php7.3-fpm
Start Nginx Service and modify the Nginx configuration file created by Zabbix
$ sudo systemctl enable nginx
$ sudo systemctl start nginx
# Modify the Nginx Configuration File
$ sudo nano /etc/nginx/conf.d/zabbix.conf
server {
listen 80; ## Uncomment this part
server_name debian.aventis.dev; ## Uncomment this part too
Change the default Nginx file in Debian to listen on different port
$ sudo nano /etc/nginx/sites-available/default
server {
listen 82 default_server; ## Change from 80 to 82
listen [::]:82 default_server; ## Change from 80 to 82 as well
Change permission on Zabbix Root Folder and restart Nginx
$ sudo chmod -R 775 /usr/share/zabbix/
$ sudo systemctl restart nginx
Secure Zabbix with HTTPS
Generate a free Let’s Encrypt SSL Certificate and configure HTTPS in Nginx refering to Enable Secure SSL with HTTP2 support in NGINX
Final Configuration with WebUI
Login to https://debian.aventis.dev to complete the final configuration
Verify there is no error or warning found and click Next Step
Enter the Database Name, Username with Password and click Next Step
Enter a friendly name for Zabbix and click Next Step
Review all the configuration and click Next Step
Configuration of Zabbix Frontend is completed successfully
Login to Zabbix with default username and password, Admin, zabbix