Zabbix Installation in Ubuntu 24.04

To install Zabbix on an Ubuntu 24.04 system, follow the steps below:

Zabbix Installation Steps

  1. Download Zabbix Release Package
    Use wget 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
  2. Install the Zabbix Release Package
    Install the downloaded package using dpkg:

    dpkg -i zabbix-release_6.0-6+ubuntu24.04_all.deb
  3. Update Package Lists
    Update the package lists for upgrades and new installations:

    apt update
  4. Upgrade Installed Packages
    Upgrade the existing packages:

    apt upgrade
  5. 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
  6. Upgrade Again
    Perform another upgrade to ensure everything is up to date:

    apt upgrade
  7. Install MySQL Server
    Install the MySQL server:

    apt install mysql-server
  8. Start and Enable MySQL Service
    Start the MySQL service and enable it to run at startup:

    systemctl start mysql.service
    systemctl enable mysql.service
  9. 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;
  10. 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
  11. Reconfigure MySQL Settings
    Log back into MySQL to reset the log_bin_trust_function_creators setting:

    mysql
    set global log_bin_trust_function_creators = 0;
    quit;
  12. 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
  13. 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;
  14. 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
  15. 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.