To install Zabbix on an Ubuntu 24.04 system, follow the steps below:
Zabbix Installation Steps
-
Download Zabbix Release Package
Usewget
to download the Zabbix release package:wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-6+ubuntu24.04_all.deb
-
Install the Zabbix Release Package
Install the downloaded package usingdpkg
:dpkg -i zabbix-release_6.0-6+ubuntu24.04_all.deb
-
Update Package Lists
Update the package lists for upgrades and new installations:apt update
-
Upgrade Installed Packages
Upgrade the existing packages:apt upgrade
-
Install Zabbix Components
Install the Zabbix server, frontend, Nginx configuration, SQL scripts, and agent:apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
-
Upgrade Again
Perform another upgrade to ensure everything is up to date:apt upgrade
-
Install MySQL Server
Install the MySQL server:apt install mysql-server
-
Start and Enable MySQL Service
Start the MySQL service and enable it to run at startup:systemctl start mysql.service systemctl enable mysql.service
-
Configure MySQL for Zabbix
Log into MySQL and create the Zabbix database and user:mysql create database zabbix character set utf8mb4 collate utf8mb4_bin; create user zabbix@localhost identified by 'password'; grant all privileges on zabbix.* to zabbix@localhost; set global log_bin_trust_function_creators = 1; quit;
-
Import Zabbix Database Schema
Import the initial schema and data into the Zabbix database:zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
-
Reconfigure MySQL Settings
Log back into MySQL to reset thelog_bin_trust_function_creators
setting:mysql set global log_bin_trust_function_creators = 0; quit;
-
Configure Zabbix Server
Edit the Zabbix server configuration file to set the database password:vim /etc/zabbix/zabbix_server.conf # Add the following line DBPassword=password
-
Configure Nginx for Zabbix
Edit the Nginx configuration file for Zabbix:vim /etc/zabbix/nginx.conf # Update the following lines listen 80; server_name example.com;
-
Set Up Nginx Sites
Navigate to the Nginx sites directory and create a symlink for the Zabbix configuration:cd /etc/nginx/sites-available/ cp /etc/zabbix/nginx.conf zabbix.mocolocal cd ../sites-enabled/ ln -s ../sites-available/zabbix.mocolocal
-
Restart Services
Restart the Zabbix server, agent, Nginx, and PHP-FPM services:systemctl restart zabbix-server zabbix-agent nginx php8.3-fpm
Disclaimer
This installation note is generated based on command history and may not cover all potential issues or configurations specific to your environment. Always refer to the official Zabbix documentation for detailed instructions and best practices.