Saturday, October 25, 2025
HomeLanguagesJavaHow to Install and Configure Elasticsearch on Ubuntu ?

How to Install and Configure Elasticsearch on Ubuntu ?

Elasticsearch is a Cross-platform search engine based on Apache’s Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. It is written in Java.

Prerequisites: Java Installation on Ubuntu

Step 1: First, update your system by using the following command:

$sudo apt install update

Updating Ubuntu System

Step 2: Download .deb file for elasticsearch.

$wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.1/elasticsearch-2.3.1.deb

downloading deb file for elasticsearch

Step 3: Use dpkg commond to install the .deb file.

$sudo dpkg -i elasticsearch-2.3.1.deb

dpkg command to install .deb file

Step 4: Enable elasticsearch service

$sudo systemctl enable elasticsearch.service

Enable elasticsearch service

Step 5: Setup network configuration for elasticsearch. Open file

$sudo nano /etc/elasticsearch/elasticsearch.yml

and set IP as localhost

...
network.host: 127.0.0.1
...

Setup network configuration for elasticsearch

Step 6: Now, restart service.

$sudo systemctl restart elasticsearch

Step 7: Using and Testing Elasticsearch

$curl -X GET 'http://localhost:9200'

Output of curl

{
  "name" : "Node-1",
  "cluster_name" : "mycluster1",
  "version" : {
    "number" : "2.3.1",
    "build_hash" : "bd980929010aef404e7cb0843e61d0665269fc39",
    "build_timestamp" : "2016-04-04T12:25:05Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.0"
  }
}
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS