fbpx
How to Install Zabbix on Ubuntu

We will walk you through installing Zabbix on Ubuntu 22.04 in this detailed guide, giving you access to a potent tool for monitoring your IT infrastructure. Monitoring is crucial in the world of system administration. One of the most important aspects of maintaining a strong IT infrastructure is making sure your systems are operating smoothly and effectively. Zabbix is one tool that has grown in popularity in this area. It is free software that can be used to monitor a variety of IT components, including servers, networks, virtual machines, and cloud services.

Requirements:

Before we start, ensure that you have the following:

  1. A Virtono VPS running Ubuntu 22.04.
  2. Sudo or root access to the system.
  3. Basic knowledge of Linux commands and the terminal.

Let’s begin right away.

Part 1: Update Your System

First and foremost, you must make sure that your system is up to date. Open your terminal and enter the following commands to accomplish this:

sudo apt update && apt upgrade -y

This will upgrade any packages that have available updates and update the list of packages on your system.

Part 2: Install Apache and MySQL

Zabbix on Ubuntu relies on a web server and a database to function. In this guide, we will use Apache as our web server and MySQL as our database. To install these, type the following commands into your terminal:

sudo apt install apache2
sudo apt install mysql-server
How to Install Zabbix on Ubuntu

Part 3: Secure Your MySQL Installation

Security is a critical aspect of any system. To secure your MySQL installation, run the following command:

sudo mysql_secure_installation

Follow the prompts to set a root password and remove any insecure default settings.

Part 4: Install PHP

PHP is required to run Zabbix on Ubuntu. Run the following command to install PHP and a few required extensions:

sudo apt install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql
Install Zabbix on Ubuntu

Part 5: Install Zabbix on Ubuntu

Your system is now ready for Zabbix installation. We must first include the Zabbix repository in our system. Run the following command to accomplish this:

wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb

sudo dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb

sudo apt update
Install Zabbix on Ubuntu

Next, install Zabbix on Ubuntu by running:

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

Part 6: Set up Zabbix with MySQL

sudo mysql -u root -p
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;

Replace ‘password’ with a strong password of your choice. Next, import the Zabbix database schema into MySQL:

zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -p zabbix

Disable log_bin_trust_function_creators option after importing database schema.

mysql -uroot -p
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password

Part 7: Start and Enable Zabbix Services

Finally, start and enable the Zabbix server and agent by running:

sudo systemctl restart zabbix-server zabbix-agent apache2
sudo systemctl enable zabbix-server zabbix-agent apache2

Congratulations! You have successfully installed Zabbix on Ubuntu 22.04. You can now access the Zabbix web interface by navigating to http://your_server_ip/zabbix in your web browser. From there, you can start monitoring your IT components and ensure that your system is running smoothly and efficiently.

How to Install Zabbix on Ubuntu

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.