Install Elasticsearch from archive on Linux or MacOS

Elasticsearch is as a .tar.gz archive for Linux and MacOS.

This package is free to use under the Elastic license. It contains open source and free commercial features and access to paid commercial features. Start a 30-day trial to try out all of the paid commercial features. See the Subscriptions page for information about Elastic license levels.

The latest stable version of Elasticsearch can be found on the Download Elasticsearch page. Other versions can be found on the Past Releases page.

Elasticsearch includes a bundled version of OpenJDK from the JDK maintainers (GPLv2+CE). To use your own version of Java, see the JVM version requirements

Download and install archive for Linux

The Linux archive for Elasticsearch v7.9.1 can be downloaded and installed as follows:

  1. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.1-linux-x86_64.tar.gz
  2. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.1-linux-x86_64.tar.gz.sha512
  3. shasum -a 512 -c elasticsearch-7.9.1-linux-x86_64.tar.gz.sha512
  4. tar -xzf elasticsearch-7.9.1-linux-x86_64.tar.gz
  5. cd elasticsearch-7.9.1/

Compares the SHA of the downloaded .tar.gz archive and the published checksum, which should output elasticsearch-{version}-linux-x86_64.tar.gz: OK.

This directory is known as $ES_HOME.

Alternatively, you can download the following package, which includes only Apache 2.0 licensed code: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.9.1-linux-x86_64.tar.gz

Download and install archive for MacOS

The MacOS archive for Elasticsearch v7.9.1 can be downloaded and installed as follows:

  1. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.1-darwin-x86_64.tar.gz
  2. wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.1-darwin-x86_64.tar.gz.sha512
  3. shasum -a 512 -c elasticsearch-7.9.1-darwin-x86_64.tar.gz.sha512
  4. tar -xzf elasticsearch-7.9.1-darwin-x86_64.tar.gz
  5. cd elasticsearch-7.9.1/

Compares the SHA of the downloaded .tar.gz archive and the published checksum, which should output elasticsearch-{version}-darwin-x86_64.tar.gz: OK.

This directory is known as $ES_HOME.

Alternatively, you can download the following package, which includes only Apache 2.0 licensed code: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.9.1-darwin-x86_64.tar.gz

Enable automatic creation of system indices

Some commercial features automatically create indices within Elasticsearch. By default, Elasticsearch is configured to allow automatic index creation, and no additional steps are required. However, if you have disabled automatic index creation in Elasticsearch, you must configure action.auto_create_index in elasticsearch.yml to allow the commercial features to create the following indices:

  1. action.auto_create_index: .monitoring*,.watches,.triggered_watches,.watcher-history*,.ml*

If you are using Logstash or Beats then you will most likely require additional index names in your action.auto_create_index setting, and the exact value will depend on your local configuration. If you are unsure of the correct value for your environment, you may consider setting the value to * which will allow automatic creation of all indices.

Running Elasticsearch from the command line

Elasticsearch can be started from the command line as follows:

  1. ./bin/elasticsearch

If you have password-protected the Elasticsearch keystore, you will be prompted to enter the keystore’s password. See Secure settings for more details.

By default, Elasticsearch runs in the foreground, prints its logs to the standard output (stdout), and can be stopped by pressing Ctrl-C.

All scripts packaged with Elasticsearch require a version of Bash that supports arrays and assume that Bash is available at /bin/bash. As such, Bash should be available at this path either directly or via a symbolic link.

Checking that Elasticsearch is running

You can test that your Elasticsearch node is running by sending an HTTP request to port 9200 on localhost:

  1. GET /

which should give you a response something like this:

  1. {
  2. "name" : "Cp8oag6",
  3. "cluster_name" : "elasticsearch",
  4. "cluster_uuid" : "AT69_T_DTp-1qgIJlatQqA",
  5. "version" : {
  6. "number" : "7.9.1",
  7. "build_flavor" : "default",
  8. "build_type" : "tar",
  9. "build_hash" : "f27399d",
  10. "build_date" : "2016-03-30T09:51:41.449Z",
  11. "build_snapshot" : false,
  12. "lucene_version" : "8.6.2",
  13. "minimum_wire_compatibility_version" : "1.2.3",
  14. "minimum_index_compatibility_version" : "1.2.3"
  15. },
  16. "tagline" : "You Know, for Search"
  17. }

Log printing to stdout can be disabled using the -q or --quiet option on the command line.

Running as a daemon

To run Elasticsearch as a daemon, specify -d on the command line, and record the process ID in a file using the -p option:

  1. ./bin/elasticsearch -d -p pid

If you have password-protected the Elasticsearch keystore, you will be prompted to enter the keystore’s password. See Secure settings for more details.

Log messages can be found in the $ES_HOME/logs/ directory.

To shut down Elasticsearch, kill the process ID recorded in the pid file:

  1. pkill -F pid

The startup scripts provided in the RPM and Debian packages take care of starting and stopping the Elasticsearch process for you.

Configuring Elasticsearch on the command line

Elasticsearch loads its configuration from the $ES_HOME/config/elasticsearch.yml file by default. The format of this config file is explained in Configuring Elasticsearch.

Any settings that can be specified in the config file can also be specified on the command line, using the -E syntax as follows:

  1. ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1

Typically, any cluster-wide settings (like cluster.name) should be added to the elasticsearch.yml config file, while any node-specific settings such as node.name could be specified on the command line.

Directory layout of archives

The archive distributions are entirely self-contained. All files and directories are, by default, contained within $ES_HOME — the directory created when unpacking the archive.

This is very convenient because you don’t have to create any directories to start using Elasticsearch, and uninstalling Elasticsearch is as easy as removing the $ES_HOME directory. However, it is advisable to change the default locations of the config directory, the data directory, and the logs directory so that you do not delete important data later on.

TypeDescriptionDefault LocationSetting

home

Elasticsearch home directory or $ES_HOME

Directory created by unpacking the archive

bin

Binary scripts including elasticsearch to start a node and elasticsearch-plugin to install plugins

$ES_HOME/bin

conf

Configuration files including elasticsearch.yml

$ES_HOME/config

ES_PATH_CONF

data

The location of the data files of each index / shard allocated on the node. Can hold multiple locations.

$ES_HOME/data

path.data

logs

Log files location.

$ES_HOME/logs

path.logs

plugins

Plugin files location. Each plugin will be contained in a subdirectory.

$ES_HOME/plugins

repo

Shared file system repository locations. Can hold multiple locations. A file system repository can be placed in to any subdirectory of any directory specified here.

Not configured

path.repo

Next steps

You now have a test Elasticsearch environment set up. Before you start serious development or go into production with Elasticsearch, you must do some additional setup: