What is Zabbix?
In an enterprise environment, you cannot afford to find out a server crashed because a user called the helpdesk. You need proactive monitoring. Zabbix is a highly scalable, open-source network monitoring solution. It collects metrics (CPU, RAM, disk space, network traffic) from thousands of servers, virtual machines, and network switches, displays them on beautiful customizable dashboards, and sends automated email or Slack alerts the moment a critical threshold is breached.
Step 1: Install the Zabbix Repository
The version of Zabbix in the default Debian repositories is usually significantly outdated. You must add the official Zabbix repository to your server.
Open your terminal and download the repository configuration package (replace the URL with the latest version from the Zabbix website):
wget https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb
Install the package and update your APT cache:
sudo dpkg -i zabbix-release_6.4-1+debian12_all.deb
sudo apt update
Step 2: Install the Server, Frontend, and Agent
Zabbix requires a database (MariaDB/MySQL) and a web server (Apache/Nginx). We will install the Zabbix server, the web frontend, and the Apache configuration files:
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y
Step 3: Create the Zabbix Database
Assuming you already have MariaDB installed (sudo apt install mariadb-server), log into the database root console:
sudo mysql -u root -p
Create a dedicated database and user for Zabbix:
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by 'YourStrongPassword';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;
Next, import the initial schema and data provided by the Zabbix package into your new database (you will be prompted for the password you just created):
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
Once imported, log back into MySQL and disable the trust function:
sudo mysql -u root -p -e "set global log_bin_trust_function_creators = 0;"
Step 4: Configure the Zabbix Server File
You must tell the Zabbix server daemon the password to connect to the database. Open the configuration file:
sudo nano /etc/zabbix/zabbix_server.conf
Locate the DBPassword= directive, uncomment it, and enter your password:
DBPassword=YourStrongPassword
Save and close the file.
Step 5: Start the Services and Access the Web UI
Start the Zabbix server and agent processes, and enable them to start automatically on boot:
sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2
Open your web browser and navigate to your server’s IP address followed by /zabbix (e.g., http://192.168.1.50/zabbix). You will be greeted by the graphical installation wizard. Follow the prompts to connect the frontend to the database. The default login credentials are Admin (case-sensitive) for the username and zabbix for the password. Welcome to your new enterprise monitoring dashboard!