Skip to content

Instantly share code, notes, and snippets.

@gabriel-dehan
Created May 29, 2018 17:23
Show Gist options
  • Save gabriel-dehan/7bef42500699f901e9bf8d3a6b333ed6 to your computer and use it in GitHub Desktop.
Save gabriel-dehan/7bef42500699f901e9bf8d3a6b333ed6 to your computer and use it in GitHub Desktop.
Elasticsearch install ubuntu > 16.04

Elasticsearch - Ubuntu

Prerequisites

You will need to install Java if you don't already have it.

$ sudo apt-get update
$ sudo apt-get install default-jre
$ sudo apt-get install default-jdk
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java9-installer

Installation

Downloading and Installing Elasticsearch

Elasticsearch can be downloaded directly from elastic.co in zip, tar.gz, deb, or rpm packages. For Ubuntu, it's best to use the deb (Debian) package which will install everything you need to run Elasticsearch. Make sure your package list is up to date:

$ sudo apt-get update

Then download the latest elasticsearch package

$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.2.4.deb

Then install it in the usual Ubuntu way with dpkg.

$ sudo dpkg -i elasticsearch-6.2.4.deb

This results in Elasticsearch being installed in /usr/share/elasticsearch/ with its configuration files placed in /etc/elasticsearch and its init script added in /etc/init.d/elasticsearch. To make sure Elasticsearch starts and stops automatically with the server, add its init script to the default runlevels.

$ sudo systemctl enable elasticsearch.service

And you're done. You can check if the service is running by doing:

$ curl localhost:9200

or

$ service elasticsearch status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment