Elasticsearch is a open source search engine written in Java and based on Apache Lucene library. Elasticsearch is distributed search engine that supports full-text search with an HTTP web (REST) interface.
Run the following command to add the key to the list of trusted keys.
$ wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Add the Elasticsearch repository.
$ echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
Update the package lists.
$ sudo apt-get update
Run following command to install Elasticsearch using apt package manager.
$ sudo apt-get install elasticsearch