Zabbix 7.0 – instructions for installation in 5 minutes

In this tutorial, we will show you how to install and configure the latest Zabbix version 7.0 with a PostgreSQL 16 database on Rocky Linux 9 in five minutes!

Before we start

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

setenforce 0

PostgreSQL installation

In the first step, install the PostgreSQL repositories and disable the default PostgreSQL repositories.

dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm
dnf -qy module disable postgresql

Next, install PostgreSQL – in this case it will be the currently supported version 16.

dnf install -y postgresql16-server

Initialize the database and set it to start automatically.

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

Installation of Zabbix server and its components

The database is now installed, and we can proceed to install the Zabbix server and all of its components.

First, exclude any Zabbix-related installation packages from the EPEL repository. Assuming it’s installed.

This can be done by adding the following line to the end of the /etc/yum.repos.d/epel.repo file:

[epel]
...
excludepkgs=zabbix*

Add the Zabbix repositories and clear the installation cache.

rpm -Uvh https://repo.zabbix.com/zabbix/6.5/centos/9/x86_64/zabbix-release-6.5-2.el9.noarch.rpm
dnf clean all

Now install all necessary Zabbix components.

In this case, we will use Zabbix Agent 2 as the primary monitoring agent, which we recommend you to use, as it brings much more needed functionality.

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

Database initialization

First, create a database user for Zabbix, you will be prompted to enter the desired password.

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

At this point you are able to import the default schema and data.

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

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

Firewall configuration

Finally, enable the ports that are necessary for the Zabbix server to run.

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

TimescaleDB installation

Now let’s get down to installing TimescaleDB and start by adding its official repository.

tee /etc/yum.repos.d/timescale_timescaledb.repo <<EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/$(rpm -E %{rhel})/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL

Install TimescaleDB.

dnf install timescaledb-2-postgresql-16 timescaledb-2-loader-postgresql-16

We run the timescaledb-tune utility and pass it a higher maximum number of connections (--max-conns) as a parameter, which we set to 125 for these testing purposes.

This utility is used to adjust default PostgreSQL settings for performance and to set PostgreSQL parameters to work with TimescaleDB.

At the same time, this utility will help us select the current and valid PostgreSQL configuration file using the installation wizard and will also set up the automatic loading of TimescaleDB libraries.

Please respond “yes” (y) to all questions. Please note, the automatic tuner assumes that PostgreSQL is running on a separate server, so parameter adjustments may be necessary if applicable.

timescaledb-tune --pg-config /usr/pgsql-16/bin --max-conns=125

Subsequently, we restart the system service for PostgreSQL:

systemctl restart postgresql-16.service

All that remains is to create and activate TimescaleDB itself:

Attention, during development, the path has been changed from the original /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql to the new /usr/share/zabbix-sql-scripts/postgresql/timescaledb/schema.sql.

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

Configuration of Zabbix server

Let’s open the Zabbix server configuration file in the path:

nano /etc/zabbix/zabbix_server.conf

In this configuration file modify the following parameters as you can see in the example below:

...
DBPassword=password
StartReportWriters=1
WebServiceURL=http://localhost:10053/report
...

In the next step, install the language packs for Czech and Slovak (optional).

dnf install glibc-langpack-cs.x86_64 glibc-langpack-sk.x86_64

And finally, restart all related services and set them to start automatically on startup:

systemctl restart zabbix-server zabbix-web-service zabbix-agent2 httpd php-fpm
systemctl enable zabbix-server zabbix-web-service zabbix-agent2 httpd php-fpm

In order to verify that the Zabbix server has started properly, we can, among other things, check its log file:

less /var/log/zabbix/zabbix_server.log

If you see a message in the log file that the TimescaleDB version is too new, then this is not a problem at the time of writing this tutorial. Because Zabbix has not yet responded to the latest version of TimescaleDB by setting it as supported one in its code, but compatibility is guaranteed by Zabbix and verified by us (this will be corrected in the production version).

If you want to avoid these informational messages about incompatibility in the Zabbix log file, then just open the configuration file of the Zabbix server in the path /etc/zabbix/zabbix_server.conf and edit the following configuration parameter as can be seen in code block here:

AllowUnsupportedDBVersions=1

Save the file with this setting and restart the Zabbix server system service.

systemctl restart zabbix-server

Configuration of Zabbix frontend

In the browser, open the target URL on which Zabbix is running. For example, http://192.168.0.50/zabbix, where the initial installation wizard will welcome you.

After selecting the default language, click the Next step button to move to the minimum requirements check page.

The first step of installing Zabbix 7.0 and setting the language

If the check is A’OK, you can click on Next step to move to the next page with database connection settings.

The second step of installing Zabbix 7.0 and checking the minimum requirements

Here you only fill in the Password field for access to the database, nothing else needs to be changed.

After filling it in, click Next step again.

The third step of installing Zabbix 7.0 and connecting to the database

On this page, containing the basic settings, fill in the server name, time zone, and click Next step to continue to the configuration summary.

The fourth step of the Zabbix 7.0 installation wizard is to set up the server and select a time zone.

In this summary, check all the previously entered values and then click on Next step to complete the installation.

The fifth step of installing Zabbix 7.0 and checking values before installation

You’re all done now, and by clicking on the Finish button, it will take you to the login screen.

After successful installation of Zabbix 7.0, we can proceed to login by clicking on the "Finish" button.

After successfully logging in using the previously entered data, you can start using the latest Zabbix version 7.0 (Admin/zabbix).

To log in to the new Zabbix 7.0, enter the login name and password in the dialog box.

And this is what the initial dashboard of the new Zabbix 7.0 looks like:

After logging in, a new version of Zabbix 7.0 will be displayed.

Configuration of Zabbix reportingu

In order for the reporting to be fully functional with all its improvements, you must first install Google Chrome.

With the following commands, you can download the installation package and install it as well:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
dnf localinstall google-chrome-stable_current_x86_64.rpm

In the next step, adjust the “Frontend URL” parameter in the Zabbix frontend to the currently valid value, this setting is located here in the menu:

Administration -> General -> Other

You can see an example of this configuration in the image below.

Zabbix 7.0 reporting configuration