Deploying Zabbix Server on Ubuntu 24.04
Introduction
This is a quick post on how to install Zabbix on Ubuntu.
Parts of this document are copied from the official Zabbix documentation at https://www.zabbix.com/download?zabbix=7.0&os_distribution=ubuntu&os_version=24.04&components=server_frontend_agent&db=pgsql&ws=nginx for my own reference.
Selections at the time of writing:
- Zabbix 7.0 LTS
- Ubuntu
- 24.04 (noble)
- Server, Frontend, Agent
- PostgreSQL
- Nginx
Installation
Repository configuration
We’ll use the script from the GitHub repository iac-scripts from CoreLayer to configure the Zabbix repository.
GitHub Repository
git clone https://github.com/corelayer/iac-scripts /tmp/iac-scripts
sudo sh /tmp/iac-scripts/linux/software/zabbix/ubuntu-24-04/apt-configure-7.0.sh
Server installation
sudo apt install zabbix-server-pgsql zabbix-frontend-php php8.3-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
Configuration
Database configuration
On the database server, create a PostgreSQL user and database, using either the manual commands below, or by running the configuration script in iac-scripts.
From script:
sudo sh /tmp/iac-scripts/linux/software/zabbix/configure-pgsql.sh
Manual:
sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
Schema import
Because we are running the database server on a different machine, we need to get the schema to the database server before importing.
On the database server, execute the following commands to download and install the scripts
sudo apt-get install zabbix-sql-scripts
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
