• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Tuesday, May 20, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Control Panels

PART ONE: How to Install Zabbix on an Ubuntu 18.04 VPS or Dedicated Server

How VPS by How VPS
November 2, 2018
in Control Panels
0
0
SHARES
59
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
  2. Before You Begin
  3. Step 1 – Installing Apache
  4. Step 2 – Installing PHP And The Required Modules
  5. Step 3 – Setting Up MariaDB
  6. Step 4 – Installing The Zabbix Server
  7. Step 5 – Configuring The Zabbix Server
  8. Conclusion
  9. Check out these top 3 Linux hosting services
    1. Was this article helpful?

Introduction

Zabbix is one of the best monitoring tool developed to monitor server availability, network devices, server performance, and other critical network components. It is a reliable open-source application that features a backend written in C and Java, and a frontend developed in PHP.

This tutorial will help you install Zabbix on your Ubuntu 18.04 server to keep track of the status of your system, applications, and network devices.

Ready? Let’s get started!

Before You Begin

To install the Zabbix server on Ubuntu 18.04 successfully, the following dependencies must be installed first:

  • A database server (MariaDB or MySQL hosting)
  • PHP
  • Apache web server

Step 1 – Installing Apache

First, update your Ubuntu 18.04 server:

$ sudo apt update
$ sudo apt upgrade

Next, issue the command below to install Apache2

$ sudo apt install apache2

Once, Apache2 is installed, run the command below to open the file /etc/apache2/conf-enabled/security.conf and adjust the settings to configure the basic security.

$ sudo nano /etc/apache2/conf-enabled/security.conf

Find the line ServerTokens OS and change it to ServerTokens Prod. the ServerTokens directive determines what is returned as the response for server HTTP and has only six valid options namely: OS, Full, Minor, Minimal, Prod, and Major.

Next, run the command below to open the /etc/apache2/apache2.conf file:

 $ sudo nano /etc/apache2/apache2.conf

Find ServerName and set it to Zabbix.example.com and the ServerAdmin to [email protected].

Note: Remember to replace example.com with your Fully Qualified Domain Name (FQDN).

Once everything is done, save the changes and exit the nano editor. For these changes to take effect, restart your Apache web service:

$ sudo systemctl restart apache2

Next, execute the command below to enable the firewall and then allow HTTP and HTTPs:

$ sudo ufw enable
$ sudo ufw allow http
$ sudo ufw allow https

Step 2 – Installing PHP And The Required Modules

After installing Apache, you should install PHP and the modules required to enable Apache service to utilize PHP scripts. Issue the command below:

$ sudo apt-get -y install php php-pear php-cgi php-common libapache2-mod-php php-mbstring php-net-socket php-gd php-xml-util php-mysql php-gettext php-bcmath

You can execute the following command to confirm the PHP version:

$ sudo php -v

This will give you an output similar to the one below:

PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )
Copyright (c) 1997-2018ThePHPGroup
ZendEnginev3.2.0, Copyright (c) 1998-2018ZendTechnologies
withZendOPcachev7.2.5-0ubuntu0.18.04.1, Copyright (c) 1999-2018, byZendTechnologies

Next, execute the command below to enable conf php7.2-cgi:

$ sudo  a2enconf php7.2-cgi

You will be prompted to issue the command below to activate the new configuration:

$ sudo systemctl reload apache2

Once you reload Apache2, open the /etc/php/7.2/apache2/php.ini to set your correct timezone:

$ sudo /etc/php/7.2/apache2/php.ini

Find the line date.timezone and set it to your timezone. The timezones are set by location, and it’s easy to select one. For instance,

Date.timezone = "America/Toronto"

Then run the command below to restart Apache:

$ sudo systemctl restart apache2

Step 3 – Setting Up MariaDB

In this tutorial, we’ll use MariaDB as our database server. Follow the steps below to create the Database for a Zabbix user.

Execute the command below to log in to the MariaDB command line:

$ sudo mysql -u root -p

Enter your root credentials and hit ENTER to access the MariaDB shell. Once you are on that command line, issue the command below to create the Zabbix user database:

MariaDB [(none)]>

createdatabase zabbix;

Then, execute the following command to grant the new user all privileges:

MariaDB [(none)]>

grant all privilegeson zabbix.* to zabbix@'localhost'identifiedby'password'

Note: Remember to replace the value ‘password’ with your preferred password.

Next, flush the privileges:

MariaDB [(none)]>

flushprivileges;

Then, execute the command below to exit the database command line:

MariaDB [(none)]>

exit

Step 4 – Installing The Zabbix Server

To install the Zabbix server , first, execute the command below to add the Zabbix repository:

$ sudo wget http://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+bionic_all.deb

Then download the Zabbix installation files

$ sudo dpkg -i zabbix-release_3.4-1+bionic_all.deb

Now, update your system and install the Zabbix server modules:

$ sudo apt update
$ sudo apt install zabbix-agent zabbix-server-mysql php-mysql zabbix-frontend-php

You can now run the command below to confirm the status of Zabbix server:

$ sudo systemctl status zabbix-server

This will give you the following output:

● zabbix-server.service - Zabbix Server
   Loaded: loaded (/lib/systemd/system/zabbix-server.service; disabled; vendor preset: enabled)
   Active::active (running) since Wed 2018-10-2410:21:15 UTC; 2h 44min ago
  Process:23567 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
  ...

Step 5 – Configuring The Zabbix Server

Now, open the file /etc/zabbix/zabbix_server.conf:

$ sudo /etc/zabbix/zabbix_server.conf

And confirm the following values are correctly configured:

DBName=zabbix
DBUser=zabbix
DBPassword=password

If everything is okay, run the command below to restart the Zabbix server:

$ sudo systemctl restart zabbix-server

Next, run the command below:

$ sudo nano /usr/share/zabbix/include/classes/setup/CFrontendSetup.php

Find the directive always_populate_raw_post_data and set it to off. Besides, locate the lines:

publicfunctioncheckPhpAlwaysPopulateRawPostData() {
$current = ini_get('always_populate_raw_post_data');

Add the value ‘$current = -1‘ immediately after the line above to have the following result:

publicfunctioncheckPhpAlwaysPopulateRawPostData() {
    $current = ini_get('always_populate_raw_post_data');
    $current = -1;

Save the changes and exit the nano editor.

Run the command below to open the file /etc/php/7.2/apache2/php.ini:

$ sudo nano /etc/php/7.2/apache2/php.ini

Once the file opens, locate and set the PHP requirements as follows:

max_execution_time = 300
max_input_time = 300
post_max_size = 16M

Next, open the file /etc/zabbix/zabbix_agentd.conf and adjust the settings to enable Zabbix agent tocontrol the Zabbix server.

$ sudo nano /etc/zabbix/zabbix_agentd.conf

Set the following:

Hostname=zabbix.server.example.com

Replace example.com with your valid domain name.

Now, start and enable the Zabbix server:

$ sudo systemctl start zabbix-server
$ sudo systemctl enable zabbix-server

The last thing is to allow ports 5000 and 5001

$ sudo ufw allow proto tcp fromany to any port 10050,10051

Conclusion

That is It! You have successfully installed Zabbix on your Ubuntu 18.04 VPS or Dedicated server. Part two of this article will show you how to complete the server settings for your Zabbix web interface.

Check out these top 3 Linux hosting services

0

Was this article helpful?

Submit
Previous Post

4 Ways to Find Server Public IP Address in Linux Terminal

Next Post

How to Permanently Disable Swap in Linux

Next Post

How to Permanently Disable Swap in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet