Run Elasticsearch locally

edit

DO NOT USE THESE INSTRUCTIONS FOR PRODUCTION DEPLOYMENTS

The instructions on this page are for local development only. Do not use this configuration for production deployments, because it is not secure. Refer to deployment options for a list of production deployment options.

Quickly set up Elasticsearch and Kibana in Docker for local development or testing, using the start-local script.

This setup comes with a one-month trial of the Elastic Platinum license. After the trial period, the license reverts to Free and open - Basic. Refer to Elastic subscriptions for more information.

Prerequisites

edit

Run start-local

edit

To set up Elasticsearch and Kibana locally, run the start-local script:

curl -fsSL https://elastic.co/start-local | sh

This script creates an elastic-start-local folder containing configuration files and starts both Elasticsearch and Kibana using Docker.

After running the script, you can access Elastic services at the following endpoints:

The script generates a random password for the elastic user, which is displayed at the end of the installation and stored in the .env file.

This setup is for local testing only. HTTPS is disabled, and Basic authentication is used for Elasticsearch. For security, Elasticsearch and Kibana are accessible only through localhost.

API access

edit

An API key for Elasticsearch is generated and stored in the .env file as ES_LOCAL_API_KEY. Use this key to connect to Elasticsearch with a programming language client or the REST API.

From the elastic-start-local folder, check the connection to Elasticsearch using curl:

source .env
curl $ES_LOCAL_URL -H "Authorization: ApiKey ${ES_LOCAL_API_KEY}"

Learn more

edit

For more detailed information about the start-local setup, refer to the README on GitHub. Learn about customizing the setup, logging, and more.

Next steps

edit

Use our quick start guides to learn the basics of Elasticsearch.