Operations 7 min read

Step‑by‑Step Guide: Deploy Zabbix 7.0 on Ubuntu 22.04 LTS

This tutorial walks you through preparing the environment, adding the Zabbix repository, installing required packages, configuring MySQL, setting up Zabbix server and agent, customizing the web interface, and adding monitored hosts on Ubuntu 22.04 LTS, complete with commands and screenshots.

Raymond Ops
Raymond Ops
Raymond Ops
Step‑by‑Step Guide: Deploy Zabbix 7.0 on Ubuntu 22.04 LTS

Ubuntu 22.04 LTS – Deploy Zabbix 7.0

Environment preparation

IP

Hostname

Configuration

10.0.0.50

zabbix-01

2c4G

10.0.0.51

zabbix-agent

2c4G

10.0.0.52

db

2c4G

1. Add Zabbix repository

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

2. Install Zabbix packages

# apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent

3. Install MySQL

# apt install -y mysql-server-8.0
# netstat -tnulp | grep 3306

4. Create initial database

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

Import the initial schema and data:

# scp /usr/share/zabbix-sql-scripts/mysql/server.sql.gz 10.0.0.52:/root
# zcat server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
# mysql
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

5. Configure Zabbix server database

# egrep '^DBHost|^DBName|^DBUser|^DBPassword' /etc/zabbix/zabbix_server.conf
DBHost=10.0.0.52
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

6. Configure PHP for Zabbix frontend

# cat /etc/zabbix/nginx.conf
server {
    listen 8080;
    server_name 10.0.0.50;
    ...
}

7. Start Zabbix server and agent services

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

8. Set Chinese web interface locale

# locale -a
C
C.utf8
POSIX
en_US.utf8
# sed -n '/zh_CN.UTF-8 UTF-8/p' /etc/locale.gen
# sed -i 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen
# locale-gen
# systemctl restart zabbix-server zabbix-agent nginx php8.1-fpm

9. Install Zabbix via web interface

Follow the web wizard, set the timezone to (UTC+08:00) Asia/Shanghai, and complete the installation.

10. Access the web interface

10.0.0.50:8080
Username: Admin
Password: zabbix

Monitoring Hosts

1. Install Zabbix agent on target host

# apt -y install zabbix-agent

2. Edit agent configuration

# vim /etc/zabbix/zabbix_agentd.conf
... 
Server=10.0.0.50
...

3. Restart agent service

# systemctl restart zabbix-agent.service

4. Add host in web interface

Use the Zabbix UI to create a new host and assign the previously installed agent.

5. View host monitoring

After adding the host, its metrics appear on the dashboard.

Final configuration screenshot
Final configuration screenshot
Monitoring dashboard screenshot
Monitoring dashboard screenshot
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationsLinuxmysqlUbuntuZabbix
Raymond Ops
Written by

Raymond Ops

Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.