How To Install ELK Stack on Ubuntu 18.04 LTS

Install ELK Stack on Ubuntu 18.04 LTS

In this tutorial we will show you how to install ELK Stack on Ubuntu 18.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 18.04 Bionic Beaver server.

Install ELK Stack on Ubuntu 18.04 LTS Bionic Beaver

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

Step 2. Installing Java on Ubuntu 18.04 LTS.

Now install the Java by using the following command:

Next, you can also set the JAVA_HOME and other defaults by installing oracle-java8-set-default:

Then, You can now verify if the JAVA_HOME variable is set by running:

Verify the Java version:

Step 3. Installing Elasticsearch on Ubuntu 18.04 LTS.

First, install Elasticsearch using the apt package manager from the official Elastic repository:

Then, install Elasticsearch with apt using the following command:

Start the Elasticsearch service and set it to automatically start on boot:

Elasticsearch is now installed. Edit it’s configurations now, using following commands:

Step 4. Installing Kibana on Ubuntu 18.04 LTS.

First, create the Kibana source list:

Now install Kibana with this command:

Once the installation is completed, open the kibana.yml file and restrict the remote access to the Kibana instance:

Start the Kibana service and set it to start automatically on boot:

Step 5. Installing Logstash on Ubuntu 18.04 LTS.

First, create the Logstash source list:

Next, Install Logstash using the apt package manager:

Once the Logstash package is installed start the Logstash service and set it to start automatically on boot:

Step 6. Install and configure Nginx as a reverse proxy.

Next, use Nginx as a reverse proxy to access Kibana from the public IP address. To install Nginx, run:

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:

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 18.04 LTS Bionic Beaver. For additional help or useful information, we recommend you to check the official ELK Stack web site.

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!