How to Install Zabbix for Server Infrastructure Monitoring?

Zabbix Logo
As you go through the product development phase and run your operations and workflows, the need for constantly monitoring your server infrastructures is inevitable. You want to make sure of the smooth performance of the servers with efficient workflows, so that you may lead the path to the development of a stellar product.

As you sift through the solutions to meet these monitoring requirements, what you basically are looking for, is an efficient and robust monitoring tool or software that could meet your business requirements every step of the way. Zabbix is one of the many tools that promises an effective solution.

Zabbix came into the picture in 1998, only to be publicly launched in 2001 as a network management system with robust capabilities and functionalities to monitor your workflows as well as the performance and status of your server infrastructures and other network services. The tool comes in handy to monitor standard services and other statistics such as CPU load, network utilization, disk space, etc., and you can get real-time notifications for all the tracking. This kind of real-time monitoring is extremely helpful in ceaselessly managing the workflows for their most efficient performance while taking care of any issues as soon as they arise.

So, now that you know the monitoring capabilities you can have with Zabbix, you shall quickly want to install it into your systems and leverage it to the maximum business advantage. But how do you go through with the installation?

Here in this article, we are going to talk on how to install Zabbix in your systems. So, let’s get started!

How to Install and Configure Zabbix?

Zabbix basically has three major components, viz., Zabbix Server, Zabbix Agent, and Zabbix Web Interface. Out of these components, you need to install the Zabbix Server and Zabbix Agent into your system and you can skip the web interface part. The monitoring of your Zabbix Agents through the Zabbix Server will still be the same. However, using the web interface still enhances the monitoring experiences by a certain degree.

Installing Zabbix Server

The process for the installation of Zabbix server can differ with your operating systems. In this case, we are detailing the steps for the installation of Zabbix server on Ubuntu.

Step 1: Create a LAMP Environment

Here’s how we can break down the LAMP environment: ‘L’, stands for Linux, is the operating system, ‘A’ stands for Apache is the web server, ‘M’ denotes MySQL and is the database server, and finally, ‘P’ denotes PHP programming language.

A LAMP environment is essential for the installation of Zabbix Server. So, if you already have one, that’s great! In case you don’t, then you can quickly create one. All you have to do is install Apache, MYSQL, and PHP.

Now, all you have to do is install Apache, MYSQL, and PHP by using the following commands:

$ sudo apt-get update
$ sudo apt-get install apache2 libapache2-mod-php
$ sudo apt-get install mysql-server
$ sudo apt-get install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql
You also need to update the time zones in the PHP configuration files. The following command can be used for that.
date.timezone = ‘Asia/Kolkata’

Step 2: Configure Zabbix Package Repository

Before you install Zabbix, it is good to have the Zabbix package repository configured and enabled in your system. Run the following commands to carry out the configuration. Check your operating system before running the commands and then choose the commands depending on the operating system version you are using.

## Ubuntu 18.04 LTS (Bionic):
$ wget
$ sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb

## Ubuntu 16.04 LTS (Xenial):
$ wget
$ sudo dpkg -i zabbix-release_4.0-3+xenial_all.deb

Step 3: Install Zabbix Server

Once you have enabled the repository, you simply have to run the following command for installing the Zabbix Server in your system.

$ sudo apt-get update
$ sudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
After you run this command, Zabbix Server will get installed in your system along with MYSQL support.

Step 4: Create Database Schema

Once you have installed the Zabbix Server, you need to create a database schema and a user for your server. You can create this schema by logging in to your MySQL account and running the following queries.

$ mysql -u root -p
mysql> CREATE DATABASE zabbixdb character set utf8 collate utf8_bin;
mysql> CREATE USER ‘zabbix’@’localhost’ IDENTIFIED BY ‘password’;
mysql> GRANT ALL PRIVILEGES ON zabbixdb.* TO ‘zabbix’@’localhost’ WITH GRANT OPTION;

After you have created the user, load the database schemas to the Zabbix server using the following commands:

$ cd /usr/share/doc/zabbix-server-mysql
$ zcat create.sql.gz | mysql -u zabbix -p zabbixdb

Step 5: Edit Zabbix Configuration File

Now is the time you start configuring Zabbix in your system. The configuration process starts with editing the configuration file. It goes as follows:


Open this file in your text editor and then use the below settings for configuring the database:


The Zabbix Server uses these configurations to connect to the database.

Step 6: Restart Apache and Zabbix

You also have to configure Apache with Zabbix, and all you need to do for that is restart Apache. Zabbix creates its own configuration file for Apache along with a link in the Apache configuration directory. Simply run the below command and restart Apache:
sudo service apache2 restart
Subsequently, restart Zabbix with the below command.
sudo service zabbix-server restart
This will start your Zabbix service and now all you have to do is go to the web installer wizard to finish up with the installation of Zabbix server.

Step 7: Finishing the Installation

