blog-image

Oct 26, 2022

23 min read

How to Install Zabbix on Ubuntu 22.04

Written by

Abdelhadi Dyouri

How to Install Zabbix on Ubuntu 22.04

Introduction

Zabbix is an open-source Linux management software that monitors the availability and performance of IT infrastructure components. Zabbix server can be installed on any Linux distribution. In this tutorial, you will learn how to install the latest Zabbix 6.2 standard release on your Ubuntu 22.04 server. Zabbix provides real-time monitoring of thousands of metric data that it fetches from servers, virtual machines, network devices, and web applications. Analyzing the data Zabbix gathers will give you a general idea of the health of your servers and web applications, in addition to helping you detect potential problems before your users report them. Zabbix has several methods for collecting metrics. These include agentless monitoring of user services and client-server architecture. To monitor a server and collect data from it, Zabbix uses an agent that gathers data from different services and sends it to the Zabbix monitoring server. Zabbix supports encrypted communication between the monitoring server and its monitored clients. This ensures that your data is transferred securely over the network. Zabbix provides a web interface that allows you to monitor your servers (also known as Zabbix clients) and their internal services and manage system settings. In this tutorial, you will install the Zabbix server on an Ubuntu 22.04 server, and configure a MariaDB database, in which Zabbix will store its monitoring data. You will also configure Nginx and PHP on this monitoring server to serve the Zabbix web interface.

Prerequisites

To follow this tutorial you need:
  • Basic knowledge of the Linux command line.
  • An Ubuntu 22.04 server with a non-root user with sudo privileges. You can get affordable, and powerful Ubuntu servers from our website, and you can check out our How to access your server using SSH guide to learn how to access your server and create a sudo user.
  • The LEMP stack (Nginx, MariaDB, and PHP) installed on the server that will run Zabbix. Use our Installing LEMP on Ubuntu 22.04 LTS guide to set it up.
Note: You can use our LEMP 1-Click App to set up LEMP automatically when creating a server. Just visit our website, choose a server, and while prompted to choose the operating system, choose LEMP from the dropdown menu, complete your checkout, and in a couple of minutes our algorithms will take care of all the complex technicalities for you.
  • A TLS/SSL certificate, because the Zabbix Server can access sensitive information about your infrastructure.

Step 1: Installing the Zabbix Server

You first need to install Zabbix onto the server where MariaDB and Nginx should be already be installed. Zabbix offers installation packages for different Linux distributions. Zabbix can be found in Ubuntu's package manager, but it is outdated. To install the most recent stable version, use the official Zabbix repository. To download and install the latest Zabbix server, first get the Zabbix repository configuration package. This can be done by downloading the Zabbix.deb file using the wget command. This .deb file will be used to add the repository. Run the following command:
wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-2+ubuntu22.04_all.deb
Once the download finishes, you can install it with the dpkg command:
sudo dpkg -i zabbix-release_6.2-2+ubuntu22.04_all.deb
After you run the command above, you will see an output like this:
(Reading database ... 218957 files and directories currently installed.)
Preparing to unpack zabbix-release_6.2-2+ubuntu22.04_all.deb ...
Unpacking zabbix-release (1:6.2-2+ubuntu22.04) over (1:6.2-2+ubuntu22.04) ...
Setting up zabbix-release (1:6.2-2+ubuntu22.04) ...
Next, refresh the package index to use this new repository:
sudo apt update
You should see the following as part of the output:
Hit:7 https://repo.zabbix.com/zabbix-agent2-plugins/1/ubuntu jammy InRelease
Hit:8 https://repo.zabbix.com/zabbix/6.2/ubuntu jammy InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
We are now able to install Zabbix after our server has been updated. Next, we will install the Zabbix web frontend with MySQL database support, Zabbix server, and Zabbix apache configuration. Note that we will be using MariaDB, but because its compatible with MySQL, you can just install the MySQL packages and they will work as expected:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts
Here you install the following packages:
  • zabbix-server-mysql: Adds MySQL/MariaDB support to zabbix.
  • zabbix-frontend-php: The PHP Zabbix web interface.
  • zabbix-apache-conf: Apache configuration for Zabbix.
  • zabbix-sql-scripts: Zabbix SQL scripts that will create the Zabbix database and its tables.
This command's will take some time to run. Below are the last few lines of the output:
Setting up zabbix-server-mysql (1:6.2.2-1+ubuntu22.04) ...
Setting up zabbix-sql-scripts (1:6.2.2-1+ubuntu22.04) ...
Setting up zabbix-frontend-php (1:6.2.2-1+ubuntu22.04) ...
update-alternatives: using /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf to prov
ide /usr/share/zabbix/assets/fonts/graphfont.ttf (zabbix-frontend-font) in auto mo
de
Setting up zabbix-apache-conf (1:6.2.2-1+ubuntu22.04) ...
Enabling conf zabbix.
To activate the new configuration, you need to run:
  systemctl reload apache2
Processing triggers for man-db (2.10.2-1)
Continue reading this article
by subscribing to our newsletter.
Subscribe now

A note about tutorials: We encourage our users to try out tutorials, but they aren't fully supported by our team—we can't always provide support when things go wrong. Be sure to check which OS and version it was tested with before you proceed.

If you want a fully managed experience, with dedicated support for any application you might want to run, contact us for more information.

Leave a Reply