How to Install and Configure Zabbix 6.0: Complete Guide
How to Install and Configure Zabbix 6.0: Complete Guide
A Complete Comprehensive Guide to Install and Configure Zabbix 6.0 in Ubuntu 20.04/22.04 with MySQL Database on Apache Server
Table of Contents
- Introduction
- Step 1 – Installing and Configuring Apache2
- Step 2 – Installing and Setting Up MySQL Database
- Step 3 – Installing and Configuring Zabbix 6.0
- Step 4 – Mapping IP address to a Hostname
- Step 5 – Configuring Zabbix Using the Web Interface
- Conclusion
Introduction
Zabbix, an open-source monitoring software, comprehensively tracks networks, servers, applications, and services within IT environments. It provides cost-effective and scalable solutions for diverse deployments, offering an adaptive alerting system for tailored notifications across multiple channels. Alongside robust visualization tools for data representation, Zabbix boasts automation capabilities to streamline operations efficiently.
This efficient platform minimizes system impact, empowering users with extensive customization options, having templates, user-defined parameters, and flexible triggers suitable for any IT landscape. Its email-based alerts ensure swift responses to server issues. Covering networks, servers, VMs, and cloud services, Zabbix monitors crucial metrics such as network usage, CPU load, and disk space consumption, showcasing its comprehensive monitoring capabilities.
Prerequisite:
- Ubuntu 20.04 or 22.04
Step 1 – Installing and Configuring Apache2:
sudo apt update
sudo apt install apache2 -y
sudo ufw allow ‘Apache’
sudo systemctl start apache2
sudo systemctl enable apache2
Now verify if apache2 is working or not, so let’s try accessing its default webpage using our IP address:

Now let’s navigate our browser’s URL run http://[IP Address]. In my case it’s: http://192.168.50.10

sudo nano /etc/apache2/sites-available/zabbix.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName zabbix
ServerAlias www.zabbix-server.com
DocumentRoot /var/www/zabbix
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2ensite zabbix.conf
sudo a2dissite 000-default.conf
sudo apache2ctl configtest

sudo systemctl restart apache2
Step 2 – Installing and Setting Up MySQL Database:
sudo apt update
sudo apt install mysql-server -y
sudo systemctl start mysql.service
sudo systemctl enable mysql.service
mysql -u root -p

Note: If you have not set up any root password, then just press Enter to continue.
Create database zabbix character set utf8mb4 collate utf8mb4_bin.
Create user zabbix@localhost identified by ‘password’;
Grant all privileges on Zabbix. * to zabbix@localhost;
Set global log_bin_trust_function_creators = 1;
Quit;

Step 3 – Installing and Configuring Zabbix 6.0
Install Zabbix repository:
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_6.0-4+ubuntu22.04_all.deb
sudo apt update
Install the Zabbix server, frontend, and agent:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y
On the Zabbix server host, import the initial schema and data. You will be prompted to enter your newly created password (password):
sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql –default-character-set=utf8mb4 -uzabbix -p zabbix

Note: After entering your newly created password, the terminal will not show any result for 4 to 5 minutes, so wait patiently.
Disable log_bin_trust_function_creators option after importing database schema:
sudo mysql -uroot -p
Set global log_bin_trust_function_creators = 0;
Quit;

Configure the database for Zabbix server:
sudo nano /etc/zabbix/zabbix_server.conf
DBPassword=password

Start Zabbix server and agent processes:
systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2
Step 4—Mapping IP Address to a Hostname:
For Windows:
Navigate to CMD and run as administrator. In the terminal run:
notepad C:\Windows\System32\drivers\etc\hosts
at the bottom of the notepad file, type:
[IP Address] www.zabbix.com zabbix.com
So, for me it’s:
192.168.50.10 www.zabbix-server.com, zabbix-server.com Save the file and exit
For Linux:
In the terminal run:
sudo nano /etc/hosts
At the bottom of the notepad file, type:
[IP Address] www.zabbix.com zabbix.com
So, for me it’s:
192.168.50.10 www.zabbix-server.com zabbix-server.com
Save the file and exit.
For Mac:
In the terminal run:
sudo nano /private/etc/hosts
at the bottom of the notepad file, type:
[IP Address] www.zabbix.com zabbix.com
So, for me it’s
192.168.50.10 www.zabbix-server.com zabbix-server.com
Save the file and exit.
Step 5 – Configuring Zabbix Using the Web Interface:
In the browser’s URL, run:
http://zabbix-server.com/zabbix/setup.php

Click “Next step,” and in “Configure DB connection,” verify all the current values are as required

Note: If the current values are not up to the required values, then you can change that from /etc/php/8.1/apache2/php.ini
Click “Next step” and type the password you set up in your MySQL database:

Set your preferred Zabbix server name and time zone, then click Next step.

Check the Pre-installed summary and then click Next step:

Finally, we’re done!

Enter the following Login credentials:

And we’re done!

Reference links:
For more coding series:
Power of Microservices Observability
No-Code & Low-Code
Learning to Code: How to Think Like a Programmer
Written By Hamna Siddiqui
