Install Zabbix Server on Ubuntu 22.04
Installing Zabbix Server on Ubuntu 22.04 is one of the best ways to monitor your IT infrastructure in real time. This guide provides a detailed, step-by-step process for setting up Zabbix Server, configuring the database, and accessing the web interface. With Zabbix, you can track server performance, network devices, and applications efficiently. It is a powerful open-source monitoring solution suitable for both small businesses and enterprise environments. By following this tutorial, you will learn how to install all necessary dependencies and ensure secure configuration. The article also explains how to start Zabbix services and access the dashboard. Whether you are an IT admin, DevOps engineer, or learner, this installation guide will help you deploy a stable monitoring system. Let’s get started and build your Zabbix Server on Ubuntu 22.04 easily.
Step 1: Install MariaDB
sudo apt update
sudo apt install mariadb-server -y
sudo mysql_secure_installation
When asked:
• Root password? ➜ Enter
• Set root password? ➜ Y
• Remove anonymous users? ➜ Y
• Disallow remote root login? ➜ Y
• Remove test database? ➜ Y
• Reload privilege tables? ➜ Y
Step 2: Create database for Zabbix
Query the mysql shell with the root user created above (Abc#1234)
sudo mysql -u root -p
Run each command in turn to create the zabbix database and create a zabbix user to administer this database, granting full rights to this user
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER zabbix@localhost IDENTIFIED BY ‘Abc@1234’;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost;
FLUSH PRIVILEGES;
EXIT;
Step 3: Install Zabbix
Install from repo
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-1+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_7.0-1+ubuntu22.04_all.deb
sudo apt update
Step 4: Install Zabbix server + frontend + agent
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y
Step 5: Import database schema for Zabbix
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -u zabbix -p zabbix
Enter the password of the zabbix user created above
Step 6: Configure the Zabbix Server file
sudo nano /etc/zabbix/zabbix_server.conf
Find and edit the line
DBPassword=Abc@1234 (password of zabbix user)
Check and configure PHP (if needed)
sudo nano /etc/zabbix/apache.conf
Check the timezone:
php_value date.timezone Asia/Ho_Chi_Minh
Check if this line is not found Do not change anything in the apache.conf file
sudo systemctl restart apache2
Step 7: Enable the web UI access service
sudo systemctl restart zabbix-server zabbix-agent
sudo systemctl enable zabbix-server zabbix-agent apache2 mariadb
default user/pass by Zabbix Admin/zabbix