SSD Nodes Learn Hosting plans →
How to do am Matt ConnorBy Matt Connor

How to Install Zabbix 7.0 LTS for Ubuntu 24.04

Set up Zabbix 7.0 LTS for Ubuntu 24.04 with MySQL schema, nginx frontend, and agent2, plus fixes for errors like "Database error" during setup.

Wetin you dey build

Na one Ubuntu 24.04 VPS wey dey run the complete Zabbix 7.0 LTS stack: the zabbix-server daemon wey dey poll and send alerts, MariaDB/MySQL database wey dey store every metric, PHP frontend wey nginx dey serve, and zabbix-agent2 wey dey collect metrics from the box itself. Once e don come up, point am to second server, attach template, and you go get email immediately disk full or service die.

Zabbix heavy pass status-page tool: na real time-series system with templates, triggers, escalation, and history retention. Almost all the wahala dey for three steps wey people dey skip: import database schema, set database password wey the server actually dey read, and uncomment two lines for nginx config. If you do those ones well, the remaining part na wizard. If na only up/down checks and shareable status page you want, lightweight Uptime Kuma status monitor fit do am inside one container; Zabbix worth the extra weight when you need per-metric thresholds and escalation across plenty hosts.

Use the 7.0 LTS line: the server, frontend, agent2, and schema versions match, and e go get security fixes for years. Before you copy the repository filename below, check the official Zabbix download page. The latest release package only configures the 7.0 repository; e no choose any point release. apt go then install whichever 7.0.x packages the repository get, na so e go install the newest one. The page fit also list numbered 7.0-N release packages, but that number na the version for repository setup, no be Zabbix build version. Every other command here stable across the whole 7.0 line.

Sizing, ports and prerequisites

Assume fresh Ubuntu 24.04 KVM VPS wey get root or sudo. Make you dey realistic about resources: 2 GB RAM and two vCPUs na the practical minimum for server, database, nginx and PHP wey dey one machine and dey monitor small number of hosts. 1 GB machine go boot, but database go lack memory as history dey grow; plan for 4 GB once hosts pass few dozen, and once dem pass hundred, move database go its own server. Disk space dey grow based on how many items you dey collect and how long you dey keep history; budget few gigabytes to start, and housekeeper go prune old data based on the retention windows wey you set.

Ports: 80 and 443 for frontend, either make dem public or restrict dem to your own IP. Server dey listen on TCP 10051 for active agents wey dey push data enter, and each agent dey listen on TCP 10050 for server to poll am. If firewall dey in front, open only the ports wey you expose. E good make frontend get DNS A record, because you go want real certificate for am. Zabbix box dey watch every other service wey you run, so e belong inside the wider self-hosting stack wey worth running for 2026, instead of adding am later as afterthought.

Step 1, Add the official Zabbix 7.0 repository

The zabbix-release package get one job: e drop apt source list and signing key inside your system. Install am, then refresh the index.

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

If wget return 404 Not Found, the filename don move again. Open the Zabbix download page, pick Ubuntu 24.04, then copy the exact zabbix-release URL wey e show. A clean apt update go show a repo.zabbix.com line and no key warning. The following signatures couldn't be verified because the public key is not available mean say the release package no install its key, so run the dpkg -i again and update again.

Step 2, Install server, frontend, and agent

Install server wey dem build for MySQL, PHP frontend, nginx config, SQL schema files, and agent2 all at once.

sudo apt install -y zabbix-server-mysql zabbix-frontend-php \
  zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2

zabbix-server-mysql na server wey dem compile for MySQL/MariaDB; if na PostgreSQL you dey use, install zabbix-server-pgsql instead and adjust the database steps below. zabbix-sql-scripts carry the schema wey you go import next. For 7.0, na separate package, and if you forget am, na why import path go later show say e no dey. None of these packages install database engine, so install MariaDB now if the box no already get one.

sudo apt install -y mariadb-server
sudo systemctl enable --now mariadb

Step 3, Create database with the correct character set

Zabbix strict about collation: e only support utf8mb4 with utf8mb4_bin, or the older utf8 (aka utf8mb3) with utf8_bin. The documentation strongly recommend utf8mb4 with utf8mb4_bin, and na wetin this guide dey use. Open root shell with sudo mysql and run:

CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER zabbix@localhost IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost;
SET GLOBAL log_bin_trust_function_creators = 1;
FLUSH PRIVILEGES;

