[[zip-targz]] === Install Elasticsearch with `.zip` or `.tar.gz` Elasticsearch is provided as a `.zip` and as a `.tar.gz` package. These packages can be used to install Elasticsearch on any system and are the easiest package format to use when trying out Elasticsearch. include::license.asciidoc[] The latest stable version of Elasticsearch can be found on the link:/downloads/elasticsearch[Download Elasticsearch] page. Other versions can be found on the link:/downloads/past-releases[Past Releases page]. NOTE: Elasticsearch requires Java 8 or later. Use the http://www.oracle.com/technetwork/java/javase/downloads/index.html[official Oracle distribution] or an open-source distribution such as http://openjdk.java.net[OpenJDK]. [[install-zip]] ==== Download and install the `.zip` package ifeval::["{release-state}"=="unreleased"] Version {version} of Elasticsearch has not yet been released. endif::[] ifeval::["{release-state}"!="unreleased"] The `.zip` archive for Elasticsearch v{version} can be downloaded and installed as follows: ["source","sh",subs="attributes"] -------------------------------------------- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip.sha512 shasum -a 512 -c elasticsearch-{version}.zip.sha512 <1> unzip elasticsearch-{version}.zip cd elasticsearch-{version}/ <2> -------------------------------------------- <1> Compares the SHA of the downloaded `.zip` archive and the published checksum, which should output `elasticsearch-{version}.zip: OK`. <2> This directory is known as `$ES_HOME`. Alternatively, you can download the following package, which contains only features that are available under the Apache 2.0 license: https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-{version}.zip endif::[] [[install-targz]] ==== Download and install the `.tar.gz` package ifeval::["{release-state}"=="unreleased"] Version {version} of Elasticsearch has not yet been released. endif::[] ifeval::["{release-state}"!="unreleased"] The `.tar.gz` archive for Elasticsearch v{version} can be downloaded and installed as follows: ["source","sh",subs="attributes"] -------------------------------------------- wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.tar.gz wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.tar.gz.sha512 shasum -a 512 -c elasticsearch-{version}.tar.gz.sha512 <1> tar -xzf elasticsearch-{version}.tar.gz cd elasticsearch-{version}/ <2> -------------------------------------------- <1> Compares the SHA of the downloaded `.tar.gz` archive and the published checksum, which should output `elasticsearch-{version}.tar.gz: OK`. <2> 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-{version}.tar.gz endif::[] ifdef::include-xpack[] [[zip-targz-enable-indices]] ==== Enable automatic creation of {xpack} indices {xpack} will try to automatically create a number of indices within {es}. include::xpack-indices.asciidoc[] endif::include-xpack[] [[zip-targz-running]] ==== Running Elasticsearch from the command line Elasticsearch can be started from the command line as follows: [source,sh] -------------------------------------------- ./bin/elasticsearch -------------------------------------------- By default, Elasticsearch runs in the foreground, prints its logs to the standard output (`stdout`), and can be stopped by pressing `Ctrl-C`. NOTE: 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. include::check-running.asciidoc[] Log printing to `stdout` can be disabled using the `-q` or `--quiet` option on the command line. [[setup-installation-daemon]] ==== 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: [source,sh] -------------------------------------------- ./bin/elasticsearch -d -p pid -------------------------------------------- Log messages can be found in the `$ES_HOME/logs/` directory. To shut down Elasticsearch, kill the process ID recorded in the `pid` file: [source,sh] -------------------------------------------- kill `cat pid` -------------------------------------------- NOTE: The startup scripts provided in the <> and <> packages take care of starting and stopping the Elasticsearch process for you. [[zip-targz-configuring]] ==== 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 <>. Any settings that can be specified in the config file can also be specified on the command line, using the `-E` syntax as follows: [source,sh] -------------------------------------------- ./bin/elasticsearch -d -Ecluster.name=my_cluster -Enode.name=node_1 -------------------------------------------- TIP: 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. [[zip-targz-layout]] ==== Directory layout of `.zip` and `.tar.gz` archives The `.zip` and `.tar.gz` packages 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. [cols="> | 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. d| Not configured | path.repo | script | Location of script files. | $ES_HOME/scripts | path.scripts |======================================================================= include::next-steps.asciidoc[]