But the installation process of Zabbix on Linux is quite long and confusing. This article will demonstrate how to easily install Zabbix and its prerequisites on a system running Ubuntu or Debian.

Prerequisites for Zabbix

To successfully install Zabbix on your desktop or server, you’ll need:

A root account MySQL database PHP Apache server

Step 1: Install Apache and PHP

Since Zabbix is written in PHP, you will have to download PHP and Apache server on your machine.

Add the following PPA repository to your system using add-apt-repository:

Launch the terminal and update your system’s repository list using APT:

Upgrade the installed packages to ensure that no outdated packages are present on your computer.

Next, download the necessary packages related to Apache and PHP:

After downloading the packages, the system will automatically configure the Apache service to start during boot. Check whether the service is currently running on your machine using systemctl:

If the status displays active (running), then everything’s fine. However if not, you’ll have to manually start the service.

Step 2: Install and Set Up MySQL Database

Issue the below-given command in the terminal to install MySQL.

Now, you have to install the database on your Ubuntu machine. To make your work easier, MySQL provides an installation script that automatically installs the database for you.

Launch the terminal and type:

Type the root user password and press Enter. The script will ask you some questions to configure the database installation such as:

Set root password? Remove anonymous users? Disallow root login remotely? Remove test database and access to it? Reload privilege tables now?

Type y and press Enter for all the questions.

Now it’s time to create a new database for Zabbix. Launch the terminal and enter the following command:

Execute the following database commands to create a new database and grant appropriate privileges to the new user. Make sure to replace password in the second command with a strong password of your choice.

Once done, quit the MySQL shell by typing:

Step 3: Download and Install Zabbix

To install Zabbix on Ubuntu and Debian, download the DEB package from the official Zabbix repository. Use wget to download the package file:

Install the downloaded package using APT.

Next, download the Zabbix server, agent packages, and the web frontend.

Now, create and load the Zabbix database schema.

Step 4: Configure the Zabbix Server

Although you have installed Zabbix on your system, it is not configured to use the database you created before.

Open the Zabbix configuration file located at /etc/zabbix using your favorite Linux text editor.

Now, locate the following lines in the configuration file and change the hostname, username, and password.

Make sure to replace password with a strong password of your choice.

Step 5: Configure the Apache Server

Before moving forward, you need to make some changes to the Zabbix Apache configuration file.

To do that, reload the Apache server using systemctl first.

Open the configuration file using nano or any other text editor.

Find the line php_value date.timezone <time_zone> and replace <time_zone> with the time zone corresponding to your geographical location.

Step 6: Finishing Configuration

Now that you have finished tweaking the files, it is time to start the services and set up Zabbix graphically.

Restart the Apache service using systemctl.

Start the Zabbix server and agent by typing the following command:

Enable the Zabbix services from the command line.

Verify if the Zabbix server is running on your system using the systemctl status command.

Proceed if the status displays active in green font.

Step 7: Tweaking the Firewall With UFW

To ensure that Zabbix works properly on your system, you’ll have to open ports 80 and 443 on your network. On Linux, UFW is a great utility that will help you in configuring firewalls and managing ports.

Open ports 80 and 443 by typing the following command:

Reload your firewall to save the changes.

Step 8: Configure Zabbix Frontend

Launch any web browser on your Linux system and head over to the following address:

If you’ve installed Zabbix on a Linux server, replace localhost with the IP address of the server. The browser will display the Zabbix Welcome page. Click on the Next Step button to continue.

Now, Zabbix will check the prerequisites required for the application. If you find a missing package, go ahead and install it using the terminal. Once done, click Next Step.

Enter the database password entered in the configuration file before. Then select Next Step.

The system will ask you for information related to the server. Enter an appropriate server name and proceed by clicking on Next Step.

Zabbix will quickly summarize all the configurations and settings that you’ve done. Review these settings and click on Next Step if everything looks good.

The installation process will now begin. Select Finish once Zabbix has finished installing.

The system will redirect you to the login page. Enter Admin and zabbix as the username and password respectively. You can change the password later by heading over to Administrator > Users.

Now You Can Monitor Your Network Easily

Zabbix is a great way to control and monitor devices on your network. It consists of several tools that a user may need to keep an eye on cloud services, virtual machines, servers, and other devices on their network.

You can also set up a portable network monitor using a Raspberry Pi and Nagios Enterprise Monitoring Server (NEMS). Making use of a Raspberry Pi as a network monitoring device is much better than dedicating a complete desktop to the task.