Zabbix 6.2 – instructions for installation in 5 minutes

In this article, we will show you how to install and configure Zabbix 6.2 with a PostgreSQL 14 database on Rocky Linux 8 in five minutes.

Before we start

For the purposes of this example, we will first switch SELinux mode to Permissive.

setenforce 0

PostgreSQL installation

First, install the official PostgreSQL repositories and disable the default system PostgeSQL repositories.

dnf install -y
dnf -qy module disable postgresql

And now install PostgreSQL, in this case it will be PostgreSQL 14.

dnf install -y postgresql14-server

Now all that’s left is to initialize the database and set up automatic startup.

/usr/pgsql-14/bin/postgresql-14-setup initdb
systemctl enable postgresql-14 --now

Installation of Zabbix server and its components

We have installed the database, so let us move on to installing the Zabbix server and its components.
Add the Zabbix repositories and clear the installation cache.

rpm -Uvh 
dnf clean all

Switch default PHP to version 7.4

dnf module enable php:7.4 -y

And then install all of the necessary Zabbix components.

dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent2 zabbix-web-service

Finally, enable all the necessary ports on the firewall.

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-port=10051/tcp
firewall-cmd --reload

Database initialization

In the next step, create a user for Zabbix in the database. You will be prompted to enter a password.

cd /tmp
sudo -u postgres createuser --pwprompt zabbix

Next, create a database and import the default schema and data.

You will be asked to enter your password again. Use the password created in the previous step.

Attention! In older versions of Zabbix, this path is different, namely /usr/share/doc/zabbix-sql-scripts/ !

sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix

TimescaleDB installation

Now let’s get down to installing TimescaleDB.
First add a repository.

tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
baseurl=$(rpm -E %{rhel})/\$basearch

Next, install TimescaleDB.

dnf install timescaledb-2-postgresql-14-2.7.0 timescaledb-2-loader-postgresql-14-2.7.0 -y

Now open the PostgreSQL configuration file /var/lib/pgsql/14/data/postgresql.conf and find this line:

# shared_preload_libraries = ''

Add this line below:

shared_preload_libraries = 'timescaledb'

Save the file and restart the database.

systemctl restart postgresql-14.service

All that remains is to activate TimescaleDB.

Attention! In older versions of Zabbix, this path is different, that is /usr/share/doc/zabbix-sql-scripts/ !

echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql | sudo -u zabbix psql zabbix

Zabbix server configuration

Open the Zabbix server configuration file

nano /etc/zabbix/zabbix_server.conf

and adjust the individual parameters according to the following example.

DBPassword=<heslo do databáze>

Finally, install Czech and Slovak language packs (optional), restart all related services and set them for automatic startup.

dnf install glibc-langpack-cs.x86_64 glibc-langpack-sk.x86_64
systemctl restart zabbix-server zabbix-web-service zabbix-agent2 httpd php-fpm
systemctl enable zabbix-server zabbix-web-service zabbix-agent2 httpd php-fpm
less /var/log/zabbix/zabbix_server.log

Zabbix frontend configuration

In the browser window, open the URL on which Zabbix is running and the installation wizard will welcome us. For example

By clicking on the Next step button, move to the minimum requirements check page.

Před zahájením instalace Zabbix 6.2 zvolíme náš preferovaný jazyk.

Everything is fine, so you can click on the Next step button and move to the next phase with the database connection settings.

Druhým krokem průvodce instalace je kontrola minimálních požadavků.

On this page, fill in the Password field, nothing else needs to be changed. When finished, click on Next step button.

Třetím krokem průvodce instalace je nastavení připojení do databáze.

Fill in the basic settings, i.e. server name and time zone, and then click Next step to continue to the configuration summary.

Čtvrtým krokem průvodce instalace je nastavení serveru a výběr časové zóny.

Check the entered values and click Next step to complete the installation.

Po úspěšné instalaci můžeme přejít k přihlášení kliknutím na tlačítko "Finish".

Click Finish to go to the login screen.

Po ú

Log in and can start using Zabbix 6.2 (Admin/zabbix).

Pro přihlášení v dialogovém okně uvedeme přihlašovací jméno a heslo.

After logging in, you’re welcomed with all the new Zabbix 6.2!

Po přihlášení se dostanete do administrace Zabbix 6.2

Configuration of Zabbix reporting

To use the reporting functions, you must first install Google Chrome.

First, download and install the installation package.

dnf localinstall google-chrome-stable_current_x86_64.rpm

Next, adjust the “Frontend URL” parameter in the configuration of the Zabbix frontend to the current value, this setting can be found in the following path in the menu:

Administration -> General -> Other

You can see an example of the settings in the image below.