How to Install Zabbix on Ubuntu Server Latest

In this tutorial, we will guide you through the installation process of Zabbix, a powerful open-source monitoring tool, on the latest version of Ubuntu Server.

Prerequisites

Before installing Zabbix, ensure that your Ubuntu Server is up-to-date and has access to the internet. You also need to have administrative privileges and an SSH client such as PuTTY installed on your local machine.

Step 1: Install Apache, MySQL, and PHP

Zabbix requires a web server, a database server, and PHP to be installed on the Ubuntu Server. To install these software packages, run the following command:

sudo apt update && sudo apt upgrade
sudo apt install apache2 mysql-server php libapache2-mod-php php-mysql php-gd php-xml php-bcmath php-mbstring

During the installation process, you will be prompted to set the MySQL root password. Make sure to remember this password as you will need it later.

Step 2: Create Zabbix Database

Once Apache, MySQL, and PHP are installed, you need to create a new database for Zabbix. To do this, log in to MySQL as the root user:

sudo mysql -u root -p

Enter the MySQL root password, and then create a new database called 'zabbix':

CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

Next, create a new MySQL user with full permissions to the 'zabbix' database:

GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbixuser'@'localhost' IDENTIFIED BY 'password';

Make sure to replace 'password' with a strong password of your choosing.

Exit out of the MySQL prompt by running:

exit

Step 3: Download and Install Zabbix

Next, download and install the Zabbix package from the official website:

wget https://repo.zabbix.com/zabbix/5.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.2-1+focal_all.deb
sudo dpkg -i zabbix-release_5.2-1+focal_all.deb

Refresh the package information and install Zabbix server, agent, and frontend:

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

During the installation process, you will be asked to configure the Zabbix server database settings. Use the following values:

Step 4: Configure Zabbix

After the installation is complete, you need to configure Zabbix by editing the configuration files. First, modify the PHP timezone in the 'php.ini' file:

sudo nano /etc/php/7.4/apache2/php.ini

Search for the line that contains 'date.timezone =' and replace it with the timezone of your system. For example, if you are in New York and using Eastern Time, set it to:

date.timezone = America/New_York

Save and exit the file by pressing 'CTRL+X' followed by 'Y' and 'Enter'.

Next, edit the Zabbix server configuration file:

sudo nano /etc/zabbix/zabbix_server.conf

Uncomment and edit the following lines to match your setup:

DBHost=localhost
DBName=zabbix
DBUser=zabbixuser
DBPassword=[the password you created in Step 2]

Save and exit the file.

Restart the Apache and Zabbix services:

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

Step 5: Access Zabbix Web Interface

You can now access the Zabbix web interface by navigating to http://[your-server-ip-address]/zabbix. The default login credentials are:

Once you login, you will be prompted to change the default password.

Congratulations, you have successfully installed and configured Zabbix on your Ubuntu Server! You can now start monitoring your systems' performance and collecting data for analysis.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!