Install Elasticsearch on Debian/Ubuntu


Install Java:

apt-get update
apt-get install -y openjdk-8-jre openjdk-8-jre-headless

On older Debian releases you may only find openjdk-7-jre openjdk-7-jre-headless instead.

Add the repository and install Elasticsearch:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
apt-get install -y apt-transport-https software-properties-common
add-apt-repository "deb https://artifacts.elastic.co/packages/5.x/apt stable main"
apt-get update
apt-get install -y elasticsearch

On older Debian releases replace software-properties-common with python-software-properties

Edit /etc/default/elasticsearch and changeĀ ES_HEAP_SIZE to limit memory usage depending on your machine.

Start Elasticsearch: /etc/init.d/elasticsearch start

Configure Elasticsearch to automatically start during bootup:

update-rc.d elasticsearch defaults 95 10