Introduction

Zabbix is a powerful open-source monitoring solution for networks, servers, applications, and services. This guide will walk you through the steps to install Zabbix on Ubuntu 24.04.

Prerequisites

  • A server running Ubuntu 24.04
  • Root access or a user with sudo privileges
  • A domain name (optional)
  • PostgreSQL or MySQL installed (optional)

Step 1: Update the System

Update your package list and upgrade installed packages:

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Dependencies

Install required software for Zabbix:

sudo apt install -y wget curl gnupg

Step 3: Install Database Server

Zabbix can work with either PostgreSQL or MySQL. Below, we will install PostgreSQL:

sudo apt install -y postgresql postgresql-contrib

Start and enable the PostgreSQL service:

sudo systemctl start postgresql
sudo systemctl enable postgresql

Step 4: Create Zabbix Database

Log into PostgreSQL:

sudo -u postgres psql

Create the Zabbix user and database:

CREATE DATABASE zabbixdb CHARACTER SET UTF8 COLLATE UTF8_BIN;
CREATE USER zabbixuser WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE zabbixdb TO zabbixuser;
\q

Step 5: Add Zabbix Repository

Add the Zabbix repository to your system:

wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_6.0-1+ubuntu24.04_all.deb
sudo apt update

Step 6: Install Zabbix Server, Frontend, and Agent

Now, install the server, frontend, and agent:

sudo apt install -y zabbix-server-pgsql zabbix-frontend zabbix-agent

Step 7: Configure Zabbix Server

Edit the Zabbix server configuration file:

sudo nano /etc/zabbix/zabbix_server.conf

Locate and update the following settings:

DBPassword=your_password

Save the changes and exit the editor.

Step 8: Initialize Zabbix Database

Run the initial Zabbix database schema and data setup with the following command:

sudo -u postgres psql zabbixdb < /usr/share/doc/zabbix-server-pgsql/create.sql

Step 9: Start Zabbix Server and Agent

Start the Zabbix server and agent services:

sudo systemctl start zabbix-server
sudo systemctl start zabbix-agent

Enable these services to start on boot:

sudo systemctl enable zabbix-server
sudo systemctl enable zabbix-agent

Step 10: Configure Zabbix Frontend

Open your web browser and go to:

http://your_server_ip/zabbix

Follow the web interface instructions to configure the frontend. During the installation, you will need to provide your database details:

  • Database type: PostgreSQL
  • Database server: localhost
  • Database name: zabbixdb
  • Database user: zabbixuser
  • User password: your_password

Step 11: Complete Installation

Continue through the web installation wizard until you finish. You should now have Zabbix up and running!

Conclusion

You have successfully installed Zabbix on Ubuntu 24.04. You can now start monitoring your servers and applications with Zabbix!

Resources