This guide covers the installation and configuration of Zabbix 7.2 Server with a MySQL database, Apache web server, and Zabbix agent on Ubuntu 22.04.
sudo apt update
sudo apt upgrade -y
sudo reboot
wget https://repo.zabbix.com/zabbix/7.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.2-1+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_7.2-1+ubuntu22.04_all.deb
sudo apt update
sudo apt install mysql-server -y
sudo systemctl enable mysql
sudo systemctl start mysql
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';
FLUSH PRIVILEGES;
EXIT;
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent2 -y
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -u zabbix -p zabbix
sudo nano /etc/zabbix/zabbix_server.conf
Locate and edit the following line:
DBPassword=StrongPassword123!
Set PHP timezone:
sudo nano /etc/zabbix/apache.conf
php_value date.timezone Europe/Istanbul
sudo nano /etc/zabbix/zabbix_agent2.conf
Edit Server line as follows:
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
Restart and enable the agent:
sudo systemctl restart zabbix-agent2
sudo systemctl enable zabbix-agent2
sudo systemctl restart zabbix-server apache2
sudo systemctl enable zabbix-server apache2
Access via browser:
http://<server_ip_address>/zabbix
Database details:
Login details: