1.安装软件源
wget https://repo.zabbix.com/zabbix/5.0/debian/pool/main/z/zabbix-release/zabbix-release_5.0-1+buster_all.deb
dpkg -i zabbix-release_5.0-1+buster_all.deb
apt update
2.安装软件包
apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-agent
3.初始化数据库
mysql_secure_installation
mysql -uroot -p
create database zabbix character set utf8 collate utf8_bin;
create user zabbix@localhost identified by 'password';
grant all privileges on zabbix.* to zabbix@localhost;
quit;
4.导入数据库
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
5.修改配置文件
vi /etc/zabbix/zabbix_server.conf
# DBPassword=password
vi /etc/zabbix/nginx.conf
# listen 80;
# server_name example.com;
vi /etc/zabbix/php-fpm.conf
# php_value[date.timezone] = Asia/Shanghai
6.启动服务并设置开机启动
systemctl restart zabbix-server zabbix-agent nginx php7.3-fpm
systemctl enable zabbix-server zabbix-agent nginx php7.3-fpm