In this tutorial we will show you how to install ELK Stack on Ubuntu 20.04 LTS. For those of you who didn’t know, ELK stack is a popular, open source log management platform. It is used as a centralized management for storing, analyzing and viewing of logs. Centralized management makes it easier to study the logs and identify issues if any for any number of servers.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation ELK Stack on an Ubuntu 20.04 Focal Fossa server.
Install ELK Stack on Ubuntu 20.04 LTS Focal Fossa
Step 1. First make sure that all your system packages are up-to-date by running these following apt commands in the terminal.
Logstash requires Java 8 or Java 11. Install OpenJDK 11 using following command:
Verify the Java version:
[firstname.lastname@example.org~]# java -version
Follow these steps to get the repository added to your system:
wget-qO-https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Next, create the following file:
debhttps://artifacts.elastic.co/packages/6.x/apt stable main
Finally, you can update
apt now that the repository is added:
Then, install Elasticsearch with
apt using the following command:
Next, you need to edit the Kibana configuration file to set the host server as localhost:
Save your the configuration file and exit it. Then, restart Kibana and Elasticsearch services:
To configure Nginx with SSL to Proxy connection to Kibana, you need to generate the SSL/TLS certificates and create Nginx configuration file to define Kibana settings:
Next, create a basic authentication file with the openssl command:
echo"admin:`openssl passwd -apr1 YourPasswd`"|sudotee-a/etc/nginx/htpasswd.kibana
Then, create a virtual host configuration file for the Kibana instance:
Creating a symbolic link and test the Nginx configuration:
Restart the Nginx service and set it to start automatically on boot:
If UFW is running, allow Nginx connections, both HTTP and HTTPS:
You can now access the kibana interface by opening your browser and typing:
Congratulation’s! You have successfully installed ELK Stack. Thanks for using this tutorial for installing ELK Stack on your Ubuntu 20.04 LTS Bionic Beaver. For additional help or useful information, we recommend you to check the official ELK Stack website.