Install and Uninstall of Elastic Search in Ubuntu

On this topic, We are going to discuss one of the best full-text search and analytics engine and how to  Install and uninstall of Elastic Search in Ubuntu.

What is Elastic Search?

Elasticsearch is a real-time distributed and open source full-text search and analytics engine. It built on the Java programming language, which enables Elasticsearch to run on different platforms. It is accessible from a RESTful web service interface and uses schema-less JSON (JavaScript Object Notation) documents to store data. I. It enables users to explore a very large amount of data at very high speed.


  • Java
  • Ubuntu
  • Non root user
  • Minimum 4GB RAM.

Step 1 — Installing Java

Elastic search requires Java because it is built in Java. Elastic search supports higher 1.7 Java version. Below is a command to install the Java in Ubuntu.

Now check the Java version by executing below command


Step 2 — Install Elasticsearch on Ubuntu

We have configured Prerequsities for the elastic search on step 1 and 2. Now in this step, we will install the elastic search. First, we will add the official elastic apt repository, package and import GPG key in your system.

we have completed the adding apt repository and required key into system. Now run below command to install the elastic search. It always installs the stable version into your system.

Install and Uninstall of Elasticsearch in Ubuntu
Install and Uninstall of Elasticsearch in Ubuntu

Step 3 — Configuration of ElasticSearch

We have installed the elastic search in your system. We can customize the elastic search by updating the elasticsearch.yml. You can edit by any of your editors. I am using vi for editing the file.

Update the below values.

Step 4 — SysV init to Elastic Search

To start and stop the elastic search is dependent on the SysV init or systemd. You can tell which is being used by running this command:

Execute the below command to tell the system to start the elastic search on the boot-up.

Below command to start and stop the elastic search

Below command to see the elastic search logs.

Elastic Search
Elastic Search

Below is the list of the default directory where elastic search installation and logs present in the system.

Elastic search home directory it includes binary files /usr/share/elasticsearch
Elastic search configuration files /etc/elasticsearch
Elastic Search logs directory /var/log/elasticsearch

So we learned how to install the elastic search in ubuntu along with default directory of elastic search. In the next step, we are going to learn about the uninstall of elastic search.

Step 5 — Uninstall of ElasticSearch.

To uninstall the elastic search run below command.

Uninstall of elastic search
Uninstall of elastic search

Step 6 — Clean up Elastic files.

After the uninstall remove the ElasticSearch directories.


Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons