how to install Zabbix 7.0 LTS on Ubuntu 24.04
Learn how to setup Zabbix 7.0 LTS for Ubuntu 24.04. We go show you how to add the repo, import MySQL schema, and fix nginx config for agent2 and frontend.
Wetin you dey build
One single Ubuntu 24.04 VPS wey go run full Zabbix 7.0 LTS stack: the zabbix-server daemon wey dey poll and alert, 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 set, you go point am to another server, attach template, and you go get email the moment disk full or service die.
Zabbix heavy pass simple status-page tool: na real time-series system wey get templates, triggers, escalation, and history retention. Most of the wahala dey inside three steps wey people dey skip — to import the database schema, to set the database password wey the server go really read, and to uncomment two lines for nginx config. If you do those ones well, the rest na easy work. If you only want up/down checks and status page wey you fit share, lightweight Uptime Kuma status monitor fit do that one inside one container; Zabbix dey useful when you want per-metric thresholds and escalation for many hosts.
Use the 7.0 LTS line: the server, frontend, agent2, and schema all dey versioned together, and e go get security fixes for many years. Before you copy the repository filename below, look the official Zabbix download page — the latest release package always go give you the newest 7.0 point release, but if you want pin one exact 7.0-N build, the page go list that filename too. Every other command for here dey stable for the whole 7.0 line.
Sizing, ports and prerequisites
Assume say you get fresh Ubuntu 24.04 KVM VPS with root or sudo access. Be honest about the resources: 2 GB of RAM and two vCPUs na the real minimum for server, database, nginx, and PHP if you wan run everything for one box for monitoring small number of hosts. 1 GB box go boot, but the database go struggle as history dey grow; plan for 4 GB once you pass a few dozen hosts, and if you reach over a hundred, move the database go its own server. Disk space go dey grow based on how many items you collect and how long you keep history; budget a few gigabytes to start, and the housekeeper go prune old data based on the retention windows wey you set.
Ports: 80 and 443 for the frontend, e fit dey public or you fit restrict am to your own IP. The server dey listen on TCP 10051 for active agents wey dey push data in, and each agent dey listen on TCP 10050 for the server wey dey poll am. Open only the ports wey you need if you get firewall for front. E good to get DNS A record for the frontend, because you go need real certificate for am — Zabbix box dey watch every other service wey you run, so e belong for the wider self-hosting stack worth running in 2026 instead of just attaching am as afterthought.
Step 1 — Add the official Zabbix 7.0 repository
zabbix-release package do one thing: e go drop the apt source list and signing key for 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 updateIf wget return 404 Not Found, e mean say the filename don move — open the Zabbix download page, pick Ubuntu 24.04, and copy the exact zabbix-release URL wey e print. If apt update clean, e go show 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 the server, frontend, and agent
Install the server wey dem build for MySQL, the PHP frontend, the nginx config, the 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-agent2zabbix-server-mysql na the server wey dem compile for MySQL/MariaDB; if you dey use PostgreSQL, install zabbix-server-pgsql instead and change the database steps wey dey below. zabbix-sql-scripts carry the schema wey you go import next — for version 7.0, e be separate package, and if you forget am, na why the import path go show error later. None of these packages go install database engine for you, so if your box no get one, install MariaDB now.
sudo apt install -y mariadb-server
sudo systemctl enable --now mariadbStep 3 — Create the database with the right character set
Zabbix dey very strict about collation: the database must be utf8mb4 with utf8mb4_bin, or the import go fail halfway with foreign-key errors. Open a 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. The Zabbix schema dey create stored functions, and non-SUPER account like zabbix no fit create dem if binary logging dey on — MySQL 8 dey enable binary logging by default, and some managed MariaDB builds dey do am too (stock MariaDB no dey do am). If you skip the flag for server wey binary logging dey on, the import go stop with ERROR 1419 (HY000): You do not have the SUPER privilege and binary logging is enabled. To set am as root go fix that problem; you fit turn am off again after the import finish. Copy the password exactly — the server config need the same string byte for byte.
Step 4 — Import the schema (wey many people dey skip)
Dis na di main reason why new frontend dey fail to load: di database wey you create empty. Load di schema wey dey inside zabbix-sql-scripts into am.
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | \
mysql --default-character-set=utf8mb4 -uzabbix -p zabbixE go ask for di zabbix password, e go run for thirty to sixty seconds if you dey use small VPS, and e no go print anything if e finish well — if e quiet, e mean say e work. zcat: /usr/share/zabbix-sql-scripts/mysql/server.sql.gz: No such file or directory mean say di zabbix-sql-scripts package no dey installed (go back to Step 2). ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' mean say di password or grant from Step 3 wrong. Once e finish, turn di safety flag off again:
sudo mysql -e "SET GLOBAL log_bin_trust_function_creators = 0;"Confirm di load with sudo mysql -e "SELECT COUNT(*) FROM zabbix.users;" — if you see number, e mean say di schema don enter; if you see doesn't exist error, e mean say e fail.
Step 5 — Set the database password in zabbix_server.conf
Server dey read its database credentials from /etc/zabbix/zabbix_server.conf. Only the password you need to set — DBName and DBUser don already set to zabbix. Remove the # for the # DBPassword= line and set am:
DBName=zabbix
DBUser=zabbix
DBPassword=choose-a-strong-passwordThe password must be exactly the same one wey you use for Step 3. If DBPassword empty or if e wrong, na wetin dey cause "Zabbix server is not running" error wey you go see later: the daemon go start, e no go fit log in, and e go stop. Nothing go show for screen — na only the log go tell you.
Step 6 — Point nginx at the frontend
zabbix-nginx-conf package dey install server block for /etc/zabbix/nginx.conf and e dey link am into nginx from /etc/nginx/conf.d/zabbix.conf. But dem don comment out listen and server_name lines, 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 set DNS yet. Two things fit cause wahala. Ubuntu default nginx welcome site dey listen for port 80 and e set as default server, so e go take any request wey name no match — you must remove am or wrong page go load: sudo rm -f /etc/nginx/sites-enabled/default. And if /etc/nginx/conf.d/zabbix.conf missing somehow (na one packaging quirk), create the link manually with sudo ln -s /etc/zabbix/nginx.conf /etc/nginx/conf.d/zabbix.conf. After that, test and reload:
sudo nginx -t
sudo systemctl reload nginxnginx -t suppose print test is successful. If e print nginx: [emerg] a duplicate default server for 0.0.0.0:80 instead, e mean say both default site and Zabbix block dey fight for default_server — remove the default site and test again. Most times, test go pass with only conflicting server name warning but browser still dey show the plain welcome page: dat one mean say default site dey win for unmatched name, and removing am go fix am.
Step 7 — Start and enable the services
Start the server, the agent, PHP-FPM, and nginx. Make sure you enable dem so dem go start automatically when the system reboot.
sudo systemctl restart zabbix-server zabbix-agent2 nginx php8.3-fpm
sudo systemctl enable zabbix-server zabbix-agent2 nginx php8.3-fpmUbuntu 24.04 dey carry PHP 8.3, so the FPM service na php8.3-fpm; the zabbix-nginx-conf package dey run its frontend under that same master. Check if the server start well and stay up:
sudo systemctl status zabbix-server --no-pager
sudo tail -n 20 /var/log/zabbix/zabbix_server.logIf everything dey okay, the log go end with "server started" and dem go show say housekeeper, poller and trapper processes dey run. If you see [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost', e mean say the DBPassword wey you do for Step 5 no match — fix am and restart. If you see [Z3005] query failed: [1146] Table 'zabbix.dbversion' doesn't exist line, e mean say you skip the schema import for Step 4, so the server no get anything to read.
Step 8 — Finish the web setup wizard
Go to http://your-domain-or-ip. The Zabbix setup wizard go open. Follow the steps:
- Welcome — pick one language.
- Check of pre-requisites — every row suppose show OK immediately; the
/etc/zabbix/php-fpm.confpool wey dey inside don already set the PHP limits wey Zabbix need. - Configure DB connection — set database type as MySQL, host as
localhost, port as0(wey mean default port or socket), database name aszabbix, user aszabbix, and use the password from Step 3. If credentials wrong or schema missing, error go show for here. - Settings — leave the Zabbix server host as
localhost, port as10051, and give the installation one name. - Pre-installation summary, then Install — the wizard go write
/etc/zabbix/web/zabbix.conf.php. - Finish — log in as
Admin(capital A) with passwordzabbix, and change that password immediately under Users.
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 suggest, carry am go put there manually with sudo, then click Finish.
Step 9 — Add the local host and attach a template
Zabbix no dey monitor itself automatically. Go to Data collection → Hosts → Create host, set the host name to zabbix-server, add am to the Linux servers group, and add an Agent interface with IP 127.0.0.1, port 10050. Under Templates, link Linux by Zabbix agent (na the passive-poll variant; Linux by Zabbix agent active dey use agent push instead). Save am.
Within one minute, the host row go show green ZBX label and metrics go start to show under Monitoring → Latest data. If you see red ZBX label, e mean say the server no fit reach the agent — na failure mode wey we go explain below, e no mean say you mess up this step.
Step 10 — One useful trigger and an email alert
Linux by Zabbix agent template don come with triggers for high CPU, low memory, and full disks, so you go get alerts immediately you link am. To see how one be, add your own: open the host, go to 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])>90vfs.fs.dependent.size[/,pused] na the percent-used item wey the template's filesystem discovery create for the root filesystem (7.0's Linux template collect vfs.fs.get once and use am for all mount items), so the trigger go fire without extra data collection. Save am.
Trigger dey only change color of row for dashboard until an action notify person. Go Alerts → Media types → Email, set the SMTP server, port, sender address, connection security (usually STARTTLS) and any relay credentials, then click Test — if e fail for there, e mean say the SMTP path wrong before you start to rely on am for real alerts. Give the Admin user one address under Users → Users → Admin → Media → Add and pick which severities go notify. Then connect am under Alerts → Actions → Trigger actions → Create action: add one condition like Trigger severity >= Warning, and under Operations send to Admin via Email. Save and enable am. You prefer chat? Zabbix 7.0 come with webhook media types for Slack, Discord and Telegram — configure one exactly like Email and assign am to a user.
Monitoring a second server with the agent
To watch another server, you must add the Zabbix repository for that machine too — Ubuntu 24.04 no get Zabbix packages inside itself — then just install 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-agent2Edit /etc/zabbix/zabbix_agent2.conf, set Server to the Zabbix server IP (if you want passive polling) and, for active checks, set ServerActive plus one unique Hostname wey match the host wey you create for frontend:
Server=10.0.0.10
ServerActive=10.0.0.10
Hostname=web-01Run sudo systemctl enable --now zabbix-agent2 and open TCP 10050 from the Zabbix server to this box. Go back to the frontend, create one host wey Agent interface point to that machine IP, link the Linux template, and e go report within one minute.
Failure modes, with the strings you will see
Frontend show Error connecting to database or database error. For the wizard's DB step, Access denied for user 'zabbix'@'localhost' (using password: YES) mean say password no match Step 3 or GRANT never run. If database connect but frontend show The frontend does not match Zabbix database or Table 'zabbix.users' doesn't exist, e mean say Step 4 schema import fail or dem skip am — re-run am for brand new database.
Orange banner: Zabbix server is not running: the information displayed may not be current. Frontend dey work but e no fit reach live server. Three things fit cause am, first one na most likely. Service don die — check systemctl status zabbix-server and start am. Service dey run but e no fit reach database — log go show [Z3001] connection to database 'zabbix' failed: [1045] Access denied, e mean say DBPassword wrong or e empty. Or frontend dey point to wrong server, wey dem store as host localhost port 10051 inside /etc/zabbix/web/zabbix.conf.php. For Ubuntu, SELinux no dey by default, so that SELinux-socket issue wey RHEL guides talk no apply here; for here, na almost always database password or service wey stop dey cause am.
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 you see timeout instead of "connection refused", e mean say firewall dey block port 10050. The related Received empty response from Zabbix Agent. Assuming that agent dropped connection because of access permissions. mean say agent dey reachable but its Server= line no get Zabbix server IP — add the IP and restart the 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 make sure say /etc/nginx/conf.d/zabbix.conf dey there, just like Step 6. 502 mean say nginx reach PHP but PHP-FPM don die or e dey listen for different socket — start php8.3-fpm and check say fastcgi_pass socket for Zabbix block match the one wey dey run.
Backups, upgrades, and TLS
Database na everything history, so use mysqldump back am for schedule and keep the dump far from the box:
mysqldump --single-transaction zabbix | gzip > zabbix-$(date +%F).sql.gzThe /etc/zabbix config files small, dem worth to save, but you fit rebuild dem; the data no be like that. To restore na to do the reverse — create the database, import the dump, and point the config for am.
Upgrades inside the 7.0 line na normal apt update && apt upgrade runs; the server go apply any schema migrations when e start next time, so upgrade the packages and restart zabbix-server. Major line upgrade na big move — read the upgrade notes, dump the database first, and know say the schema change na one-way. Na that one-way jump be why you dey pin to an LTS line and stay for am.
No leave the frontend for plain HTTP. Once DNS point for the box, put certificate for 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 one box wey dey log in to watch every other server wey you run, lock down its SSH too with fail2ban banning brute-force SSH attempts. Monitoring login no suppose travel for cleartext, and its front door no suppose open for people wey dey guess password.
FAQ
I need Zabbix agent, or I fit monitor without am?
Both work. Agent (agent2) dey give plenty metrics for every host — CPU, memory, disks, processes, services, log files — and na him people dey normally use for servers wey you control. Agentless monitoring dey cover devices wey you no fit install software: SNMP for switches and printers, ICMP ping for reachability, HTTP checks for endpoints, IPMI for hardware health. Most real deployments dey mix the two.
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 e blank, so e fall back. Run systemctl status zabbix-server and read /var/log/zabbix/zabbix_server.log; if you see [Z3001] connection to database ... failed line, e confirm am. Fix the password and restart, and the banner go clear within one minute.
I must use MySQL, or I fit use PostgreSQL?
Both dey work well: zabbix-server-mysql with MariaDB or MySQL like we dey do for this guide, or zabbix-server-pgsql with PostgreSQL. For small installs, the choice no really matter. For big ones, PostgreSQL with the TimescaleDB extension dey partition the history tables and e dey make housekeeping cheap, na why big sites dey prefer am. Pick one and stick to am — if you wan change later, you go need do full export and re-import, e no be just to change config.
How much RAM Zabbix all-in-one server need?
If you dey use one box to monitor small number of hosts, 2 GB na the minimum and 4 GB dey make am easy; the memory dey go mostly to database cache and server pollers. 1 GB VPS fit run, but e go starve the database as history dey grow. If you pass hundred hosts, split the database put for its own server and tune its buffer pool instead of to just dey add RAM for one machine.
Zabbix too heavy for just two or three servers?
E fit be so. If all you need na just to know "is it up?" and one page wey you fit share, lighter tool like Uptime Kuma for uptime and status monitoring dey fast to set up and e easy to read at a glance. Choose Zabbix when you want per-metric thresholds, historical graphs, templated hosts and escalation rules — the things simple pinger no fit give you for many machines.