In this tutorial, we will walk you through the step-by-step process of installing Zabbix on Alpine Linux Latest.
Start by updating your system with the latest package repositories and software updates.
apk update && apk upgrade
Before installing Zabbix, we need to install some required packages:
apk add nginx php7 php7-fpm php7-curl php7-pdo_mysql php7-opcache php7-gd php7-json php7-xml php7-ctype php7-mbstring php7-iconv php7-zlib php7-zip mariadb mariadb-client mariadb-server-utils
We can now proceed to install Zabbix by following the following steps:
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/noarch/zabbix-openrc-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/noarch/zabbix-bash-completion-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/x86_64/zabbix-nginx-conf-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/x86_64/zabbix-web-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/x86_64/zabbix-web-nginx-conf-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/x86_64/zabbix-agent-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/x86_64/zabbix-server-mysql-5.4.1-r0.apk
wget https://repo.zabbix.com/zabbix/5.4/alpine/edge/noarch/zabbix-mysql-conf-5.4.1-r0.apk
apk add --allow-untrusted zabbix-openrc-5.4.1-r0.apk zabbix-bash-completion-5.4.1-r0.apk zabbix-nginx-conf-5.4.1-r0.apk zabbix-web-5.4.1-r0.apk zabbix-web-nginx-conf-5.4.1-r0.apk zabbix-agent-5.4.1-r0.apk zabbix-server-mysql-5.4.1-r0.apk zabbix-mysql-conf-5.4.1-r0.apk
mysql -u root -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';
FLUSH PRIVILEGES;
exit
zcat /usr/share/doc/zabbix-server-mysql-5.4.1/create.sql.gz | mysql -u zabbix -ppassword zabbix
/etc/zabbix/zabbix_server.conf
and make the following changes:DBName=zabbix
DBUser=zabbix
DBPassword=password
/etc/zabbix/web/zabbix.conf.php
<?php
// Zabbix GUI configuration file
global $DB;
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = 'localhost';
$DB['PORT'] = '0';
$DB['DATABASE'] = 'zabbix';
$DB['USER'] = 'zabbix';
$DB['PASSWORD'] = 'password';
// SCHEMA is relevant only for IBM_DB2 database
$DB['SCHEMA'] = '';
$ZBX_SERVER = 'localhost';
$ZBX_SERVER_PORT = '10051';
$ZBX_SERVER_NAME = '';
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
?>
We can now start the Zabbix services and make sure they start automatically on boot:
rc-update add nginx
rc-update add php-fpm7
rc-update add mariadb
rc-update add zabbix-server-mysql
rc-update add zabbix-agentd
/etc/init.d/nginx start
/etc/init.d/php-fpm7 start
/etc/init.d/mariadb start
/etc/init.d/zabbix-server start
/etc/init.d/zabbix-agentd start
Open your preferred web browser and enter your server's IP address or hostname followed by /zabbix
in the address bar (e.g., http://192.168.1.100/zabbix
). You will be prompted to log in with your Zabbix admin credentials.
Congratulations! You have successfully installed Zabbix on Alpine Linux Latest.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!