How to Install Zabbix 4.4 on Ubuntu 18.04 / 16.04 and Debian 9/8
How to Install Zabbix 4.4 on Ubuntu 18.04 / 16.04 and Debian 9/8
Install Apache, MySQL and PHP
You must have a LAMP environment on your server to use Zabbix. Please run these commands as root.
apt-get update
apt-get install apache2 libapache2-mod-php
apt-get install mysql-server
apt-get install php php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql
Update timezone in php configuration file /etc/php/PHP_VERSION/apache2/php.ini. Like below:
[Date]
; http://php.net/date.timezone
date.timezone = 'Asia/Kolkata'
Enable zabbix Repository
On Debian 9 run:
# wget https://repo.zabbix.com/zabbix/4.4/debian/pool/main/z/zabbix-release/zabbix-release_4.4-1+stretch_all.deb
# dpkg -i zabbix-release_4.4-1+stretch_all.deb
On Debian 8 run:
# wget https://repo.zabbix.com/zabbix/4.4/debian/pool/main/z/zabbix-release/zabbix-release_4.4-1+jessie_all.deb
# dpkg -i zabbix-release_4.4-1+jessie_all.deb
On Ubuntu 18.04 run:
# wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.4-1+bionic_all.deb
# dpkg -i zabbix-release_4.4-1+bionic_all.deb
On Ubuntu 16.04 run:
# wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.4-1+xenial_all.deb
# dpkg -i zabbix-release_4.4-1+xenial_all.deb
On Ubuntu 14.04 run:
# wget https://repo.zabbix.com/zabbix/4.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.4-1+trusty_all.deb
# dpkg -i zabbix-release_4.4-1+trusty_all.deb
Update the repository information.
# apt-get update
Install Zabbix Server
After adding Zabbix apt repository in your system use following command to install Zabbix server. Here zabbix-server-mysql package includes Zabbix server with MySQL support.
apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-agent
Set Mariadb root Password:
Edit create and import initial zabbix database and user
First we need to create zabbix database (zabbixdb) and create a zabbix user (zabbixuser).
[root@zabbixserver ~]# mysql -u root -p
Enter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 10Server version: 5.5.60-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE zabbixdb CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO zabbixuser@localhost IDENTIFIED BY "Your Password";
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
[root@zabbixserver ~]#
Enter password:Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 10Server version: 5.5.60-MariaDB MariaDB ServerCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE zabbixdb CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbixdb.* TO zabbixuser@localhost IDENTIFIED BY "Your Password";
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
[root@zabbixserver ~]#
After creating the Zabbix database and user we need to import the zabbix initial database using the below commands:
[root@zabbixserver ~]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbixuser -p zabbixdb
Enter password:
Enter password:
Now we need to edit database configuration in the Zabbix server configuration file zabbix_server.conf
[root@zabbix ~]# vi /etc/zabbix/zabbix_server.conf
Specify the database name for zabbix , database user name and the password
Specify the database name for zabbix , database user name and the password
DBHost=localhost
DBName=zabbixdb
DBUser=zabbixuser
DB Password=YOUR_PASSWORD
DBName=zabbixdb
DBUser=zabbixuser
DB Password=YOUR_PASSWORD
Restart Apache and Zabbix
Zabbix creates its own apache configuration file /etc/zabbix/apache.conf and make a link to Apache configuration directory. Let’s use the following command to restart Apache service.
service apache2 restart
Zabbix server configuration file are located at /etc/zabbix/zabbix_server.conf. Restart Zabbix server.
service zabbix-server restart
After starting the Zabbix service, let’s go to Zabbix web installer and finish the installation.Setup Zabbix Web Frontend
Navigate to http://ip_address/zabbix or http://host_name/zabbix
Make sure all configurations are ok.
Please enter DB details:
Please enter Zabbix Server details:
Summary:
Finish the installation:
Login Prompt:
Default username and password is "Admin" & "Zabbix"
Zabbix dashboard:
Next Article:
How to Add Host in Zabbix Server to Monitor
How to install Zabbix Agent on CentOS / RHEL 6/7
How to Install Zabbix 4.4 in RHEL/CentOS 7
How To Install Zabbix Agent on Ubuntu 18.04 16.04 LTS
No comments