Register Now


Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Zabbix Installation on Ubuntu Server

Zabbix Installation on Ubuntu Server

In this blog, we will install Zabbix on Ubuntu Server.

Last updated on 19/11/2020

Make sure you have an Internet connection on your Ubuntu Server and it is up-to-date as well. Run the following commands to update/upgrade the list of available packages.

sudo apt update && sudo apt upgrade

1. Select Zabbix Version

Head down to and select the Zabbix Version, OS Distribution, OS Version, Database and Web Server. I will be using the following:

5.0 LTSUbuntu20.04 (Focal)MySQLApache

Perform the first step and Install the Zabbix repository. In my case, it is Zabbix 5.0 and it could be different when you are following this blog.


Once the repository is download, run the following command to install it.

dpkg -i zabbix-release_5.0-1+focal_all.deb

This is important, otherwise, you will run into problems. Update/Upgrade the installed packages with the following command.

sudo apt update && sudo apt upgrade

2. Install Zabbix Server, frontend, agent, and database

Now we will install Zabbix server, frontend, agent, and database. I have added additional bit mysql-server to the official Zabbix command because without that I could not run mysql_secure_installation command.

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

3. Check Versions

Check all the software versions you have installed. Here you can check the supported versions

MySQL server version

sudo mysql -V

Apache version

sudo apache2 -V

PHP Version

sudo php --version

4. Configure MySQL Server

This is again missing in the official documentation, let’s secure our MySQL server and give a password to the root user:

sudo mysql_secure_installation
  • yes or no, if you would like to install Validate Password Plugin (I said no for this in my lab environment)
  • The next part offers you to change the password for the root of MYSQL
  • The next option to remove anonymous users, I will say Yes 
  • The next option to stop root login remotely, I would go for no 
  • Reload privileges table: Yes 
  • You will see, “All done”, once it is all done 

5. Create an initial database and a user


1. Let’s login to MySQL server and provide the MySQL root password which you entered in the previous step.

sudo mysql -u root -p

2. Create a database and name it zabbix.

create database zabbix character set utf8 collate utf8_bin;

3. Create a new user and name it zabbix. Also, pick a password for this user. We will need this password later on for Zabbix server config file.

create user zabbix@localhost identified by 'password';

4. Now grant permissions on zabbix database to user zabbix.

grant all privileges on zabbix.* to zabbix@localhost;

5. Once done, flush the privileges.

flush privileges;

6. Confirm privileges for user zabbix on database zabbix.

show GRANTS FOR 'zabbix'@'localhost';

7. Let’s get out of MySQL



6. Import initial schema and data.

In the previous step, we created a new database and user. Now we will utilize that database and import initial schema and data to that database. Run the following command and provide the password for the database user zabbix. Be patient with this command and it could take 5 to 30 seconds or more to finish.

sudo zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbix -p zabbix

Verify the schema is imported successfully to database zabbix.

  • In order to do that, we have to log in to MySQL server with MySQL user root and provide the password when prompted
sudo mysql -u root -p


  • Use database zabbix, where we imported initial schema and data
use zabbix;
  • So we are now in database zabbix. Let’s see the tables
show tables;
  • You should see the tables on the screen. Let’s get out of MySQL server


7. Update Zabbix Server Config file

Well! this file has a lot of stuff. We will update only one thing, however, this is the place where you tune up your Zabbix server. We will update the zabbix server password only. If you have used different zabbix database name, consider updating that as well.

sudo nano /etc/zabbix/zabbix_server.conf

Let’s find the keyword DBPassword
Hit Ctrl + W on your keyboard, type DBPassword, and then hit Enter on your keyboard. You should see #DBPassword. Update it as follows:


Once you have made the above change, then use the following on your keyboard to save the file:
Ctrl  + O and Ctrl + X

8. Configure PHP for Zabbix frontend

We will edit  /etc/zabbix/apache.conf file to update the timezone. Here is the list of timezones and find yours.

sudo nano  /etc/zabbix/apache.conf

Look for # php_value date.timezone Europe/Riga below PHP 7.0 configuration and update your timezone accordingly. Mine looks like this

php_value date.timezone Australia/Melbourne

Once you have made the above change, then use the following on your keyboard to save the file:
Ctrl  + O and Ctrl + X

9. Start Zabbix server and agent processes

Alright, now it is the time to start Zabbix server and agent. 

sudo systemctl restart zabbix-server zabbix-agent apache2

Let’s add Zabbix server and agent services to auto start at system boot

sudo systemctl enable zabbix-server zabbix-agent apache2

10. Configure Front End

All the hard work is done and now let’s finish it off through a web browser. Make sure your system can ping the Ubuntu server from where you are accessing the browser.

  1. Open your favourite browser and open Zabbix by typing the following:

    In my case, it will look like You should see the front end welcome screen.
  2. You will check of pre-requisites step and make sure everything is ok before proceeding further
  3. Provide the details of zabbix database we configured earlier and click on the next step
  4. Update the name, I will call it TEKNEX-NETMON01 and click on the next step
  5. Here you will see a summary of the settings which you selected and provided. Click next and finish

11. Login to Zabbix

The default credentials are as follows:
Username: Admin
Password: zabbix

Note: Username is case sensitive.

Well that is all. Let me know how did you go with your setup along with your current configuration (Ubuntu Version, MySQL Version, PHP Version and Apache Version)

About Jay Singh

Follow Me
Notify of
Newest Most Voted
Inline Feedbacks
View all comments
fairy heryana
fairy heryana
11 months ago

Really helped me

11 months ago

Hi Jay,

thanks for great article. I installed the Zabbix on my home server, but there is a problem. In dashboard Zabbix says, that the server is not running. “Zabbix server is running: no”. Can you help me please?


11 months ago
Reply to  Jay Singh

Hi Jay,

thank you for your reply, unfortunately it still does not work.


11 months ago
Reply to  Jay Singh

This is what I am getting 4498:20201118:172120.350 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)  4498:20201118:172120.350 database is down: reconnecting in 10 seconds  4498:20201118:172130.352 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)  4498:20201118:172130.352 database is down: reconnecting in 10 seconds  4498:20201118:172140.353 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)  4498:20201118:172140.353 database is down: reconnecting in 10 seconds  4498:20201118:172150.355 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO) so I think there is a… Read more »

11 months ago
Reply to  Jay Singh

Hey Jay I think if the password would not be correct I would not be able to log into the dashboard. I have checked it and it is ok.

Screenshot 2020-11-19 203214.png
11 months ago
Reply to  Jay Singh

I can even create a new user, add host, etc. but it will not be monitored. I just went to Queue section inside of dashboard and Zabbix says:

  • Connection to Zabbix server “localhost” refused. Possible reasons:
  • 1. Incorrect server IP/DNS in the “zabbix.conf.php”;
  • 2. Security environment (for example, SELinux) is blocking the connection;
  • 3. Zabbix server daemon not running;
  • 4. Firewall is blocking TCP connection.
  • Connection refused

Google says that I should replace localhost with ip address of the device, but even after I am doing it, it does not work.

Hamish A
Hamish A
10 months ago

Installed by following this blog and it all worked. Thank you for all the commands.

9 months ago


9 months ago

Great article really helped me. One thing though, I think it is best not to use the same variable for everything. Like your DB name and user name are the same. In commands, you never know when you are referring to the DB or username. If it was like zabbixdb and zabbixuser things will be much clearer.

Last edited 9 months ago by Amol
Pavithran S
Pavithran S
8 months ago

Its showing Zabbix server not running.
i am using Ubuntu 20.04 and zabbix version 5.2.
why the zabbix server not running.

6 months ago
Reply to  Pavithran S

check status of zabbix
using below cmd
systemctl status zabbix-server

Last edited 6 months ago by veera

Would love your thoughts, please comment.x