DEV Community

Cover image for How to install Elasticsearch 5.6 and other such older versions
Srinath
Srinath

Posted on • Edited on

How to install Elasticsearch 5.6 and other such older versions

Elasticsearch 5.6 is now EOL.

Which begs the question why I'm writing this blogpost. Not all software runs on the bleeding edge of it's dependencies. People have to run and maintain legacy products. It's better not to use dependencies which are EOL because you're missing out on security and performance updates.

I had to install Elasticsearch 5.6 and it took me a while to install it since the oldest version of Elasticsearch which Homebrew(I use a mac) carries is 6. This blogpost is for the next person who runs into a similar issue.

So yes we're going to manually install Elasticsearch and it's dependencies.

Steps to install Elasticsearch

  • Install Java
  • Get Elasticsearch
  • Configure path in your shell
  • Run Elasticsearch

Install Java

  • Java8 works just fine with Elasticsearch 5.6.
  • So we'll go ahead and install that
    • brew install openjdk@8
    • This blogpost covers Java installation pretty in-depth, feel free to refer it.

Get Elasticsearch

  • Download Elasticsearch from the official site.
  • Extract elasticsearch from the zip and keep it in a folder and track the folder.

Configure the environment variables as shown:

export ES_HOME=~/bin/elasticsearch-5.6.16
export JAVA_HOME=/usr/local/opt/openjdk@8/libexec/openjdk.jdk/Contents/Home
export PATH=$ES_HOME/bin:$JAVA_HOME/bin:$PATH
Enter fullscreen mode Exit fullscreen mode
  • Once the environment variables are configured refresh the shell.

Run Elasticsearch

elasticsearch
Enter fullscreen mode Exit fullscreen mode

Blogposts referred:

Photo by Markus Winkler on Unsplash

Top comments (0)