In this tutorial, we will show you how to install Zabbix on Debian 10. For those of you who didn’t know, Zabbix is an open-source monitoring tool that is ideal for monitoring your cloud servers. Zabbix is very flexible, information can be retrieved using HTTP/SNMP or by installing a Zabbix agent on the machines to monitor, and allows a lot of customization. It also supports the monitoring of storage devices, databases, virtual machines, telephony, IT security resources, and much more.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘
sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation of Zabbix on Debian 10 (Buster).
- A server running one of the following operating systems: Debian 10 (Buster).
- It’s recommended that you use a fresh OS install to prevent any potential issues.
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install Zabbix on Debian 10 Buster
Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following
apt commands in the terminal:
sudo apt update sudo apt upgrade
Step 2. Installing Zabbix on Debian 10.
Now we add the Zabbix package repository:
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
Once successful in adding a repository, use the apt command to install the Zabbix server with the MariaDB support package to have MariaDB as a database server:
sudo apt update sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Step 3. Configure MariaDB Database Zabbix.
By default, MariaDB is not hardened. You can secure MariaDB using the
mysql_secure_installation script. You should read and below each step carefully which will set the root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL.
Configure it like this:
- Set root password? [Y/n] y - 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
Next, we will need to log in to the MariaDB console and create a database for Zabbix. Run the following command:
mysql -u root -p
This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server, you need to create a database for the Zabbix software:
create database zabbixdb; create user 'zabbix'@'localhost' identified by 'your_strong_password'; grant all privileges on zabbixdb.* to 'zabbix'@'localhost'; flush privileges; exit;
Then, load the Zabbix database schema to the database created above:
cd /usr/share/doc/zabbix-server-mysql cat create.sql.gz | mysql -u zabbix -p zabbixdb
Step 4. Configure Zabbix.
Next, edit the Zabbix server configuration file
/etc/zabbix/zabbix_server.conf and update the following database configurations. This will be used by the Zabbix server to connect to the database:
DBHost=localhost DBName=zabbixdb DBUser=zabbix DBPassword=your_strong_password
Step 5. Configure Apache webserver.
Zabbix creates its own apache configuration file
/etc/zabbix/apache.conf and makes a link to the Apache configuration directory. Let’s use the following command to restart the Apache service:
sudo systemctl restart apache2.service
Also, Restart the Zabbix server:
sudo systemctl restart zabbix-server sudo systemctl restart zabbix-agent
Step 6. Configure Firewall.
Now allow listening ports on the firewall:
sudo ufw allow 80 sudo ufw reload
Step 7. Accessing Zabbix Web Interface.
Zabbix will be available on HTTP port 80 by default. Open your favorite browser and navigate to
http://server-ip-address/zabbix and complete the required steps to finish the installation.
Congratulations! You have successfully installed Zabbix. Thanks for using this tutorial for installing Zabbix monitoring software in Debian 10 Buster systems. For additional help or useful information, we recommend you check the official Zabbix website.