Install Elasticsearch on Linux or Mac OS X

Manual or Brew installation

Install JAVA

You need JAVA, start by installing/updating Java. If you plan to do development with Elasticsearch, get the JDK, otherwise, the JRE will be sufficient. Official downloads page.

Download JAVA

Install Elasticsearch with tar.gz

Follow this link and click on TAR

Elasticsearch download page

Unarchivate and run ES :

tar -xzvf elasticsearch-6.2.4.tar.gz
cd elasticsearch-6.2.4
bin/elasticsearch

Install with apt-get on Linux

Import the public key with (you should use sudo to do all these commands) and create a list file for Elasticsearch

wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -echo "deb http://packages.elastic.co/elasticsearch/1.5/debian stable main" | tee -a /etc/apt/sources.list.d/elk.list

Update apt-get and run the installation process

apt-get update
apt-get install -y elasticsearch

Install Elasticsearch with Homebrew on Mac OS X

First of all, install Homebrew. Mac os x users should be familiar with it (brew). Run this command in terminal :

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Homebrew main page

Now we can use brew command in terminal to install ES :

brew update
brew install elasticsearch

In this case to run ES enter the command :

elasticsearch

Check that ES work

by default, ES works on http://127.0.0.1:9200/ . So to check ES work without any errors run this command in terminal :

curl http://127.0.0.1:9200

You should see the default answer with version

curl 127.0.0.1:9200 response

Or simply open this address in your navigator :

127.0.0.1:9200 in navigator

Congratulations!

Now you can work with elasticsearch on your localhost! If you have any questions please feel free to contact me. I will be glad to answer.

By the way, you can take a look on the ElasticSearch Basics article.

LinkedIn, Twitter, Google+, lytvynov.anton@gmail.com, https://lytvynov-anton.com

Senior web developer, architect, cryptocurrencies trader, https://lytvynov-anton.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store