How to Install Zabbix 7.x on Ubuntu 24.04 Step by Step

Zabbix gives you one dashboard for CPU load, disk space, memory use, and service status across your servers. This guide shows you how to install zabbix 7 on ubuntu 24.04 from the official repository, with MySQL as the database and Apache serving the web frontend. You will finish with a working server, a logged-in frontend, and one monitored host. The steps assume a clean Ubuntu 24.04 server with root or sudo access.

What you need before you start

Use a VPS with at least 2 vCPU cores and 4 GB of RAM. Zabbix can run on less, but the server, database, and frontend share one machine here. You also need a static IP or a domain name that points at the server, plus MySQL installed or ready to install. If you have not checked your current load yet, read our guide on how to check VPS resource usage with htop, df, and free.

Log in over SSH as a sudo user and update the package lists:

sudo apt update
sudo apt upgrade -y

Set the correct timezone for the server as well, because Zabbix timestamps and alert times depend on it. Replace Asia/Jakarta with your own timezone if your servers sit in another region:

sudo timedatectl set-timezone Asia/Jakarta
timedatectl

Install Zabbix 7 on Ubuntu 24.04: add the repository

Ubuntu 24.04 does not ship Zabbix 7 in its default repositories, so add the official repository first. Go to the official Zabbix download page, pick Zabbix 7.x, Ubuntu 24.04, MySQL, and Apache, and copy the download link for the release package shown there. Check the official Zabbix download page for the current package name, because the file name changes with each release:

cd /tmp
wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_7.0-2+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_7.0-2+ubuntu24.04_all.deb
sudo apt update

The apt update step pulls in the new repository lists before you install anything from them.

Install the Zabbix server, frontend, and agent

With the repository in place, install the server, the web frontend, and the agent in one command. This is the core of the zabbix frontend apache mysql stack: MySQL stores the data, Apache serves the PHP frontend, and the agent reports metrics back to the server.

sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

The agent package on this same machine lets the server monitor itself. A zabbix agent install ubuntu step on a second server uses the same repository and package, plus a small config change to point the agent at this server.

Create the Zabbix database in MySQL

Zabbix needs its own database and MySQL user. Log in to MySQL as root and create both:

sudo mysql -u root -p

Inside the MySQL prompt, run these statements, replacing strong_password_here with a long password from your password manager:

create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'strong_password_here';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;

Next, import the schema that ships with the zabbix-sql-scripts package:

zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

Type the database password when prompted, then turn the function creator setting back off:

sudo mysql -u root -p -e "set global log_bin_trust_function_creators = 0;"

That setting only needs to stay on while the import creates functions.

Point the Zabbix server at the database

Open the server configuration file and set the database password to the one you created above:

sudo nano /etc/zabbix/zabbix_server.conf

Find the DBPassword line, remove the # at the start if present, and set your password:

DBPassword=strong_password_here

Leave the host and database name at their defaults, because MySQL runs on the same server and the database is named zabbix. This part of the zabbix server ubuntu setup is where most first-time installs fail, and the cause is almost always a typo in this one line, so check it twice.

Set the PHP timezone for the frontend. Open the Apache config that ships with Zabbix:

sudo nano /etc/zabbix/apache.conf

Find the php_value date.timezone line, uncomment it, and set your timezone:

php_value date.timezone Asia/Jakarta

Save the file.

Open the firewall and start the services

Zabbix uses port 10051 for the server and port 10050 for the agent. The frontend needs port 80 now, and port 443 later once you add HTTPS. If you run UFW, open those ports:

sudo ufw allow 10051/tcp
sudo ufw allow 10050/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw status

For more on UFW rules and defaults, see our guide on how to set up firewall rules with UFW on Ubuntu Server 24.04. Then start the Zabbix server, the agent, and Apache, and set them to start at boot:

sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2

Check that all three services are running:

sudo systemctl status zabbix-server zabbix-agent apache2 --no-pager

If any service shows a failed state, read its log before you change anything else. The server log sits at /var/log/zabbix/zabbix_server.log and usually names the exact problem, such as a wrong database password or a port already in use.

Finish the web setup wizard

Open a browser and go to http://your-server-ip/zabbix. The wizard starts with a welcome screen, then a pre-requisite check where every item should show OK. If the PHP timezone shows a warning, go back to /etc/zabbix/apache.conf, fix the timezone line, and restart Apache.

The next screens ask for the database connection. Enter these values:

  • Database type: MySQL
  • Database host: localhost
  • Database port: 0 (the default, which means use the local socket)
  • Database name: zabbix
  • User: zabbix
  • Password: the password you set in MySQL

After that, give the server a name, confirm the summary screen, and finish the wizard. Log in with username Admin and password zabbix. Change that password right away under Administration, then Users, then Admin. Leaving the default password in place leaves the dashboard open to anyone who finds it.

Add your first host and check the first trigger

The server already has its own agent installed, so add the server itself as the first host. Go to Data collection, then Hosts, and click Create host. Fill in the hostname, pick the group Linux servers, and add an agent interface with the server IP address and port 10050. Then link the template Linux by Zabbix agent, save the host, and wait a few minutes.

Go back to the host list. The availability column should turn green for Zabbix agent, which means the server can reach the agent. If it stays grey, check that the agent service runs and that port 10050 is open.

Next, look at the first data. Go to Monitoring, then Latest data, pick your new host, and you should see CPU load, free memory, and disk space filling in. Triggers come from the linked template: open Monitoring, then Problems, and the list should be empty on a healthy server. When a trigger fires later, for example high CPU load or a full disk, it shows up here with a severity level and a timestamp.

For a lighter tool that only checks whether sites and services answer, Uptime Kuma in Docker covers uptime checks with far less setup. Zabbix fits better when you want metrics, history, and triggers from inside each server. If you are weighing paid platforms instead, our Zabbix vs PRTG comparison lays out how the two differ; check official pricing on the vendor site before you decide.

What to check when something fails

Most failed installs trace back to a short list of causes. Work through them in order instead of reinstalling.

  • Frontend shows a database connection error: the password in /etc/zabbix/zabbix_server.conf does not match the MySQL user password. Fix the file and restart the server service.
  • Wizard pre-requisite check fails on PHP settings: set the timezone in /etc/zabbix/apache.conf and restart Apache.
  • Host stays grey: the agent is not running, the server IP in the host interface is wrong, or port 10050 is blocked. Check systemctl status zabbix-agent and the agent log at /var/log/zabbix/zabbix_agentd.log.
  • Server service fails to start: read /var/log/zabbix/zabbix_server.log. A database permission error or a schema import that never ran is the usual cause.
  • No data after the host turns green: wait five minutes. Templates collect on a schedule, and the first values take a cycle or two to appear.

Keep the server updated with the same routine you use for the rest of the system. Our guide on automatic security updates on Ubuntu with unattended-upgrades shows how.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.