How to Install Zabbix Server 6.0 on Ubuntu 22.04

Zabbix is a popular open-source monitoring solution that can be used to track and monitor the health and performance of your IT infrastructure. It is a powerful tool that can be used to monitor a wide variety of metrics, including server performance, network traffic, and application uptime.

In this tutorial, we will show you how to install Zabbix Server 6.0 on Ubuntu 22.04. We will cover the following steps:

Step 1: Update Ubuntu system

sudo apt update && sudo apt upgrade -y

Step 2: Install Apache, MariaDB, PHP

Install Apache Webserver

apt install apache2

install MariaDB database server

apt install mariadb-server mariadb-client

Install PHP and other extensions required

apt install php php-{cgi,common,mbstring,net-socket,gd,xml-util,mysql,bcmath,imap,snmp}
apt install libapache2-mod-php

Step 3: Add Zabbix APT repositories

Next we add official Zabbix repository to our Ubuntu system. This repo contains the latest packages of Zabbix as opposed to other methods.

apt install wget -y
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu22.04_all.deb

Install downloaded repository file:

dpkg -i zabbix-release_*ubuntu22.04_all.deb

Step 4: Install Zabbix Server

With the repository added and configured, Zabbix server packages can then be installed on Ubuntu.

apt update
apt install vim zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

Enable PHP CGI

a2enconf php8.*-cgi

Ensure you set correct timezone for your server

$ vim /etc/php/*/apache2/php.ini 
; http://php.net/date.timezone
date.timezone = "Africa/Nairobi"

Restart apache2 web serve

systemctl restart apache2

Step 5: Configure Zabbix server

Login to MariaDB shell as root database user.

mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 31
Server version: 10.6.16-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

Create a database and user for Zabbix:

CREATE DATABASE zabbix character set utf8 collate utf8_bin;;
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@'localhost' IDENTIFIED BY 'Passswd';
FLUSH PRIVILEGES; 
QUIT 

Import database data using the command:

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p'Passswd' zabbix

Edit server configuration file and set database credentials:

vim /etc/zabbix/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=Passswd

Restart Zabbix services:

systemctl restart zabbix-server zabbix-agent apache2

Also set the services to start at system boot.

systemctl enable zabbix-server zabbix-agent apache2

Status of started services can be checked using the commands:

systemctl status zabbix-server zabbix-agent apache2

Step 6: Access Zabbix Server Web UI

Access Zabbix UI using the URL http://SeverIP/zabbix/ or http://hostname/zabbix/

Add your database details appropriately as created in Step 5:

A congratulations message is shown if everything went ok.

The default login details are:

Username: "Admin"
Password: "zabbix"

Zabbix Frontend screenshot:

Step 7: Changing Admin user Password.

Go to Administration > Users > Admin > Password > Change Password as below.

Knowledge Base Linux
Knowledge Base Linux

Kblinux is an abbreviation for the phrase "Knowledge Base Linux." The website shares instructional articles related to the Linux system. I hope my small blog will reach many people who share the same passion for Linux.

Articles: 40

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.