Get Elasticsearch up and runningedit

To take Elasticsearch for a test drive, you can create a hosted deployment on the Elasticsearch Service or set up a multi-node Elasticsearch cluster on your own Linux, macOS, or Windows machine.

Run Elasticsearch on Elastic Cloudedit

When you create a deployment on the Elasticsearch Service, the service provisions a three-node Elasticsearch cluster along with Kibana and APM.

To create a deployment:

  1. Sign up for a free trial and verify your email address.
  2. Set a password for your account.
  3. Click Create Deployment.

Once you’ve created a deployment, you’re ready to Index some documents.

Run Elasticsearch locally on Linux, macOS, or Windowsedit

When you create a deployment on the Elasticsearch Service, a master node and two data nodes are provisioned automatically. By installing from the tar or zip archive, you can start multiple instances of Elasticsearch locally to see how a multi-node cluster behaves.

To run a three-node Elasticsearch cluster locally:

  1. Download the Elasticsearch archive for your OS:

    Linux: elasticsearch-7.5.2-linux-x86_64.tar.gz

    curl -L -O

    macOS: elasticsearch-7.5.2-darwin-x86_64.tar.gz

    curl -L -O


  2. Extract the archive:


    tar -xvf elasticsearch-7.5.2-linux-x86_64.tar.gz


    tar -xvf elasticsearch-7.5.2-darwin-x86_64.tar.gz

    Windows PowerShell:

  3. Start Elasticsearch from the bin directory:

    Linux and macOS:

    cd elasticsearch-7.5.2/bin


    cd elasticsearch-7.5.2\bin

    You now have a single-node Elasticsearch cluster up and running!

  4. Start two more instances of Elasticsearch so you can see how a typical multi-node cluster behaves. You need to specify unique data and log paths for each node.

    Linux and macOS:

    ./elasticsearch -Epath.logs=log2
    ./elasticsearch -Epath.logs=log3


    .\elasticsearch.bat -E -E path.logs=log2
    .\elasticsearch.bat -E -E path.logs=log3

    The additional nodes are assigned unique IDs. Because you’re running all three nodes locally, they automatically join the cluster with the first node.

  5. Use the cat health API to verify that your three-node cluster is up running. The cat APIs return information about your cluster and indices in a format that’s easier to read than raw JSON.

    You can interact directly with your cluster by submitting HTTP requests to the Elasticsearch REST API. If you have Kibana installed and running, you can also open Kibana and submit requests through the Dev Console.

    You’ll want to check out the Elasticsearch language clients when you’re ready to start using Elasticsearch in your own applications.

    GET /_cat/health?v

    The response should indicate that the status of the elasticsearch cluster is green and it has three nodes:

    epoch      timestamp cluster       status shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
    1565052807 00:53:27  elasticsearch green           3         3      6   3    0    0        0             0                  -                100.0%

    The cluster status will remain yellow if you are only running a single instance of Elasticsearch. A single node cluster is fully functional, but data cannot be replicated to another node to provide resiliency. Replica shards must be available for the cluster status to be green. If the cluster status is red, some data is unavailable.

Talking to Elasticsearch with cURL commandsedit

Most of the examples in this guide enable you to copy the appropriate cURL command and submit the request to your local Elasticsearch instance from the command line.

A request to Elasticsearch consists of the same parts as any HTTP request:


This example uses the following variables:

The appropriate HTTP method or verb. For example, GET, POST, PUT, HEAD, or DELETE.
Either http or https. Use the latter if you have an HTTPS proxy in front of Elasticsearch or you use Elasticsearch security features to encrypt HTTP communications.
The hostname of any node in your Elasticsearch cluster. Alternatively, use localhost for a node on your local machine.
The port running the Elasticsearch HTTP service, which defaults to 9200.
The API endpoint, which can contain multiple components, such as _cluster/stats or _nodes/stats/jvm.
Any optional query-string parameters. For example, ?pretty will pretty-print the JSON response to make it easier to read.
A JSON-encoded request body (if necessary).

If the Elasticsearch security features are enabled, you must also provide a valid user name (and password) that has authority to run the API. For example, use the -u or --u cURL command parameter. For details about which security privileges are required to run each API, see REST APIs.

Elasticsearch responds to each API request with an HTTP status code like 200 OK. With the exception of HEAD requests, it also returns a JSON-encoded response body.

Other installation optionsedit

Installing Elasticsearch from an archive file enables you to easily install and run multiple instances locally so you can try things out. To run a single instance, you can run Elasticsearch in a Docker container, install Elasticsearch using the DEB or RPM packages on Linux, install using Homebrew on macOS, or install using the MSI package installer on Windows. See Installing Elasticsearch for more information.