Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

How to Install Elastic Stack (ELK) on Red Hat Enterprise Linux (RHEL)

June 7, 2016
Hemant Jain
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    Sometimes, software just goes together. Linux, the Apache Web server, MySQL, and PHP, the four ingredients of the LAMP stack, which revolutionized data centers and made open source a big deal two decades ago, are probably the most famous example. But there are lots of others.

    Here's another open source software stack you should know about in our present age of cloud and big data: the Elastic Stack, or ELK. Based on Elasticsearch, Logstash and Kibana, ELK is a fully open source solution for searching, analyzing and visualizing data in any format, at any scale.

    Since ELK has multiple parts, and some of them have other dependencies, setting up ELK is not as simple as installing other stacks, which sometimes require a simple one-line yum installation command. But fear not. ELK is still easy enough to install if you follow the proper steps.

    Below, we'll walk through configuring a Red Hat Enterprise Linux (RHEL) server for ELK, installing each of the requisite components and configuring them to work with one another. (RHEL is now free for development use --- download it here.)

    Prerequisites

    First, let's go over some prerequisites. This guide assumes:

    • Your server runs RHEL 6 or RHEL 7. Some parts of the ELK stack support RHEL 5, but not all, so don't try using it. (By the way, if you're still using RHEL 5, you should probably be upgrading soon, since its EOL date is fast approaching.)
    • You want to install ELK using the official RPM packages from the developers. (Yes, you could pull the source through git and compile it yourself, but that's outside the scope of this post.)
    • You want to install the latest version of ELK. You could install older versions by telling yum to download specific packages (but I assume you want to be as up-to-date as possible).
    • You're happy using Oracle Java, which is what we'll install to meet the Java dependency of ELK. If you want to use a different version of Java, check the Elasticsearch support matrix to make sure it will work. (Yes, OpenJDK is supported.)

    Step 1: Install Java

    Let's dive into the installation process. Our first task is to install Java, since Elasticsearch and Logstash require Java to run. As noted above, we'll install Oracle Java, although you could use OpenJDK if you like.

    To do this, we'll use curl to download the latest Java RPM (Java 8 revision 77) from Oracle's site, then install it via yum, with these two commands:

    cd /tmp
    curl --insecure --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" -L "http://download.oracle.com/otn-pub/java/jdk/8u77-b02/jdk-8u77-linux-x64.rpm" > jdk-8u77-linux-x64.rpm

    Lest I start a war between curl and wget fans, I suppose I should tell you how to download Java using wget, too. The commands are:

    cd /tmp
    wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u77-b02/jdk-8u77-linux-x64.rpm"

    Whether you use curl or wget to download Java, you should end up with a file in /tmp called jdk-8u77-linux-x64.rpm. The next step is to install this file by running yum (as root) like so:

    yum -y localinstall jdk-8u73-linux-x64.rpm

    All set. You just installed Java.

    Step 2: Install Elasticsearch

    The next step, installing Elasticsearch, is easier, since we can do it all using yum. (If only Java installation were equally simple...)

    To do this, first import the Elasticsearch GPG key with:

    rpm --import http://packages.elastic.co/GPG-KEY-elasticsearch

    Next, open a blank text file in your favorite text editor (be sure to run the editor as root, so that you have the necessary save permissions) and fill it with these lines:

    name=Elasticsearch repository for 2.x packages
    baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
    gpgcheck=1
    gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
    enabled=1

    Save the file as /etc/yum.repos.d/elasticsearch.repo

    Next, install the Elasticsearch package with:

    sudo yum -y install elasticsearch

    Step 3: Configure and Start Elasticsearch

    Before installing the rest of the ELK stack, we should tweak Elasticsearch a little and start it up.

    Specifically, we want to prevent outside connections to the Elasticsearch HTTP API. To do this, open the file /etc/elasticsearch/elasticsearch.yml in an editor (again, run the editor as root), find the line with the value network.host, uncomment it and replace it with the (uncommented) line network.host: localhost Then save the file and exit.

    You can now start Elasticsearch using the systemctl interface. systemctl start elasticsearch starts it, systemctl stop elasticsearch stops it, and systemctl systemctl enable configures it to start automatically at boot.

    Step 4: Install Kibana

    We're going to follow a similar process to install Kibana. First, create a yum repository file for it by opening a blank text file and adding these lines:

    [kibana-4.4]
    name=Kibana repository for 4.4.x packages
    baseurl=http://packages.elastic.co/kibana/4.4/centos
    gpgcheck=1
    gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
    enabled=1
    
    

    Save the file as /etc/yum.repos.d/kibana.repo

    Then download and install the Kibana package with:

    yum -y install kibana

    We also need to do a quick configuration tweak for Kibana. Open the file /opt/kibana/config/kibana.yml, find the line that reads server.host: "0.0.0.0" and replace it with server.host: "localhost"

    You should now start Kibana with systemctl start kibana. You can stop it using systemctl as well. And to configure Kibana to start automatically at boot, run chkconfig kibana on

    Step 5: Install Logstash

    Our final step is to install the last piece of the ELK stack, Logstash. Here again, we need to create a yum repository file by adding the following lines to a blank text file:

    [logstash-2.2]
    name=logstash repository for 2.2 packages
    baseurl=http://packages.elasticsearch.org/logstash/2.2/centos
    gpgcheck=1
    gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
    enabled=1

    Save the file as /etc/yum.repos.d/logstash.repo. Then install Logstash with:

    yum -y install logstash

    Congrats! Logstash is installed.

    Using ELK

    You now have a basic ELK stack installed. Depending on exactly what you want to do with it, however, you may want to take some additional steps. Consider the following tweaks and additions:

    • By default, Kibana (the Web interface that you use to search and analyze your Elasticsearch data) listens on localhost at port 5601. That means you can connect to it from your RHEL server at localhost:5601. If you want to be able to access Kibana from other servers, too, you'll need to do some additional configuration. Refer here for details.
    • Above, we did a basic installation of Logstash. Your exact configuration of the tool will depend on which plugins you want to use and how you want to work with data. Basic configuration instructions are available here, and more complex examples are here.
    • By default, your ELK stack will only let you collect and analyze logs from your local server. But you can add remote logs to the mix by using Filebeat, which collects logs from other hosts. Here are instructions for installing and setting up Filebeat to work with your ELK stack.

    Screen Shot 2016-05-27 at 3.47.23 PMAbout Hemant Jain

    Hemant Jain is the founder and owner of Rapidera Technologies, a full service software development shop. He and his team focus a lot on modern software delivery techniques and tools. Prior to Rapidera he managed large scale enterprise development projects at Autodesk and Deloitte.

    Last updated: January 19, 2023

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

     

    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI