Install the Latest Zabbix on Ubuntu 24.04 Noble Numbat: Ultimate Guide

Posted on

Install the Latest Zabbix on Ubuntu 24.04 Noble Numbat: Ultimate Guide

Install the Latest Zabbix on Ubuntu 24.04 Noble Numbat: Ultimate Guide

This comprehensive guide will walk you through the process of installing the latest Zabbix version on Ubuntu 24.04 Noble Numbat. Zabbix is a powerful open-source monitoring solution, ideal for keeping tabs on servers, virtual machines, cloud services, and network devices. The latest version, Zabbix 7.2, brings significant enhancements and features to the table. This guide provides a step-by-step approach to get it up and running on your Ubuntu 24.04 system.

This guide focuses on installing the Latest Zabbix on Ubuntu 24.04 with a LAMP (Linux, Apache, MySQL/MariaDB, PHP) stack. Before you begin, ensure you have the following:

  • A running Ubuntu 24.04 server.
  • Root or sudo privileges.
  • A stable internet connection.
  • A basic understanding of Linux command-line operations.

Once you have these prerequisites covered, proceed with the following steps to install the Latest Zabbix on Ubuntu 24.04.

For those who prefer visual learning, a video tutorial is available here:

Step 1. Configure PHP For Zabbix on Ubuntu 24.04

Zabbix relies on PHP for its web interface. Therefore, you need to install specific PHP extensions. Use the following command to install the necessary extensions:

sudo apt install php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql -y

Next, modify the PHP INI file to adjust some settings. Open the file using your preferred text editor (Vi, Nano, etc.).

Tips: If you’re unsure where your PHP INI file is located, refer to a guide on finding the php.ini file location on Linux.

sudo vi /etc/php/8.3/apache2/php.ini

Locate the following lines and modify their values as shown:

memory_limit = 256M
upload_max_filesize = 16M
post_max_size = 16M
max_execution_time = 300
max_input_time = 300

Then, find the following lines, uncomment them (remove the ";"), and set the values as indicated:

max_input_vars 10000
date.timezone = ETC/UTC

Remember to replace "ETC/UTC" with your appropriate timezone.

Save the changes and close the file.

Note: Ensure you use the correct timezone for your location.

Apply the changes by restarting the Apache service:

sudo systemctl restart apache2

Step 2. Create Zabbix User Database on Ubuntu 24.04

To install the Latest Zabbix on Ubuntu 24.04, you will need a dedicated database and user. Log in to your MariaDB shell as the root user:

sudo mysql -u root -p

Execute the following commands within the MariaDB shell to create the database, user, grant privileges, enable the log_bin_trust_function_creators option, and flush privileges:

-- MariaDB [(none)]>
CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
-- MariaDB [(none)]>
CREATE USER 'zabbixuser'@'localhost' IDENTIFIED BY 'password';
-- MariaDB [(none)]>
GRANT ALL PRIVILEGES ON zabbixdb.* TO 'zabbixuser'@'localhost' WITH GRANT OPTION;
-- MariaDB [(none)]>
set global log_bin_trust_function_creators = 1;
-- MariaDB [(none)]>
FLUSH PRIVILEGES;

Remember to replace zabbixdb, zabbixuser, and password with your desired database name, username, and password, respectively.

Exit the MariaDB shell:

-- MariaDB [(none)]>
EXIT;

Step 3. Download and Install Zabbix 7.2 on Ubuntu 24.04

As of this writing, Zabbix 7.2 is the latest stable version. Always check the official website for the most up-to-date releases. Use the wget command to download the Zabbix package:

sudo wget https://repo.zabbix.com/zabbix/7.2/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.2+ubuntu24.04_all.deb

Install the Zabbix repository and update the system package list:

sudo dpkg -i zabbix-release_latest_7.2+ubuntu24.04_all.deb
sudo apt update

Now, install the Zabbix server, frontend, Apache configuration, SQL scripts, and agent:

sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent -y

