How To Install ELK Stack on Ubuntu 20.04 LTS

Install ELK Stack on Ubuntu 20.04

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.

Step 2. Installing Java on Ubuntu.

Logstash requires Java 8 or Java 11. Install OpenJDK 11 using following command:

Verify the Java version:

Step 3. Installing Elasticsearch on Ubuntu.

Follow these steps to get the repository added to your system:

Next, create the following file:

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:

Step 4. Install and configure Nginx.

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:

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:

Step 7. Accessing Kibana.

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.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!