Install Zabbix on Ubuntu/Debian Servers – Quick‑Start Guide
You’ll learn how to pull the right packages, set up the repo, install the server and agent, and get a working dashboard in under an hour. No fluff, just the steps that actually work.
Installing Prerequisites
Before we touch any Zabbix binaries, make sure your system is healthy:
sudo apt update && sudo apt upgrade -y sudo apt install curl gnupg2 lsb-release software-properties-common -y
The upgrade step keeps kernel modules and SSL libraries current – Zabbix relies on a recent TLS stack to talk securely to agents. Skipping it can lead to connection failures you’ll only notice when the agent finally pings back.
Adding the Zabbix Repository
Zabbix packages are bundled in their own repo so you always get the latest stable version without juggling multiple PPA sources:
echo "deb [arch=amd64] https://repo.zabbix.com/zabbix/6.0/debian $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/zabbix.list wget -qO - https://repo.zabbix.com/zabbix-official-repo.key | sudo apt-key add - sudo apt update
the key protects you from tampered packages. If you skip it, apt will refuse to install Zabbix and you’ll waste time chasing a broken signature error.
Installing the Server, Frontend, and Agent
Zabbix ships three separate components. On a typical monitoring host we only need the server (database + API) and the web UI:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent -y
If you’re running PostgreSQL or MariaDB, swap zabbix-server-mysql for the corresponding package. I’ve seen folks hit a snag when they mistakenly installed zabbix-server-pgsql on a MySQL‑only machine – the server just refuses to start.
Setting Up the Database
Assuming you’re using MySQL/MariaDB, create a dedicated user and database:
sudo mysql -u root -p <<EOF CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' IDENTIFIED BY 'StrongPassword123!'; FLUSH PRIVILEGES; EXIT; EOF
The utf8mb4 charset is crucial for storing emojis in item names; without it, the UI shows garbled characters. If you forget this step, Zabbix will complain about “invalid character set” when you import the schema.
Importing the Initial Schema
Zabbix ships an SQL file that creates tables and populates them with initial data. Load it into your database:
sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
This step is often overlooked, especially if you’re copying a server from another host. Without the schema, Zabbix won’t even start.
Configuring the Server
Edit /etc/zabbix/zabbix_server.conf to point to your database:
DBPassword=StrongPassword123!
Also set StartPollers, StartIPMIPollers, and similar parameters based on how many hosts you’ll monitor. The default values work for a handful of machines, but if you’re monitoring dozens of servers, bump them up or the UI will lag.
Configuring PHP for the Frontend
Open /etc/zabbix/apache.conf and adjust:
# If you're using Zabbix 6.0+ on Debian/Ubuntu 22.04: php_value date.timezone "America/New_York"
Without a proper timezone, timestamps in the dashboard will be off by hours, which can look like an actual problem when you chase down alerts.
Starting and Enabling Services
sudo systemctl restart zabbix-server zabbix-agent apache2 sudo systemctl enable zabbix-server zabbix-agent apache2
The enable commands make sure everything comes back up after a reboot – handy if you’re on a cloud instance that restarts for maintenance.
Quick Test – Logging In
Navigate to http://your‑server/zabbix. The default credentials are:
- User: Admin
- Password: zabbix
If you can’t log in, double‑check the MySQL password and ensure Apache is serving the /zabbix directory. A common hiccup I’ve seen is a stale DNS entry that points to an old IP; clearing /etc/hosts or flushing the resolver solves it.
Final Tweaks
1. Time Sync – Ensure NTP is running (sudo timedatectl set-ntp true). Zabbix relies on accurate timestamps for triggers.
2. Firewall – Open TCP ports 10050 (agent) and 10051 (server). If you’re using UFW:
sudo ufw allow 10050/tcp sudo ufw allow 10051/tcp
3. Monitoring Your Own Server – Add the host localhost in Zabbix, then configure a few items like CPU usage or disk space to confirm data is flowing.
That’s it. You’ve got a fresh Zabbix stack up and running on Ubuntu/Debian. Now you can add hosts, set triggers, and start seeing those pesky alerts pop up when something actually goes wrong.