Zabbix has a web installer wizard and you only need to complete this to finish the installation. You can access this installer on /zabbix subdirectory URL on your server’s IP or domain.

The wizard will open with a Zabbix Welcome Screen. Now all you have to do is look through the wizard, make sure everything is okay, fill up the forms in the wizard and keep clicking through the next button in the wizard until you reach the end.

Read More:
Enhance Performance With Zabbix Solution
How to Simplify Application Monitoring and Ensure App Performance With Zabbix

In the end, you will see the finish button. As you click the Finish button, you shall see a login page. You can enter the login details and you will have your Zabbix dashboard appear on your screen.

You are hereby done with the installation of the Zabbix Server in your system. Next, we will guide you on how install the Zabbix Agent.

Installing Zabbix Agent

Zabbix Agent is what will collect all the information from your servers for tracking. So, you need to install it on all your remote systems that you need to track with the Zabbix Server.

Step 1: Enable Apt Repository

Just like you had configured the repository during the installation of the Zabbix Server, you need to go through a similar process for installing the Zabbix Agent. These repositories are available on the official website of Zabbix. You need to run the following commands to add these repositories to your system for the installation of the Zabbix agent:

For Ubuntu 18.04 (Bionic):

$ wget
$ sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb
For Ubuntu 16.04 (Xenial):

$ wget
$ sudo dpkg -i zabbix-release_4.0-3+xenial_all.deb

Step 2: Install Zabbix Agent

Once the repositories are enabled and configured, simply run the below command for the installation of Zabbix agent in your systems.

$ sudo apt-get update
$ sudo apt-get install zabbix-agent

Step 3: Configure Zabbix Agent

The Zabbix Agent is installed in your system and now is the time to configure it. You basically have to edit the Zabbix Configuration file which goes by the name /etc/zabbix/zabbix_agentd.conf.

Additionally, you need to update the server IP for Zabbix as follows.

#Server=[zabbix server ip]
#Hostname=[Hostname of client system ]
This server IP will help to connect with the Zabbix client.

Step 4: Restart Zabbix

Once everything is configured, run the below commands to restart Zabbix.
$ sudo systemctl enable zabbix-agent
$ sudo systemctl start zabbix-agent
And you’re done! Zabbix Agent is installed in your system.
Once you have the Zabbix Server and Zabbix Agent installed in your system, all you have to do is add a host to your Zabbix Agent which you need to monitor.

If you don’t know how to add a host, continue reading the next step.

Step 5: Adding a New Host

In order to monitor every host, each of the host has to be registered on the server of Zabbix. Follow the following steps to do so:

1. Sign in to the web interface of your Zabbix Server using the following link:


2. After logging in, click on ‘Configurations’ and then click on ‘Hosts’ (available in the navigation bar on the top)

3. Click on ‘Create Host’ on the top right corner of your screen. The host configuration page will now open

4. You may now adjust the name and IP Address of the Host according to the name and IP address of your client machine’s host.

5. Next, you can add the host to a group by either selecting from the available group names in the list or by creating a new group. Adding the hosts in more than one groups is also allowed.

6. After adding hosts to groups, you have to click on the ‘Templates’ tab

7. All you need to do is type “Template OS Linux” in the Search field. Click ‘Add’ once you have done so.

8. Go to Encryption tab. Choose ‘PSK’ for Connections to host as well as Connections from host.

9. Next, you need to set PSK identity to ‘PSK 001’, as it is the value of the the Zabbix agent’s TLSPSKIdentity configured earlier. Now, you can set the PSK value as per the key generated by you for the Zabbix agent.

9. You can find it stored on the agent machine in the following file location:


10. At last, click on the ‘Add’ button to, finally, create the host. The new host will be now visible with green labels. The green labels indicate that everything you have set up till now is working fine and the connection on the server is encrypted.

So, that is how you install a new host on the server, and this brings us to the end of the tutorial.


Zabbix is an amazing tool for you to keep up with your systems, infrastructures, and workflows as it allows constant and ceaseless monitoring. It’s an easy way to keep up with stellar performances while instantly fixing any issues arising any step of the way. All you need to do for using this powerful monitoring tool is run a few lines of commands and you are all set to achieve stellar workflow efficiencies that cater to better product development and subsequently scalable business performance that leads to growth and success.

Zabbix is a powerful open-source infrastructure monitoring tool that is trusted by thousands of organizations for monitoring servers, software, applications, and resources. Zehntech offers end-to-end Zabbix services and can help you with Zabbix setup, intsallation, integration, maintenance, deployment, or configuration. Learn more about our services here.

Related post

Zabbix 6.2

Zabbix 6.2 – More Powerful, Featureful, & Secure

The focus of infrastructure monitoring software company Zabbix has always been on innovation. Over the past 6 versions, the software company has made some necessary big and minor changes in its front end and back end to enhance usability and overall user experience.  

Read More »