This tutorial discusses the way to install ElasticSearch 7.x on CentOS 7. Elasticsearch is an open source search and analytics engine that permits you to store, search, and analyze big volumes of knowledge in real time. Elasticsearch powers many Applications that believe intensive search operations like e-commerce platforms and large data applications.

The latest release of ElasticSearch as of this text update is 7. we’ll cover the minimum steps you’ll got to install ElasticSearch 7 on CentOS 7 Linux system. So let’s start .

Step 1: Update CentOS 7 Linux

The server you’re performing on should be updated before you put in ElasticSearch 7.x on CentOS 7. Just run the commands below to update it.

sudo yum -y update
sudo reboot

Step 2: Install Java on CentOS 7

The default Java installable on CentOS 7 is Java 8. Here are the commands to use for the installation.

sudo yum -y install java-1.8.0-openjdk  java-1.8.0-openjdk-devel

Set Java home

cat <<EOF | sudo tee /etc/profile.d/
export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export PATH=\$PATH:\$JAVA_HOME/bin
export CLASSPATH=.:\$JAVA_HOME/jre/lib:\$JAVA_HOME/lib:\$JAVA_HOME/lib/tools.jar

Source created file to update your environment.

source /etc/profile.d/

Step 3: Add ElasticSearch Yum repository

Add the repository for downloading ElasticSearch 7 packages to your CentOS 7 system.

cat <<EOF | sudo tee /etc/yum.repos.d/elasticsearch.repo
name=Elasticsearch repository for 7.x packages

If you want to install Elasticsearch 6, replace all occurrences of 7 with 6. Once the repository is added, clear and update your YUM package index.

sudo yum clean all
sudo yum makecache

Step 4: Install ElasticSearch 7 on CentOS 7

Finally install ElasticSearch 7.x on your CentOS 7 machine. Note that we’ve added an open source repository. Commercial flavor is out there on the opposite repository.

sudo yum -y install elasticsearch-oss

Confirm ElasticSearch 7 installation on CentOS 7:

$ rpm -qi elasticsearch-oss
Name        : elasticsearch-oss
Epoch       : 0
Version     : 7.4.0
Release     : 1
Architecture: x86_64
Install Date: Thu 17 Oct 2019 05:10:43 AM UTC
Group       : Application/Internet
Size        : 395896718
License     : ASL 2.0
Signature   : RSA/SHA512, Fri 27 Sep 2019 10:40:01 AM UTC, Key ID d27d666cd88e42b4
Source RPM  : elasticsearch-oss-7.4.0-1-src.rpm
Build Date  : Fri 27 Sep 2019 08:49:06 AM UTC
Build Host  : packer-virtualbox-iso-1559162487
Relocations : /usr 
Packager    : Elasticsearch
Vendor      : Elasticsearch
URL         :
Summary     : Distributed RESTful search engine built for the cloud
Description :
Reference documentation can be found at
and the 'Elasticsearch: The Definitive Guide' book can be found at

Configure Java memory Limits

You can set JVM options like memory limits by editing the file: /etc/elasticsearch/jvm.options

Example below sets initial/maximum size of total heap space

$ sudo vi /etc/elasticsearch/jvm.options ..... -Xms1g -Xmx1g

If your system has less memory, you can configure it to use small megabytes of ram.


Start and enable elasticsearch service on boot:

sudo systemctl enable --now elasticsearch

Confirm that the service is running.

$ sudo systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2021-05-11 03:14:00 UTC; 13s ago
 Main PID: 8774 (java)
   CGroup: /system.slice/elasticsearch.service
           └─8774 /usr/share/elasticsearch/jdk/bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSI...

Oct 17 05:15:46 cent7.novalocal systemd[1]: Starting Elasticsearch...
Oct 17 05:15:46 cent7.novalocal elasticsearch[8774]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in versio...elease.
Oct 17 05:16:00 cent7.novalocal systemd[1]: Started Elasticsearch.
Hint: Some lines were ellipsized, use -l to show in full.

Check if you can connect to ElasticSearch Service.

$ curl 
  "name" : "cent7.local",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "SmGu9eXJRlGzxqEy2brGXQ",
  "version" : {
    "number" : "7.4.0",
    "build_flavor" : "oss",
    "build_type" : "rpm",
    "build_hash" : "22e1767283e61a198cb4db791ea66e3f11ab9910",
    "build_date" : "2021-05-11T04:344:48.569419Z",
    "build_snapshot" : false,
    "lucene_version" : "8.2.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  "tagline" : "You Know, for Search"

You should be able to create an index with curl.

$ curl -X PUT ""

Step 5: Install Kibana 7 on CentOS 7

Related ElasticSearch Packages such as Kibana, Logstash e.t.c can be installed from the repository added.

sudo yum install kibana-oss logstash

After a successful installation, configure Kibana:

$ sudo vi /etc/kibana/kibana.yml "" ""
elasticsearch.url: "http://localhost:9200"

Change other settings as desired then start kibana service:

sudo systemctl enable --now kibana

If you have an active firewall, you’ll need to allow access to Kibana port:

sudo firewall-cmd --add-port=5601/tcp --permanent
sudo firewall-cmd --reload

Access http://ip-address:5601 to open Kibana Dashboard: