How To Install ELK Stack on CentOS 8

Install ELK Stack on CentOS 8

In this tutorial we will show you how to install ELK Stack on CentOS 8. 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 & 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 install ELK Stack (Elasticsearch, Logstash and Kibana) on CentOS 8 server.

Install ELK Stack on CentOS 8

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Installing Java.

Before installing Elasticsearch we must have java installed on your system as Elasticsearch depends on java:

Verify the Java version:

Step 3. Installing Elasticsearch.

Now, we add ELK repository to CentOS 8:

After adding the repo, import GPG key:

Next, clear and update your YUM package index:

Elasticsearch repository is ready for use. You can install Elasticsearch using the command below:

Check that installation completed successfully:

Once installation done, Set up the JVM options like memory limits and others according to your own needs. For this edit the following file:

Now, start and enable the Elasticsearch services:

Verify that Elasticsearch is running as expected:

Step 4. Installing Kibana.

The next Elastic Stack component to install is Kabana. Since we already created the Elastic Stack repos, you can simply run the command:

After a successful installation, configure Kibana:

Start and enable Kibana to run on system boot:

Kibana is now installed and working on our system. To check the web-page, open the web browser & go to the URL mentioned below (use the IP address for your ELK host):

Step 5. Installing Logstash.

The last installation is for Logstash which will act like a centralized logs server for your client systems:

Logstash custom configurations can be placed under the /etc/logstash/conf.d/ directory. For further information you can check out Logstash configuration manual.

Step 6. Installing other ELK tools (optional)

  • Filebeat:

It makes things simple by following lightweight way to forward and centralized logs and files.

  • Metricbeat:

Helps you to send and collect metrics from your systems and services, from CPU to memory,  Redis to NGINX,  and many more.  It’s also a lightweight way to access system and services statistics.

  • Packetbeat:

Packetbeat provides a lightweight way for Network Data to increase performance.

  • Heartbeat:

Monitors the up time of Services. Helps you to know Availability of services.

  • Auditbeat:

Useful for auditing the activities and processes on your system by users. The tools we have discussed so far can be installed with the give command one time or you can install individually by this command:

Congratulation’s! You have successfully installed ELK. Thanks for using this tutorial for installing ELK Stack (Elasticsearch, Logstash and Kibana) on CentOS 8 systems. 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!