Install and set up Zabbix for your system
a. Become the root user
Start a new shell session with root privileges:
$ sudo -s
b. Install the Zabbix repository
Download the Zabbix package:
# wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu22.04_all.deb
Install the package:
# dpkg -i zabbix-release_7.0-2+ubuntu22.04_all.deb
Update the package list:
# apt update
c. Install Zabbix server, frontend, and agent
Install necessary Zabbix components:
# apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent mysql* -y
d. Create the initial database
Make sure your database server is running.
Open the MySQL command line:
# mysql -uroot -p
Enter the following commands in MySQL:
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;
Exit MySQL:
mysql> quit;
Import the initial database schema and data. You'll need to type your database password:
# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Turn off the log_bin_trust_function_creators option:
# mysql -uroot -p
Enter the following commands in MySQL:
mysql> set global log_bin_trust_function_creators = 0;
Exit MySQL:
mysql> quit;
e. Set up the database for Zabbix server
Edit the Zabbix server config file:
/etc/zabbix/zabbix_server.conf
Add the following line:
DBPassword=password
f. Start Zabbix server and agent
Restart and enable Zabbix server, agent, and Apache to start on boot:
# systemctl restart zabbix-server zabbix-agent apache2
# systemctl enable zabbix-server zabbix-agent apache2
g. Access the Zabbix web interface
You can open Zabbix in your web browser with this URL:
http://host/zabbix