Start and Enable Zabbix Server on Ubuntu

Start and enable the Zabbix server to ensure it runs automatically on boot:

sudo systemctl start zabbix-server
sudo systemctl enable zabbix-server

Verify that the Zabbix server is active and running:

sudo systemctl status zabbix-server

You should see output similar to the following:

Install the Latest Zabbix on Ubuntu 24.04

Import Zabbix Database Schema

Import the Zabbix database schema:

zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbixuser -p zabbixdb

Enter the password for your database user when prompted.

After importing the database, disable the log_bin_trust_function_creators option. Log in to the MariaDB console:

sudo mysql -u root -p

Then, execute the following commands:

-- MariaDB [(none)]>
set global log_bin_trust_function_creators = 0;
-- MariaDB [(none)]>
EXIT;

Step 4. Configure Zabbix Server on Ubuntu 24.04

Edit the Zabbix server configuration file to define the database settings:

sudo vi /etc/zabbix/zabbix_server.conf

Find the following lines, uncomment them, and enter your database credentials:

DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DBPassword=password

Replace zabbixdb, zabbixuser, and password with your actual database name, username, and password.

Save the file and restart the Zabbix server and Apache:

sudo systemctl restart zabbix-server
sudo systemctl restart apache2

Step 5. Configure Zabbix Agent on Ubuntu 24.04

Edit the Zabbix agent configuration file:

sudo vi /etc/zabbix/zabbix_agentd.conf

Locate the following lines and set the values as shown:

Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix Server

Save and close the file.

Start and Enable Zabbix Agent on Ubuntu

Start and enable the Zabbix agent:

sudo systemctl start zabbix-agent
sudo systemctl enable zabbix-agent

Verify that the Zabbix agent is running:

sudo systemctl status zabbix-agent

You should see output similar to the following:

Start and Enable Zabbix Agent on Ubuntu 24.04

Step 6. Access Zabbix Dashboard Login

Now that you’ve installed the Latest Zabbix on Ubuntu 24.04 and configured it, access the web interface using the following URL, replacing your-server-ip with your server’s IP address:

http://your-server-ip/zabbix

You’ll be greeted with the Zabbix welcome screen. Choose your preferred language and click "Next step."

Welcome to Zabbix 7.2 on Ubuntu 24.04

Check the requirements. If everything is "OK," click "Next step."

Check for Zabbix requirements setup on Ubuntu 24.04

Configure the database connection using your Zabbix database credentials and click "Next step."

Configure Zabbix DB Connection on Ubuntu 24.04

Choose a name for your server and select your desired theme. Click "Next step."

Configure Zabbix settings on Ubuntu 24.04

Review the pre-installation summary and click "Next step."

Zabbix preinstallation summary Ubuntu 24.04

Upon completion, you’ll see a congratulatory message. Click "Finish."

Successfully Installed Zabbix on Ubuntu 24.04

You’ll now see the Zabbix login screen. Use the following default credentials:

username: Admin
password: zabbix
Zabbix 7.2 Login Screen Ubuntu 24.04
Install the Latest Zabbix on Ubuntu 24.04 – Zabbix Login

You’ll gain access to the Zabbix dashboard.

Zabbix monitoring dashboard Ubuntu 24.04
Install the Latest Zabbix on Ubuntu 24.04 – Zabbix Dashboard

Note: It’s highly recommended to change the default "Admin" user password immediately for security reasons. Navigate to the Users tab, select "Admin," and change the password.

Congratulations! You have successfully installed the Latest Zabbix on Ubuntu 24.04.

Conclusion

This guide demonstrated how to install the Latest Zabbix on Ubuntu 24.04, Zabbix 7.2. By following these steps, you can set up a LAMP stack, download and install the necessary Zabbix packages, configure the server and agent, and access the Zabbix dashboard.

Alternative Solutions for Installing Zabbix on Ubuntu 24.04

While the LAMP stack installation is a traditional and well-understood approach, here are two alternative methods for installing Zabbix on Ubuntu 24.04:

