Zabbix is one of the most powerful open source monitoring platforms available — used by organizations of all sizes to keep infrastructure healthy. In this guide we'll install Zabbix 6.4 LTS on a fresh Ubuntu 22.04 server, connect it to a database, and get your first host monitored.
Prerequisites
- Ubuntu 22.04 server with at least 2 GB RAM and 2 CPUs
- A non-root user with
sudoprivileges - Basic familiarity with the Linux command line
Step 1: Add the Zabbix Repository
Zabbix is not available in the default Ubuntu repos, so we add the official Zabbix repository:
wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
sudo apt update
Step 2: Install Zabbix Components
Install the server, frontend, Apache config, SQL scripts, and the local Zabbix agent:
sudo apt install -y zabbix-server-mysql zabbix-frontend-php \
zabbix-apache-conf zabbix-sql-scripts zabbix-agent
Step 3: Set Up the Database
Install MariaDB and create the Zabbix database and user:
sudo apt install -y mariadb-server
sudo mysql_secure_installation
Then log into MySQL and create the database:
sudo mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER zabbix@localhost IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost;
SET GLOBAL log_bin_trust_function_creators = 1;
QUIT;
Import the initial schema (this takes a minute):
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | \
mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Then disable the function creator setting:
sudo mysql -uroot -p
SET GLOBAL log_bin_trust_function_creators = 0;
QUIT;
Step 4: Configure the Zabbix Server
Edit the server config to set your database password:
sudo nano /etc/zabbix/zabbix_server.conf
Find the DBPassword line and set it:
DBPassword=StrongPassword123!
Step 5: Start and Enable Services
sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2
Step 6: Complete the Web Setup
Open a browser and navigate to http://your-server-ip/zabbix. The setup wizard will walk you through:
- Checking PHP prerequisites
- Connecting to the database
- Confirming the server host and port
- Choosing your timezone and default theme
The default login is Admin / zabbix — change the password immediately after your first login.
What's Next?
Once inside the Zabbix dashboard, try these next steps:
- Add your first host — Configuration → Hosts → Create host. Assign the built-in Linux by Zabbix agent template to start collecting CPU, memory, and disk metrics instantly.
- Set up email alerts — Administration → Media types → Email. Configure an SMTP relay and add your address to your user profile under Notifications.
- Explore templates — Zabbix ships with pre-built templates for Nginx, MySQL, Docker, network switches (SNMP), and more. Check Configuration → Templates.
Zabbix is a deep platform — the official Zabbix documentation covers advanced topics like auto-discovery, triggers, and the Zabbix API.