That SET GLOBAL line na safety valve for the import. Zabbix schema dey create deterministic triggers during import, and account wey no be SUPER, like zabbix, no fit create dem while binary logging dey on. MySQL 8 enable binary logging by default, and some managed MariaDB builds dey enable am too, but stock MariaDB no dey. If you skip the flag for server wey binary logging dey enabled, the import go stop with ERROR 1419 (HY000): You do not have the SUPER privilege and binary logging is enabled. Setting am as root clears the problem; turn am off again after the import. Note the password exactly, because server config need the same string byte for byte.

Step 4, Import the schema (na step wey people dey skip)

Na this be the most common reason why fresh frontend no gree load: the database wey you create empty. Load the schema wey dey inside zabbix-sql-scripts enter am.

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

E go ask for zabbix password. E go run for thirty to sixty seconds on small VPS, and e no go print anything if e succeed; silence correct for here. zcat: /usr/share/zabbix-sql-scripts/mysql/server.sql.gz: No such file or directory mean say zabbix-sql-scripts package no dey installed (go back to Step 2). ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' mean say password or grant from Step 3 no correct. Once e finish, turn the safety flag off again:

sudo mysql -e "SET GLOBAL log_bin_trust_function_creators = 0;"

Confirm the load with sudo mysql -e "SELECT COUNT(*) FROM zabbix.users;". If na number, and no be doesn't exist error, schema don enter.

Step 5, Set database password for zabbix_server.conf

Server dey read database credentials from /etc/zabbix/zabbix_server.conf. Na only password need set; DBName and DBUser don already default to zabbix. Remove comment for # DBPassword= line and set am:

DBName=zabbix
DBUser=zabbix
DBPassword=choose-a-strong-password

Password must match the one from Step 3 byte-for-byte. Blank or wrong DBPassword na the main reason for the "Zabbix server is not running" banner wey you go see later: daemon go start, fail to log in, then exit. Nothing for screen go explain this; na only log go show am.

Step 6, Tell nginx where the frontend dey

The zabbix-nginx-conf package dey install one server block for /etc/zabbix/nginx.conf and link am into nginx from /etc/nginx/conf.d/zabbix.conf, but e come with the listen and server_name lines commented out. So nginx no go serve anything for Zabbix until you edit dem:

server {
    listen          80;
    server_name     zabbix.example.com;
    ...
}

Use your domain, or the server public IP if you never get DNS. Two things fit cause wahala. Ubuntu default nginx welcome site too dey listen for port 80 and dem mark am as the default server. So e go answer any request wey name no match. Remove am, or the wrong page go load: sudo rm -f /etc/nginx/sites-enabled/default. If /etc/nginx/conf.d/zabbix.conf somehow no dey there, na known packaging problem, create the link by hand with sudo ln -s /etc/zabbix/nginx.conf /etc/nginx/conf.d/zabbix.conf. Then test and reload:

sudo nginx -t
sudo systemctl reload nginx

nginx -t suppose print test is successful. If e print nginx: [emerg] a duplicate default server for 0.0.0.0:80 instead, both the default site and the Zabbix block claim default_server. Remove the default site and test again. Most times, the test go pass with only one conflicting server name warning, but browser still go show the plain welcome page. That one mean the default site dey win because the request name no match. Remove am to fix the problem.

Step 7, Start and enable the services

Start the server, the agent, PHP-FPM and nginx, then enable dem so dem go continue after reboot.

sudo systemctl restart zabbix-server zabbix-agent2 nginx php8.3-fpm
sudo systemctl enable  zabbix-server zabbix-agent2 nginx php8.3-fpm

Ubuntu 24.04 releases PHP 8.3, so the FPM service na php8.3-fpm; the zabbix-nginx-conf package dey run im frontend under that same master. Confirm say the server start and remain up:

sudo systemctl status zabbix-server --no-pager
sudo tail -n 20 /var/log/zabbix/zabbix_server.log

