Today we are going to learn that how to install Zabbix 4.0 LTS Server On Ubuntu 18.04 and 20.04. Zabbix is an open source interesting and most popular monitoring package. Zabbix provide the monitoring service on servers, desktops, network based applications and applications etc. It uses Zabbix agent for getting information and collecting data on the devices installed with Zabbix. You can also monitor the SMTP, HTTP, SNMP, TCP, ICMP, SSH and telnet protocols or packets. You’ll be get notified by Zabbix to stay alert for real time with the help of XMPP. Just follow the below steps for an easy installation.
Step 1: Update Your System
First of all update the system to the latest updates. Run the below command in your terminal.
sudo apt update
Step 2: Add Zabbix Repository
Now, add the Zabbix repository on Ubuntu 18.04 / 20.04 as it is not included in Ubuntu repositories. Type the below command in your terminal.
wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-3+bionic_all.deb
sudo dpkg -i zabbix-release_4.0-3+bionic_all.deb
Step 3: Installing Zabbix Server
After setting up the repository for Zabbix Server, update your system again and run the command to install zabbix along-with mysql package using the below command.
sudo apt update
sudo apt -y install zabbix-server-mysql
Press “Y” when prompted.
[email protected]:~$ sudo apt install zabbix-server-mysql
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
libclone-perl libdbd-mariadb-perl libdbi-perl libmariadb3
libreadline5 libterm-readkey-perl mariadb-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
default-mysql-server fping libaio1 libblas3 libevent-2.1-7
libevent-core-2.1-7 libiksemel3 liblinear4 liblua5.3-0 libmecab2
libodbc1 libopenipmi0 libssh2-1 lua-lpeg mecab-ipadic
mecab-ipadic-utf8 mecab-utils mysql-client-8.0
mysql-client-core-8.0 mysql-server-8.0 mysql-server-core-8.0 nmap
nmap-common snmpd traceroute
Suggested packages:
liblinear-tools liblinear-dev libmyodbc odbc-postgresql tdsodbc
unixodbc-bin mailx tinyca ncat ndiff zenmap snmptrapd
zabbix-frontend-php snmp-mibs-downloader
The following packages will be REMOVED:
mariadb-client mariadb-client-10.5 mariadb-client-core-10.5
The following NEW packages will be installed:
default-mysql-server fping libaio1 libblas3 libevent-2.1-7
libevent-core-2.1-7 libiksemel3 liblinear4 liblua5.3-0 libmecab2
libodbc1 libopenipmi0 libssh2-1 lua-lpeg mecab-ipadic
mecab-ipadic-utf8 mecab-utils mysql-client-8.0
mysql-client-core-8.0 mysql-server-8.0 mysql-server-core-8.0 nmap
nmap-common snmpd traceroute zabbix-server-mysql
0 upgraded, 26 newly installed, 3 to remove and 0 not upgraded.
Need to get 38.2 MB of archives.
After this operation, 242 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Now, run the given command to install the zabbix front-end package. Press Y when prompted.
sudo apt install zabbix-frontend-php
Then install the zabbix agent with the help of given command.
sudo apt install zabbix-agent
Step 4: Create Zabbix Database In Ubuntu 18.04 / 20.04
To create a database for Zabbix, run the below command
sudo mysql -u root -p
Provide these details for the database.
DatabaseName: zabbix
DatabaseUser: zabbixuser
DatabasePassword: password
Then fire the following command to import the data into the database.
cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -u zabbixuser -p zabbix
Step 5: Configure Zabbix Server
Provide the database details created above in the zabbix configuration file. To do this hit the below command.
sudo nano /etc/zabbix/zabbix_server.conf
Provided the following details.
DatabaseHost=localhost
DatabaseName: zabbix
DatabaseUser: zabbixuser
DatabasePassword: password
And then restart the apache and zabbix server services.
sudo systemctl restart zabbix-server
sudo systemctl restart zabbix-agent
sudo systemctl restart apache2
Then to start at boot, run the below command
sudo systemctl enable zabbix-server zabbix-agent apache2
Step 6: Access Web Dashboard of Zabbix Server
Type the ip/zabbix/ in your browser to access the Zabbix web dashboard. You’ll see the welcome wizard finish it step by step as given below.
Double check that all pre-requisite are matched and then hit next step button.
Now, provide the credentials as given below and hit “Next Step”.
Then provide Zabbix server details as:
Verify the details and click Next button.
Then on the next screen click on finish button and you’ll be redirected to the Zabbix login page.
Provide username “Admin” with pass “zabbix” to login.
After login it you’ll see the similar dashboard.
So, this is how you can install Zabbix Server on Ubuntu 18.04.