How to Install Elasticsearch 8.x on Fedora 39

Published by

on

Time to read:

2–4 minutes

In this post we are going to cover how to install Elasticsearch on Fedora 39. More specifically I will be installing Elasticsearch version 8.x. This is part of a larger series of posts where we will go over building the entire ELK (Elastic) stack1.

This article assumes that you have a Fedora 39 machine setup and ready to go with an internet connection. In the case of my homelab I have a web proxy so if you have a similar setup make sure that you allow your proxy to forward traffic to the following internet domain name .elastic.co to download all the Elasticsearch application files.


  1. SECTION I – What is Elasticsearch
  2. SECTION II – Elasticsearch Installation
    1. SECTION II – A – Install Java
      1. FIGURE 1 – Java Installation
      2. FIGURE 2 – Java Version
    2. SECTION II – B – Install Elasticsearch
      1. Example 1 – Elastic Repository
      2. FIGURE 3 – Accept Elasticsearch Installation
    3. SECTION II – C – Start Elasticsearch Service
      1. FIGURE 4 – Confirmation Elasticsearch is Running
    4. SECTION II – C – Initial Elasticsearch Configuration
      1. FIGURE 5 – Set Default Elastic User Password
  3. SECTION III – Footnotes

SECTION I – What is Elasticsearch

Elasticsearch is at the heart of the ELK stack. It is a RESTful2 search and analytics engine that has many varied uses. Elasticsearch securely stores data and allows quick search functionality and analytical insight for the stored data.

SECTION II – Elasticsearch Installation

SECTION II – A – Install Java

Before we can install Elasticsearch we need to install Java so that it can run.

  1. Enter the following command to install Java:
  2. dnf install lsof java-17-openjdk java-17-openjdk-devel -y

    FIGURE 1 – Java Installation
  3. Once the installation is completed use the following command to configure that Java is installed and the correct version is running as in Figure 2.

java –version

FIGURE 2 – Java Version

SECTION II – B – Install Elasticsearch

Now that we have the required prerequisites we can install the Elasticsearch application.

  1. Firstly we need to import the GPG (GNU Privacy Guard) key so that when we use the DNF package manager to download and install the Elasticsearch application we can confirm that none of the binary files have been altered. To import the key use the following command:
  2. rpm –import https://packages.elastic.co/GPG-KEY-elasticsearch

  3. Now we need to add the repository for the Elasticsearch source files. Create the following file /etc/yum.repos.d/elasticsearch.repo and place the contents of Example 1 in the file:
  4. [elasticsearch]
    name=Elastic repository for 8.x packages 
    baseurl=https://artifacts.elastic.co/packages/8.x/yum 
    gpgcheck=1 
    gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch 
    enabled=1 
    autorefresh=1 t
    ype=rpm-md
    Example 1 – Elastic Repository
  5. Now we can use DNF to enable the repo and install Elasticsearch using the following command:

dnf install –enablerepo=elasticsearch elasticsearch

FIGURE 3 – Accept Elasticsearch Installation

SECTION II – C – Start Elasticsearch Service

Now that we have the application installed we need to go ahead and start the service and then enable it to start on boot.

  1. Start the Elasticsearch service:
  2. systemctl start elasticsearch

  3. Enable the Elasticsearch service to start on boot:
  4. systemctl enable elasticsearch

  5. Confirm the Elasticsearch service is running:

systemctl status elasticsearch

FIGURE 4 – Confirmation Elasticsearch is Running

SECTION II – C – Initial Elasticsearch Configuration

Finally, there is only 1 initial bit of configuration that you will have to do to get up and running. That is we need to create the default elastic user a secure password.

  1. Run the following command:
  2. /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic -i

  3. When prompted enter Y in order to set the elastic users password
  4. FIGURE 5 – Set Default Elastic User Password
  5. Enter a secure password twice. NOTE: I would recommend storing the password in a password manager like KeePass.

SECTION III – Footnotes

  1. ELK stack – the Elastic stack is an umbrella term for multiple applications made and managed by Elastic. The ELK stack includes the following core applications; Elasticsearch, Kibana, Logstash. ↩︎
  2. RESTful – REST stands for Representational State Transfer. It is a standard that guides how users or other applications can interact with data stored and served up by a web server. For an API (Application Programmable Interface) to be considered RESTful it must implement the 6 REST constraints. ↩︎

3 responses to “How to Install Elasticsearch 8.x on Fedora 39”

  1. How to Install Kibana 8.x on Fedora 39 – Knowledge Addict Avatar

    […] installed and configured ready to go. If you need to see how to install Elasticsearch then click here for the previous post in the ELK […]

    Like

  2. How to Install Logstash 8.x on Fedora 39 – Knowledge Addict Avatar

    […] Kibana installed and configured ready to go. If you need to see how to install Elasticsearch then click here. If you need to see how to install Kibana then click […]

    Like

  3. How to Configure ELK Stack for Custom Enterprise CA TLS Certificates – Knowledge Addict Avatar

    […] Kibana installed and configured ready to go. If you need to see how to install Elasticsearch then click here. If you need to see how to install Kibana then click here. Additionally, I am going to assume that […]

    Like

Leave a comment