Run Elasticsearch and Kibana on your local machine using a simple shell script. This setup uses Docker behind the scenes to install and run the services.
Important
This script is for local testing only. Do not use it in production! For production installations refer to the official documentation for Elasticsearch and Kibana.
This script comes with a one-month trial license. After the trial period, the license reverts to Free and open - Basic.
- Trial: Includes All features like the Playground, ELSER, semantic retrieval model, the Elastic Inference API and much more.
- Free and open - Basic: Includes features like vector search, ES|QL and much more.
For a complete list of subscriptions and features, see our subscriptions page.
- 5 GB of available disk space
- Docker
- Works on Linux and macOS
- On Microsoft Windows it works using Windows Subsystem for Linux (WSL)
Run the start-local script using curl:
curl -fsSL https://elastic.co/start-local | shThis script creates an elastic-start-local folder containing:
docker-compose.yml: Docker Compose configuration for Elasticsearch and Kibana.env: Environment settings, including the Elasticsearch passwordstart.shandstop.sh: Scripts to start and stop Elasticsearch and Kibanauninstall.sh: The script to uninstall Elasticsearch and Kibana
By default, start-local uses the latest stable version of Elastic Stack. If you want, you can specify
a different version using the -v parameter, as follows:
curl -fsSL https://elastic.co/start-local | sh -s -- -v 8.16.0The previous command installs Elasticsearch and Kibana 8.16.0.
Using the -v parameter, you can also install beta releases, this can be useful for testing an
upcoming release. For instance, you can install the 9.0.0-beta1 using the following
command:
curl -fsSL https://elastic.co/start-local | sh -s -- -v 9.0.0-beta1The 9.0.0-beta1 version was released on February 18, 2025.
If you want to install only Elasticsearch, without Kibana, you can use the --esonly option
as follows:
curl -fsSL https://elastic.co/start-local | sh -s -- --esonlyThis command can be useful if you don't have enough resources and want to test only Elasticsearch.
You can install the EDOT Collector
using the --edot option, as follows:
curl -fsSL https://elastic.co/start-local | sh -s -- --edotThis command will install the latest Elasticsearch, Kibana and EDOT collector.
Here you can find more information about Elastic Distributions of OpenTelemetry (EDOT).
After running the script:
- Elasticsearch will be running at http://localhost:9200
- Kibana will be running at http://localhost:5601
The script generates a random password for the elastic user, displayed at the end of the installation and stored in the .env file.
Caution
HTTPS is disabled, and Basic authentication is used for Elasticsearch. This configuration is for local testing only. For security, Elasticsearch and Kibana are accessible only via localhost.
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 the Elastic SDK or REST API.
Check the connection to Elasticsearch using curl in the elastic-start-local folder:
source .env
curl $ES_LOCAL_URL -H "Authorization: ApiKey ${ES_LOCAL_API_KEY}"You can use the start and stop commands available in the elastic-start-local folder.
To stop the Elasticsearch and Kibana Docker services, use the stop command:
cd elastic-start-local
./stop.shTo start the Elasticsearch and Kibana Docker services, use the start command:
cd elastic-start-local
./start.shTo remove the start-local installation:
cd elastic-start-local
./uninstall.shWarning
This erases all data permanently.
If the installation fails, an error log is created in error-start-local.log. This file contains logs from Elasticsearch and Kibana, captured using the docker logs command.
To change settings (e.g., Elasticsearch password), edit the .env file. Example contents:
ES_LOCAL_VERSION=8.15.2
ES_LOCAL_URL=http://localhost:9200
ES_LOCAL_CONTAINER_NAME=es-local-dev
ES_LOCAL_DOCKER_NETWORK=elastic-net
ES_LOCAL_PASSWORD=hOalVFrN
ES_LOCAL_PORT=9200
KIBANA_LOCAL_CONTAINER_NAME=kibana-local-dev
KIBANA_LOCAL_PORT=5601
KIBANA_LOCAL_PASSWORD=YJFbhLJL
ES_LOCAL_API_KEY=df34grtk...==Important
After changing the .env file, restart the services using stop and start:
cd elastic-start-local
./stop.sh
./start.shWe offer some environment (ENV) variables for changing the settings of start-local.
We suggest to use these ENV variables only for advanced use cases, e.g. CI/CD integrations.
Please use caution when using these settings.
If you need to set the Elasticsearch password manually, you can do it using the ES_LOCAL_PASSWORD.
You need to set the env variable before the execution of the script, as follows:
curl -fsSL https://elastic.co/start-local | ES_LOCAL_PASSWORD="supersecret" shThis command will set the supersecret password for Elasticsearch.
Please note that this command can be dangerous if you use a weak password for Elasticsearch authentication.
By default, start-local creates an elastic-start-local folder. If you need to change it, you can use
the ES_LOCAL_DIR env variable, as follows:
curl -fsSL https://elastic.co/start-local | ES_LOCAL_DIR="another-folder" shThis command will creates the another-folder containing all the start-local files.
We use bashunit to test the script. Tests are in the /tests folder.
-
Install bashunit:
curl -s https://bashunit.typeddevs.com/install.sh | bash -
Run tests:
lib/bashunit
The tests run start-local.sh and check if Elasticsearch and Kibana are working.
Note
For URL pipeline testing, a local web server is required. We used the Python http.server.