Install and configure Zabbix 7.0 lts on Ubuntu 22.04.5 LTS

A. Become root user

Start new shell session with root privileges.

sudo -s

B. Install Zabbix repository

wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu22.04_all.deb
dpkg -i zabbix-release_7.0-2+ubuntu22.04_all.deb
apt update

C. Install Zabbix server, frontend, agent

apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
  • Install MySQL on Ubuntu 22.04

Step 1: Update/Upgrade Package Repository

sudo apt update && apt upgrade

Step 2: Install MySQL

sudo apt update

sudo apt install mysql-server

sudo systemctl start mysql

sudo systemctl enable mysql

sudo systemctl status mysql

Step 3: Securing MySQL

sudo mysql_secure_installation

Press the y key to confirm

Step 4: Check if MySQL Service Is Running

sudo systemctl status mysql

Step 5: Log in to MySQL Server

sudo mysql -u root

Run the following on your database host.

mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;

On Zabbix server host, import initial schema and data. You will be prompted to enter your newly created password.

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Disable log_bin_trust_function_creators option after importing database schema.

mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

e. Configure the database for Zabbix server

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password

f. Configure PHP for Zabbix frontend

Edit file /etc/zabbix/nginx.conf uncomment and set 'listen' and 'server_name' directives.

listen 8080;
server_name example.com;

g. Start Zabbix server and agent processes

Start Zabbix server and agent processes and make it start at system boot.

systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm
systemctl enable zabbix-server zabbix-agent nginx php8.1-fpm

h. Open Zabbix UI web page

The URL for Zabbix UI when using Nginx depends on the configuration changes you should have made.

ref: https://www.zabbix.com/download?zabbix=7.0&os_distribution=ubuntu&os_version=22.04&components=server_frontend_agent&db=mysql&ws=nginx

0
Subscribe to my newsletter

Read articles from S. M. Arefin Rumi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

S. M. Arefin Rumi
S. M. Arefin Rumi