Install Zabbix on Ubuntu Server 24.04 LTS – Complete Guide

To install Zabbix on Ubuntu Server 24.04, add the official Zabbix 8.0 repository, install the server, frontend, Apache config and agent packages, create a MariaDB database and import the schema. Then point zabbix_server.conf at it and finish the setup wizard at http://YourServer/zabbix.

Short version

Terminalbash
wget https://repo.zabbix.com/zabbix/8.0/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_8.0+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_latest_8.0+ubuntu24.04_all.deb
sudo apt update
sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent2 mariadb-server

sudo mariadb -e "CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
sudo mariadb -e "CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'YourPassword';"
sudo mariadb -e "GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';"
sudo mariadb -e "SET GLOBAL log_bin_trust_function_creators = 1;"
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
sudo mariadb -e "SET GLOBAL log_bin_trust_function_creators = 0;"

# set DBPassword=YourPassword in /etc/zabbix/zabbix_server.conf, then:
sudo systemctl enable --now zabbix-server zabbix-agent2 apache2

Zabbix is an open-source monitoring software for networks, operating systems, and applications created in Latvia by Alexei Vladishev. It is designed to monitor and track the status of various network services, servers, and other network hardware.

I will take you through the whole process, step by step. To install Zabbix, you first need a running Ubuntu Server 24.04 LTS. I won’t go over that installation in this tutorial.

Table of Contents

Step 1 - Updating your System

First things first, make sure your Ubuntu is up to date.

Terminalbash
sudo apt update
sudo apt upgrade -y
sudo apt autoremove -y

Step 2 - Adding the Zabbix Repository

Zabbix 8.0 is the current release line on the Zabbix download page. The official repository ships release packages for several Ubuntu versions, so pick the file that matches your system. For 24.04 it looks like this:

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

On another Ubuntu release, replace ubuntu24.04 in both file names with your version. You can browse the available files in the repository listing.

Step 3 - Installing the Zabbix Packages

Zabbix 8.0 needs MySQL 8.4 or newer, or MariaDB 10.11 or newer, according to the Zabbix requirements. Ubuntu 24.04 ships MariaDB 10.11, so that is what I use here. One command installs the server, the web frontend with its Apache configuration, the SQL scripts, the agent and the database:

Terminalbash
sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent2 mariadb-server

Step 4 - Creating the Zabbix Database

Create the database and a dedicated user. Replace YourPassword with a strong password of your own and remember it, you need it twice more.

Terminalbash
sudo mariadb -e "CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
sudo mariadb -e "CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'YourPassword';"
sudo mariadb -e "GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';"

The schema creates stored functions, so allow that while you import and switch it off again afterwards. The import asks for the password of the zabbix user:

Terminalbash
sudo mariadb -e "SET GLOBAL log_bin_trust_function_creators = 1;"
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
sudo mariadb -e "SET GLOBAL log_bin_trust_function_creators = 0;"

If the zcat path does not exist on your system, list the files of the package with dpkg -L zabbix-sql-scripts and use the server.sql.gz for MySQL that it shows.

Step 5 - Configuring the Zabbix Server

Open the Zabbix server config.

Terminalbash
sudo nano /etc/zabbix/zabbix_server.conf

Find the following entry (using CTRL + W), remove the # in front of it if there is one, and set the password you chose in Step 4. DBName and DBUser already default to zabbix.

Snippettext
DBPassword=YourPassword

Save with CTRL + X and confirm with Y.

Step 6 - Starting Zabbix

Enable the services so they start with the system, and start them right away. Apache serves the web frontend.

Terminalbash
sudo systemctl enable --now zabbix-server zabbix-agent2 apache2
sudo systemctl status zabbix-server

If all goes well, you’ll see active (running). Leave the status page by pressing Q. The screenshot below is from the original Ubuntu 16.04 version of this guide, the output looks similar today but not identical.

How To Install Zabbix Ubuntu Server 16.04

Step 7 - Configuring the Web Interface

Open the frontend in your web browser by entering the IP or name of your server like so: http://YourServer/zabbix

The screenshots in this step are from an older Zabbix release. The wizard follows the same flow today but looks different: Welcome, Check of pre-requisites, Configure DB connection, Settings and Pre-installation summary.

On the Welcome screen choose your language and click next.

How To Install Zabbix Ubuntu Server 16.04

Everything on the Check of pre-requisites page should be green.

Install Zabbix Ubuntu Server 16.04 Beginner Guide

Now enter the Zabbix DB credentials. Choose MySQL as the database type and enter the following.

  • Database host: localhost
  • Database Name: zabbix
  • User: zabbix
  • Password: the password from Step 4
How To Install Zabbix Ubuntu Server

On the Settings page, give your server a name, that’s optional but you can name it something like zabbix.YourCompany.com. This is also where you set the default time zone. Finish the wizard on the summary page.

Install Zabbix Ubuntu Server dummies

Step 8 - Logging In

Now we are almost done with the basic installation. Log in with:

  • Username: Admin
  • Password: zabbix

Change the password ASAP. You are now presented with the Zabbix Dashboard. Zabbix needs an accurate clock, so check that your server’s time is synchronized with timedatectl.

FAQ

Which Zabbix and Ubuntu versions does this guide use?

Zabbix 8.0 and Ubuntu Server 24.04 LTS. The Zabbix repository also has release packages for other Ubuntu versions, so swap the version in the file name. The old 3.4 repository from the 16.04 version of this guide is no longer something you should install.

What is the default Zabbix login?

Username Admin, password zabbix, as listed in the Zabbix frontend documentation. Change it right after your first login.

Why does http://YourServer/zabbix not load?

Check that Apache is running with sudo systemctl status apache2 and that the zabbix-apache-conf package is installed. With Apache, the frontend lives under /zabbix, so opening only the server address will not show it.

The Zabbix server does not start or cannot connect to the database. What now?

Run sudo journalctl -u zabbix-server -e and read the last lines. Most of the time DBPassword in /etc/zabbix/zabbix_server.conf does not match the password of the zabbix database user, or the schema was not imported.

Can I use MySQL or PostgreSQL instead of MariaDB?

Yes. The Zabbix requirements list MySQL 8.4 or newer, MariaDB 10.11 or newer and PostgreSQL 15 or newer. PostgreSQL needs its own server package and schema import, so follow the Zabbix download page for that variant.

Wrapping Up

This concludes the Basic Zabbix Installation. You can now already get a bit familiar with the Settings and the Dashboard. In the next Tutorial, we will configure the rest and add a few clients to get monitored by our Zabbix Server. In the meanwhile, you can check out some other Open Source Tutorials.

whoami

Stefan founded Ceos3c in 2016 and has spent a decade teaching cybersecurity, Linux, and web development through hands-on tutorials. He builds and ships real products while sharing his journey: ProofSwap.me, XPMetric.com, and EasyEarningsTracker.com.

More about me