Quick and Easy Zabbix Installation on Ubuntu 24.04
In this guide, we’ll walk through installing and configuring Zabbix on Ubuntu 24.04. Zabbix is a popular open-source monitoring tool that helps administrators monitor network performance, server health, and applications in real-time. The Zabbix installation on Ubuntu 24.o4 LTS operating system will be consist of several steps :
1. Update System Packages
2. Install and Configure the Zabbix Repository
3. Install Zabbix Server, Frontend, and Agent
4. Configure the Zabbix Database
5. Import Zabbix Data to the Database
6. Configure Zabbix Server
7. Configure PHP for Zabbix Frontend
8. Start and Enable Zabbix Services
9. Configure the Firewall
10. Access the Zabbix Web Interface
Zabbix is an open-source monitoring platform designed to track the health, performance, and availability of IT infrastructure, including servers, networks, and applications. Widely used in IT environments of all sizes, Zabbix helps system administrators keep an eye on system metrics in real-time, making it easier to identify issues before they impact users.
Prerequisites
Before starting, make sure you have the following:
- A server running Ubuntu 24.04
- A user with sudo privileges
- Basic knowledge of the command line
Let’s get started!
Step 1: Update System Packages
Start by updating the system packages to ensure you’re using the latest versions:
$ sudo apt update $ sudo apt upgrade -y
Step 2: Install and Configure the Zabbix Repository
Zabbix provides an official repository that simplifies the installation process. First, download the Zabbix repository configuration package:
$ wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu24.04_all.deb $ sudo dpkg -i zabbix-release_6.0-1+ubuntu24.04_all.deb $ sudo apt update
Step 3: Install Zabbix Server, Frontend, and Agent
Now, install Zabbix along with its frontend and agent by running:
$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent -y
Step 4: Configure the Zabbix Database
Zabbix requires a database to store monitoring data. First, install the MariaDB server if it’s not already installed:
$ sudo apt install mariadb-server -y
Once installed, secure the database by running:
$ sudo mysql_secure_installation
After setting up MariaDB, create a database and user for Zabbix:
$ sudo mysql -uroot -p
CREATE DATABASE zabbix CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost'; FLUSH PRIVILEGES; EXIT;
Step 5: Import Zabbix Data to the Database
Import the initial schema and data into the Zabbix database:
$ zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Step 6: Configure Zabbix Server
Now, configure Zabbix to connect to the database by editing the Zabbix server configuration file:
$ sudo nano /etc/zabbix/zabbix_server.conf
Find the following lines and set the database name, user, and password:
DBName=zabbix DBUser=zabbix DBPassword=your_password
Save and close the file.
Step 7: Configure PHP for Zabbix Frontend
Edit the PHP configuration file to meet Zabbix’s requirements:
$ sudo nano /etc/zabbix/apache.conf
Set the following values:
php_value date.timezone 'Your/Timezone'
eplace 'Your/Timezone'
with your timezone (e.g., America/New_York
). Save and close the file.
Step 8: Start and Enable Zabbix Services
Start and enable Zabbix and Apache services:
$ sudo systemctl restart zabbix-server zabbix-agent apache2 $ sudo systemctl enable zabbix-server zabbix-agent apache2
Step 9: Configure the Firewall
Allow HTTP traffic for the Zabbix frontend:
$ sudo ufw allow 80/tcp $ sudo ufw reload
Step 10: Access the Zabbix Web Interface
Open a web browser and go to:
http://your_server_ip/zabbix
Complete the setup by following the web-based installation wizard. Log in using the default credentials (Admin
/ zabbix
) and configure settings as needed.
Conclusion
You have successfully installed and configured Zabbix on Ubuntu 24.04! Now, you can start monitoring your network, servers, and applications in real time. Zabbix’s detailed dashboards and robust alerting capabilities make it a powerful tool for proactive IT management.