How to Install and Configure Zabbix 7 With Postgresql and Nginx on Rocky/Alma Linux 9

Step-by-step guide on How to Install and Configure Zabbix 7 With Postgresql and Nginx on Rocky Alma Linux 9

Install and configure Zabbix for your platform

Ensure that the server packages are up to date

Before proceeding, let us make sure that our server packages are up to date with this command:

1
sudo dnf -y update

Let us also install some common packages that we will need

1
sudo dnf install -y vim

Install and configure Zabbix for your platform

Install Zabbix repository

If the epel repo is not enabled, check How to Install and Enable Epel Repo on Rocky/Alma Linux 9 before proceeding.

Disable Zabbix packages provided by EPEL, if you have it installed.

Edit file /etc/yum.repos.d/epel.repo

1
sudo vim /etc/yum.repos.d/epel.repo

Add the following statement.

1
2
3
[epel]
...
excludepkgs=zabbix*

Proceed with installing zabbix repository.

1
sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.2/release/alma/9/noarch/zabbix-release-latest-7.2.el9.noarch.rpm

Do dnf clean all

1
sudo dnf clean all

Install Zabbix server, frontend, agent

1
sudo dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

Create initial database

Make sure you have database server up and running. Checkout this post on How to Install and Configure Postgres 17 on Rocky Alma Linux 9

Create a postgres user

1
sudo -u postgres createuser --pwprompt zabbix

Type the password when prompted.

Then create the zabbix db

1
sudo -u postgres createdb -O zabbix zabbix

On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.

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

Configure the database for Zabbix server

Edit file /etc/zabbix/zabbix_server.conf

1
sudo vim /etc/zabbix/zabbix_server.conf

Add this

1
DBPassword=password

Configure PHP for Zabbix frontend

Edit file /etc/nginx/conf.d/zabbix.conf uncomment and set listen and server_name directives.

1
sudo vim /etc/nginx/conf.d/zabbix.conf

Edit

1
2
listen 8080;
server_name zabbix.citizix.com;

Ensure that you have zabbix.citizix.com mapped to the server IP

Start Zabbix server and agent processes

Start Zabbix server and agent processes

1
sudo systemctl restart zabbix-server zabbix-agent nginx php-fpm

and make it start at system boot.

1
sudo systemctl enable zabbix-server zabbix-agent nginx php-fpm

Open Zabbix UI web page

The URL for Zabbix UI when using Nginx depends on the configuration changes you should have made, in my case zabbix.citizix.com.

Visit the UI and proceed with the set up:

  • Confirm prerequisites, if server can handle
  • Configure db access
  • Configure Server name and choose timezone
  • If all the settings you provided are correct, you will get a congratulatory message notifying you of the successful setup of Zabbix’s front end.
1
2
Congratulations! You have successfully installed Zabbix frontend.
Configuration file "etc/zabbix/web/zabbix.conf.php" created.

Press on the ‘Finish’ button. This directs you to the Zabbix login page. Log in with the following credentials:

Username: Admin Password: zabbix

Then click on ‘Sign in’ to access the Zabbix dashboard. You can change the password later for added security, so don’t worry about that.

Finally, you will get access to Zabbix’s dashboard

That is it! We have successfully installed the Zabbix monitoring tool on Rocky Linux 9.

comments powered by Disqus
Citizix Ltd
Built with Hugo
Theme Stack designed by Jimmy