1. Using Docker Compose:

Docker Compose offers a containerized approach, simplifying the deployment and management of Zabbix and its dependencies. This method eliminates the need for manual configuration of the LAMP stack.

  • Explanation: Docker Compose uses a YAML file to define the services, networks, and volumes required for the Zabbix installation. Each component (Zabbix server, database, frontend) runs in its own container, isolated from the host system. This ensures consistency and portability.

  • Steps:

    1. Install Docker and Docker Compose:

      sudo apt update
      sudo apt install docker.io docker-compose-plugin -y
    2. Create a docker-compose.yml file:

      Create a directory for your Zabbix installation and create a docker-compose.yml file within it. The contents of this file will vary based on your specific needs, but a basic example is shown below. You may need to adjust versions and environment variables. A more complete example is beyond the scope of this guide.

      version: "3.8"
      services:
        db:
          image: mariadb:10.11
          restart: always
          environment:
            MYSQL_ROOT_PASSWORD: your_db_root_password
            MYSQL_USER: zabbix
            MYSQL_PASSWORD: your_zabbix_db_password
            MYSQL_DATABASE: zabbix
          volumes:
            - db_data:/var/lib/mysql
      
        zabbix-server:
          image: zabbix/zabbix-server-mysql:ubuntu-7.2-latest
          restart: always
          ports:
            - "10051:10051"
          environment:
            DB_SERVER_HOST: db
            MYSQL_USER: zabbix
            MYSQL_PASSWORD: your_zabbix_db_password
            MYSQL_DATABASE: zabbix
            ZBX_SERVERNAME: Zabbix Server
          depends_on:
            - db
      
        zabbix-web-apache:
          image: zabbix/zabbix-web-apache-mysql:ubuntu-7.2-latest
          restart: always
          ports:
            - "8080:8080"
            - "8443:8443"
          environment:
            DB_SERVER_HOST: db
            MYSQL_USER: zabbix
            MYSQL_PASSWORD: your_zabbix_db_password
            MYSQL_DATABASE: zabbix
            PHP_TZ: ETC/UTC
          depends_on:
            - zabbix-server
      
      volumes:
        db_data:
    3. Start the Zabbix stack:

      Navigate to the directory containing the docker-compose.yml file and run:

      docker compose up -d
    4. Access the Zabbix frontend:

      Open your web browser and navigate to http://your-server-ip:8080.

  • Advantages: Simplified installation, isolated environment, easy to scale.

  • Disadvantages: Requires familiarity with Docker and containerization concepts.

2. Using Pre-built Virtual Appliance (OVA):

Zabbix provides pre-built virtual appliance images (OVA files) that can be imported into virtualization platforms like VirtualBox or VMware. This method offers the quickest way to deploy a fully functional Zabbix server.

  • Explanation: The OVA image contains a pre-configured operating system with Zabbix server, database, and frontend already installed and configured. You simply import the image into your virtualization software and start the virtual machine.

  • Steps:

    1. Download the OVA image:

      Download the appropriate OVA image for your virtualization platform from the Zabbix website: https://www.zabbix.com/download. Choose the "Virtual Appliances" tab.

    2. Import the OVA image:

      Import the downloaded OVA file into your virtualization software (VirtualBox, VMware, etc.).

    3. Configure the virtual machine:

      Adjust the virtual machine’s resources (RAM, CPU) as needed.

    4. Start the virtual machine:

      Start the virtual machine.

    5. Access the Zabbix frontend:

      Determine the IP address of the virtual machine and open your web browser to http://virtual-machine-ip/zabbix.

  • Advantages: Fastest deployment, minimal configuration required.

  • Disadvantages: Less flexibility, requires a virtualization platform.

These alternative solutions provide faster or more streamlined approaches to getting Zabbix up and running on Ubuntu 24.04 compared to the traditional LAMP stack method. The best choice depends on your specific requirements and technical expertise.

Leave a Reply

Your email address will not be published. Required fields are marked *