Healthy log go end with the server started and im housekeeper, poller and trapper processes dey run. If you see [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost', the DBPassword from Step 5 no match, so fix am and restart. A [Z3005] query failed: [1146] Table 'zabbix.dbversion' doesn't exist line mean say you skip the schema import for Step 4, so the server no get anything to read.

Step 8, Complete the web setup wizard

Open http://your-domain-or-ip for your browser. The Zabbix setup wizard go open. Follow these steps:

  1. Welcome, choose language.
  2. Check of pre-requisites, every row suppose show OK by default; the packaged /etc/zabbix/php-fpm.conf pool don already increase the PHP limits wey Zabbix need.
  3. Configure DB connection, database type na MySQL, host na localhost, port na 0 (this one mean the default port or socket), database name na zabbix, user na zabbix, and password na the one from Step 3. Wrong credentials or schema wey no dey show go appear for here.
  4. Settings, leave the Zabbix server host as localhost, port as 10051, then enter name for the installation.
  5. Pre-installation summary, then choose Install. The wizard go write /etc/zabbix/web/zabbix.conf.php.
  6. Finish, log in as Admin (capital A) with password zabbix, then change the password under Users immediately.

If the wizard show Cannot create the configuration file, e mean say the web user no fit write /etc/zabbix/web/. Download the zabbix.conf.php wey e offer, put am there manually with sudo, then click Finish.

Step 9, Add local host and attach template

Zabbix no dey monitor itself automatically. Go Data collection → Hosts → Create host, set the host name to zabbix-server, add am to Linux servers group, and add Agent interface with IP 127.0.0.1 and port 10050. Under Templates, link Linux by Zabbix agent (the passive-poll variant; Linux by Zabbix agent active get the agent push instead). Save.

Within one minute, the host row go show green ZBX label, and metrics go start dey arrive under Monitoring → Latest data. Red ZBX label mean say server no fit reach the agent. Na failure mode wey we cover below, no be mistake for this step.

Step 10, One useful trigger and email alert

The Linux by Zabbix agent template already get triggers for high CPU, low memory, and full disks, so alerts go dey available immediately you link am. To see how one trigger dey work, add your own: open the host, go Triggers → Create trigger, name am Root filesystem over 90% full on {HOST.NAME}, set severity to High, and use this expression:

last(/zabbix-server/vfs.fs.dependent.size[/,pused])>90

vfs.fs.dependent.size[/,pused] na the percent-used item wey the template's filesystem discovery dey create for root filesystem. The Linux template for 7.0 collect vfs.fs.get once and derive dependent items for each mount, so the trigger go fire without extra data collection. Save am.

Trigger by itself only change row colour for dashboard until an action notify person. Under Alerts → Media types → Email, set SMTP server, port, sender address, connection security (usually STARTTLS), and any relay credentials. Then use Test. If test fail, SMTP path get problem before any real alert depend on am. Give Admin user an address under Users → Users → Admin → Media → Add, and choose the severities wey suppose send notification. Then connect am under Alerts → Actions → Trigger actions → Create action: add condition like Trigger severity >= Warning, and under Operations, send to Admin through Email. Save and enable am. You prefer chat? Zabbix 7.0 dey ship webhook media types for Slack, Discord, and Telegram, but each one need its own service setup instead of SMTP settings. Telegram, for example, need bot wey you create through BotFather, the bot token inside the media type's api_token parameter, and recipient's chat ID inside the user's Send to field. Follow the integration's README, enable the media type, assign am to user, and use am inside action just like Email.

Zabbix agent dey monitor second server

To monitor another server, add Zabbix repository for there too. Ubuntu 24.04 no get Zabbix packages by itself. Then install only the agent:

wget https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.0+ubuntu24.04_all.deb
sudo dpkg -i zabbix-release_latest_7.0+ubuntu24.04_all.deb
sudo apt update
sudo apt install -y zabbix-agent2

Edit /etc/zabbix/zabbix_agent2.conf. Set Server to Zabbix server IP for passive polling. For active checks, set ServerActive plus unique Hostname wey match the host wey you create for the frontend:

Server=10.0.0.10
ServerActive=10.0.0.10
Hostname=web-01

Run sudo systemctl restart zabbix-agent2 and allow TCP 10050 from Zabbix server go this machine. The restart important. The package start the agent immediately after installation, with the supplied Server=127.0.0.1. The agent only reads this file when e starts. enable --now go see say e already dey run and change nothing. So the agent go continue to reject your Zabbix server. Start-at-boot don already set because the package enable the unit too. For the frontend, create a host wey Agent interface point to that machine IP. Link the Linux template. E go begin report within one minute.

Problems wey fit happen, and the messages wey you go see

Frontend show Error connecting to database or database error. For wizard DB step, Access denied for user 'zabbix'@'localhost' (using password: YES) mean say the password no match Step 3, or GRANT no run at all. If database connect but frontend report The frontend does not match Zabbix database or Table 'zabbix.users' doesn't exist, schema import for Step 4 no run or e fail. Run am again inside a database wey you just create.

Orange banner: Zabbix server is not running: the information displayed may not be current. Frontend dey up but e no fit reach any live server. Three things fit cause am, and the first one na the most likely. Service don stop; check systemctl status zabbix-server and start am. Service dey run but e no fit reach database; log show [Z3001] connection to database 'zabbix' failed: [1045] Access denied, meaning say DBPassword wrong or empty. Or frontend dey point to wrong server, stored as host localhost port 10051 inside /etc/zabbix/web/zabbix.conf.php. Ubuntu no get SELinux by default, so the SELinux-socket cause wey RHEL guides mention no apply here. For this case, na almost always database password or service wey stop.

Host show red ZBX label; item error Get value from agent failed: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused. Agent no dey run or e no dey listen. Check systemctl status zabbix-agent2 and confirm ListenPort=10050. If timeout happen instead of "connection refused", firewall dey drop port 10050. The related Received empty response from Zabbix Agent. Assuming that agent dropped connection because of access permissions. mean agent dey reachable, but its Server= line no list the Zabbix server IP. Add the IP, then restart agent.

Plain nginx welcome page, or 502 Bad Gateway. Welcome page mean say default site still dey enabled, or Zabbix block no link. Remove /etc/nginx/sites-enabled/default and confirm say /etc/nginx/conf.d/zabbix.conf dey exist, like Step 6 show. 502 mean nginx reach PHP but PHP-FPM don stop or e dey listen on another socket. Start php8.3-fpm and check say the fastcgi_pass socket for Zabbix block match the pool wey dey run.

Backups, upgrades, and TLS

Database na the complete history, so use mysqldump back am on schedule and keep the dump outside the server:

mysqldump --single-transaction zabbix | gzip > zabbix-$(date +%F).sql.gz

The /etc/zabbix config files small and e good to save too, but you fit rebuild dem; data no be so. To restore, do the reverse: create database, import the dump, then point config to am.

Upgrades inside the 7.0 line na normal apt update && apt upgrade runs; server go apply any schema migrations when e start next time, so upgrade the packages and restart zabbix-server. Future major line na deliberate move. Read the upgrade notes, dump database first, and expect schema change wey you no fit reverse. Na because of this one-way jump you pin to LTS line and remain there.

No leave frontend for plain HTTP. Once DNS point to the server, put certificate on am with Certbot and Let's Encrypt on nginx for Ubuntu 24.04, wey go rewrite the server block to listen on 443 and redirect 80. As you dey harden server wey dey log in to monitor every other server you run, secure the SSH too with fail2ban dey ban brute-force SSH attempts. Monitoring login no suppose travel as cleartext, and password guessers no suppose meet the front door open.

FAQ

I need Zabbix agent, or I fit monitor without am?

Both dey work. The agent (agent2) dey give detailed metrics for each host: CPU, memory, disks, processes, services, and log files. Na the normal choice for servers wey you control. Agentless monitoring dey cover devices wey you no fit install software on: SNMP for switches and printers, ICMP ping to check reachability, HTTP checks for endpoints, and IPMI for hardware health. Most real deployments dey mix both methods.

Why frontend dey talk say Zabbix server no dey run?

Frontend dey work, but e no fit reach live zabbix-server process. Usually, server start but e fail to log in because DBPassword for zabbix_server.conf wrong or blank, then e stop immediately. Run systemctl status zabbix-server and read /var/log/zabbix/zabbix_server.log. A [Z3001] connection to database ... failed line go confirm am. Correct the password and restart the service. The banner go clear within one minute.

I must use MySQL, or I fit use PostgreSQL?

Both dey fully supported: zabbix-server-mysql with MariaDB or MySQL as this guide use, or zabbix-server-pgsql with PostgreSQL. For small installations, the choice almost no matter. For large installations, PostgreSQL with the TimescaleDB extension partitions the history tables and makes housekeeping much cheaper. Na why big sites dey prefer am. Pick one and continue with am. If you migrate later, you need full export and re-import. E no be just config switch.

How much RAM Zabbix all-in-one server need?

For one machine wey dey monitor small number of hosts, 2 GB na realistic minimum. 4 GB dey comfortable once you pass few dozen hosts. The memory mostly dey go to database cache and server pollers. A 1 GB VPS fit run, but database go lack memory as history dey grow. Once you pass hundred hosts, move the database to its own server and tune its buffer pool instead of adding more RAM to one machine.

Zabbix no too much for two or three servers?

E fit be. If all you need na “e dey up?” and one page wey you fit share, lighter tool like Uptime Kuma for uptime and status monitoring go set up faster and easier to understand at a glance. Choose Zabbix when you need thresholds for each metric, historical graphs, templated hosts, and escalation rules. Simple pinger no fit give you these things across a fleet.