This guide on based on Zabbix's own instructions.
Install Postgres server
$ sudo apt install postgresql
Install the Postgres client (psql)
$ sudo apt install postgresql-client
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libwpe-1.0-1 libwpebackend-fdo-1.0-1
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
postgresql-client
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 69.4 kB of archives.
After this operation, 74.8 kB of additional disk space will be used.
Get:1 https://apt.postgresql.org/pub/repos/apt jammy-pgdg/main amd64 postgresql-client all 16+259.pgdg22.04+1 [69.4 kB]
Fetched 69.4 kB in 1s (57.1 kB/s)
Selecting previously unselected package postgresql-client.
(Reading database ... 237637 files and directories currently installed.)
Preparing to unpack .../postgresql-client_16+259.pgdg22.04+1_all.deb ...
Unpacking postgresql-client (16+259.pgdg22.04+1) ...
Setting up postgresql-client (16+259.pgdg22.04+1) ...
Restart service
$ sudo systemctl restart postgresql.service
Test if the Postgress client (psql) can connect to the local server
$ sudo -u postgres psql test_db_name
psql (16.2 (Ubuntu 16.2-1.pgdg22.04+1))
Type "help" for help.
test_db_name=# ALTER USER postgres with encrypted password 'postgres_password';
ALTER ROLE
test_db_name=# \q
Allow the OS to manage the Postgres server
$ systemctl enable postgresql.service
Synchronizing state of postgresql.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable postgresql
Download Zabbix server package
$ wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
--2024-05-07 21:11:18-- https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)...
178.128.6.101, 2604:a880:2:d0::2062:d001
Connecting to repo.zabbix.com (repo.zabbix.com)|178.128.6.101|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3744 (3.7K) [application/octet-stream]
Saving to: ‘zabbix-release_6.4-1+ubuntu22.04_all.deb’
zabbix-release_6.4-1+ubuntu2 100%[===========================================>] 3.66K --.-KB/s in 0s
2024-05-07 21:11:19 (1.11 GB/s) - ‘zabbix-release_6.4-1+ubuntu22.04_all.deb’ saved [3744/3744]
Install package
$ dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
dpkg: error: requested operation requires superuser privilege
$ sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 234606 files and directories currently installed.)
Preparing to unpack zabbix-release_6.4-1+ubuntu22.04_all.deb ...
Unpacking zabbix-release (1:6.4-1+ubuntu22.04) ...
Setting up zabbix-release (1:6.4-1+ubuntu22.04) ...
Update the installed package
$ sudo apt update
Hit:1 http://pk.archive.ubuntu.com/ubuntu jammy InRelease
Hit:2 http://pk.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:3 http://pk.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:4 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 https://storage.googleapis.com/bazel-apt stable InRelease
Hit:7 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InRelease
Hit:8 https://apt.postgresql.org/pub/repos/apt jammy-pgdg InRelease
Hit:9 https://ppa.launchpadcontent.net/mozillateam/ppa/ubuntu jammy InRelease
Get:10 https://dl.packager.io/srv/deb/pghero/pghero/master/ubuntu 22.04 InRelease [1,851 B]
Get:12 https://repo.zabbix.com/zabbix/6.4/ubuntu jammy InRelease [2,874 B]
Get:13 https://repo.zabbix.com/zabbix/6.4/ubuntu jammy/main Sources [15.3 kB]
Get:14 https://repo.zabbix.com/zabbix/6.4/ubuntu jammy/main all Packages [9,042 B]
Get:15 https://repo.zabbix.com/zabbix/6.4/ubuntu jammy/main amd64 Packages [43.5 kB]
Hit:11 https://packagecloud.io/github/git-lfs/ubuntu jammy InRelease
Fetched 72.6 kB in 3s (22.9 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Install Zabbix server, frontend, and agent packages
$ sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.1-pgsql zabbix-apache-conf zabbix-sql-scripts zabbix-agent
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libwpe-1.0-1 libwpebackend-fdo-1.0-1
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apache2 apache2-bin apache2-data apache2-utils fonts-dejavu fonts-dejavu-extra fping libapache2-mod-php
libapache2-mod-php8.1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libevent-core-2.1-7
libevent-pthreads-2.1-7 libmodbus5 libodbc2 libonig5 libopenipmi0 php-bcmath php-common php-gd php-ldap
php-mbstring php-xml php8.1-bcmath php8.1-cli php8.1-common php8.1-gd php8.1-ldap php8.1-mbstring
php8.1-opcache php8.1-readline php8.1-xml snmpd
Suggested packages:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom php-pear odbc-postgresql tdsodbc snmptrapd
zabbix-nginx-conf
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils fonts-dejavu fonts-dejavu-extra fping libapache2-mod-php
libapache2-mod-php8.1 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libevent-core-2.1-7
libevent-pthreads-2.1-7 libmodbus5 libodbc2 libonig5 libopenipmi0 php-bcmath php-common php-gd php-ldap
php-mbstring php-xml php8.1-bcmath php8.1-cli php8.1-common php8.1-gd php8.1-ldap php8.1-mbstring
php8.1-opcache php8.1-pgsql php8.1-readline php8.1-xml snmpd zabbix-agent zabbix-apache-conf
zabbix-frontend-php zabbix-server-pgsql zabbix-sql-scripts
0 upgraded, 41 newly installed, 0 to remove and 3 not upgraded.
Need to get 27.9 MB of archives.
After this operation, 98.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Create a Postgres user and role for Zabbix
$ sudo -u postgres createuser --pwprompt zabbix
Enter password for new role:
Enter it again:
Create a Postgres database for Zabbix
$ sudo -u postgres createdb -O zabbix zabbix
Run scripts to set up Postgres schema
$ zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
CREATE TABLE
CREATE INDEX
CREATE TABLE
CREATE INDEX
CREATE INDEX
...
Validate if schemas exist
psql --user zabbix zabbix --password --host 127.0.0.1
Password:
psql (16.2 (Ubuntu 16.2-1.pgdg22.04+1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
zabbix=> \d
zabbix=> \q
References:
- https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems/448394-fatal-password-authentication-failed-for-user-zabbix-using-postgres
- https://ubuntu.com/server/docs/install-and-configure-postgresql
Edit file /etc/zabbix/zabbix_server.conf to set the database password
$ sudo nano /etc/zabbix/zabbix_server.conf
Start the processes
$ systemctl restart zabbix-server zabbix-agent apache2
Allow these services to be managed by the OS
$ systemctl enable zabbix-server zabbix-agent apache2
Synchronizing state of zabbix-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-server
Synchronizing state of zabbix-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-agent
Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable apache2
Created symlink /etc/systemd/system/multi-user.target.wants/zabbix-server.service → /lib/systemd/system/zabbix-server.service.
Navigate to
Note that the default admin user, once the setup is complete, is "Admin".




