On this page
- When is Zabbix the right choice?
- Which version and repository should I use?
- How do I install the server packages?
- How do I create the database and import the schema?
- How do I configure Nginx with HTTPS?
- How do I finish the web installer and secure the login?
- How do I add another server over the public internet?
- How do I keep Zabbix healthy?
- Questions
When is Zabbix the right choice?
Zabbix suits you when you want one system for metrics, triggers, escalations, maps and inventory, configured mostly through a web interface. It ships hundreds of templates for Linux, web servers, databases and network gear, keeps its data in a SQL database and can discover filesystems and network interfaces on its own. The price is weight: a server, a database, PHP and a web server all need to run together, so plan at least 2 vCPU and 4 GB RAM for the monitoring host.
For a single server, lighter tools such as Netdata or Beszel are quicker to set up. Zabbix shines once you have several machines and want rules like "alert only if the website fails for five minutes and the server is reachable".
Which version and repository should I use?
This guide uses Zabbix 7.0 LTS, which receives long term support from the project. Newer standard and LTS releases may be listed on the official download page; the steps stay the same apart from the version in the repository URL. Always use the project repository rather than distro packages, which are older or missing. Choose your OS on the download page to confirm the exact package name.
# Ubuntu 24.04
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
# Debian 12 (use debian13 in the file name on Debian 13)
wget https://repo.zabbix.com/zabbix/7.0/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.0+debian12_all.deb
sudo dpkg -i zabbix-release_latest_7.0+debian12_all.deb
# Rocky Linux 9 (replace rocky with alma on AlmaLinux 9)
sudo rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpmOn Rocky and Alma, if EPEL is enabled, add excludepkgs=zabbix* to the [epel] section of /etc/yum.repos.d/epel.repo so dnf does not mix packages from two sources.
How do I install the server packages?
# Ubuntu and Debian
sudo apt update
sudo apt install -y zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf \
zabbix-sql-scripts zabbix-agent2 mariadb-server
# Rocky Linux and AlmaLinux
sudo dnf clean all
sudo dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf \
zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2 mariadb-server
sudo systemctl enable --now mariadbRun sudo mariadb-secure-installation afterwards to remove test users and the test database. The MariaDB guide covers tuning if your Zabbix database grows.
How do I create the database and import the schema?
Create a database with the binary collation Zabbix expects, plus a dedicated user. Replace the sample password with a long random one:
sudo mariadbCREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER zabbix@localhost IDENTIFIED BY 'ChangeThis-Long-Password';
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost;
SET GLOBAL log_bin_trust_function_creators = 1;
QUIT;Import the initial schema and data (this takes a minute), then switch the temporary option back off:
zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mariadb --default-character-set=utf8mb4 -uzabbix -p zabbix
sudo mariadb -e "SET GLOBAL log_bin_trust_function_creators = 0;"Finally, open /etc/zabbix/zabbix_server.conf and set DBPassword= to the same password.
How do I configure Nginx with HTTPS?
The Zabbix Nginx file is /etc/zabbix/nginx.conf on Ubuntu and Debian and /etc/nginx/conf.d/zabbix.conf on Rocky and Alma. Uncomment and set the two lines at the top:
listen 80;
server_name zabbix.example.net;Start everything. The PHP-FPM unit name differs: php8.3-fpm on Ubuntu 24.04, php8.1-fpm on 22.04, php8.2-fpm on Debian 12, php8.4-fpm on Debian 13 and php-fpm on Rocky and Alma.
sudo systemctl restart zabbix-server zabbix-agent2 nginx php8.3-fpm
sudo systemctl enable zabbix-server zabbix-agent2 nginx php8.3-fpm
zabbix_server -V | head -n 1With an A record for zabbix.example.net in place, open ports 80 and 443 and request a certificate with Certbot as shown in Certbot and Let's Encrypt:
sudo certbot --nginx -d zabbix.example.netOn Rocky and Alma, also allow the web server to talk to the database: sudo setsebool -P httpd_can_network_connect_db on.
How do I finish the web installer and secure the login?
Browse to https://zabbix.example.net. The installer checks PHP prerequisites, asks for the database password and a server name, then writes its config. Sign in with the default Admin / zabbix and change that password immediately under User settings, Profile. Then:
- create a personal admin user and disable the guest user under Users;
- turn on multi-factor authentication (TOTP) in Authentication settings;
- keep port 10051 closed except for the agent addresses that use active checks.
The local agent already reports the server itself as "Zabbix server" host; within a few minutes graphs appear under Monitoring, Hosts.
How do I add another server over the public internet?
There is no private network between our servers, so agent traffic crosses public IPs. Turn on PSK encryption on every agent. On the monitored server, add the same Zabbix repository, install zabbix-agent2 and create a key:
openssl rand -hex 32 | sudo tee /etc/zabbix/agent2.psk
sudo chown zabbix:zabbix /etc/zabbix/agent2.psk
sudo chmod 600 /etc/zabbix/agent2.pskEdit /etc/zabbix/zabbix_agent2.conf, using the monitoring server address 203.0.113.10:
Server=203.0.113.10
ServerActive=203.0.113.10
Hostname=web1
TLSConnect=psk
TLSAccept=psk
TLSPSKIdentity=web1-psk
TLSPSKFile=/etc/zabbix/agent2.psksudo systemctl restart zabbix-agent2
sudo ufw allow from 203.0.113.10 to any port 10050 proto tcpOn Rocky or Alma use a firewalld rich rule for the same source and port. In the frontend, create host web1 with interface 198.51.100.40, link the template "Linux by Zabbix agent", and on the Encryption tab select PSK for both directions with the same identity and key. The availability icon turns green once the first check succeeds.
How do I keep Zabbix healthy?
Housekeeping deletes old history automatically; adjust its periods under Administration, Housekeeping if the database grows faster than your disk. Back up the database with mariadb-dump --single-transaction zabbix and keep /etc/zabbix too. Minor updates arrive through apt upgrade or dnf upgrade; for a new major version, install the new release package and let the server upgrade the schema on start, after taking a backup.
- Server not running warning in the UI: check
sudo tail -n 50 /var/log/zabbix/zabbix_server.log, most often a wrongDBPassword. - Agent unavailable: test from the server with
zabbix_get -s 198.51.100.40 -k agent.ping --tls-connect psk --tls-psk-identity web1-psk --tls-psk-file key.psk. - Mail alerts not delivered: configure the Email media type with an authenticated relay on port 587; ask support by ticket before relying on port 25.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
Questions about Zabbix monitoring
How much RAM does a Zabbix server need?
For a small fleet, 4 GB is a comfortable start because MariaDB, PHP-FPM and the server share the machine. Grow by moving to a larger plan as your host count rises.
Can I use PostgreSQL instead of MariaDB?
Yes. Install zabbix-server-pgsql and the matching frontend package, and import the PostgreSQL schema from sql-scripts/postgresql.
Agent or agent 2?
Agent 2 is the newer Go based agent with plugins for Docker, databases and more. Both speak the same protocol; this guide uses agent 2.
Which ports matter?
TCP 10050 on agents for passive checks and TCP 10051 on the server for active checks. Open each only to the matching peer address.
Should I still look at the console graphs?
Yes, the Usage graphs tab shows provider side CPU, disk and transfer for each instance, which helps confirm what Zabbix reports.
More in Monitoring and logs
- Netdata real-time monitoring
- Uptime Kuma status page
- Prometheus and node_exporter
- Grafana dashboards
- Nagios Core
- Beszel lightweight monitoring
- Loki and Alloy for central logs
- Cacti graphs with SNMP
- Monit for self-healing services
- btop, htop and other live monitors
- Central logs with rsyslog
- Rotate logs with logrotate
- Read logs with journalctl
- Graylog log management
- Observium network monitoring
- Vector log and metrics pipeline