//// 
IMPORTANT: This content is replicated in the Elasticsearch repo root readme. Ensure both files are in sync.

https://github.com/elastic/start-local is the source of truth.        
//// 

[[run-elasticsearch-locally]]
== Run {es} locally
++++
<titleabbrev>Run {es} locally</titleabbrev>
++++

[WARNING]
====
*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 <<elasticsearch-intro-deploy, deployment options>> for a list of production deployment options.
====

Quickly set up {es} and {kib} in Docker for local development or testing, using the https://github.com/elastic/start-local?tab=readme-ov-file#-try-elasticsearch-and-kibana-locally[`start-local` script].

This setup comes with a one-month trial license that includes all Elastic features.
After the trial period, the license reverts to *Free and open - Basic*.
Refer to https://www.elastic.co/subscriptions[Elastic subscriptions] for more information.

[discrete]
[[local-dev-prerequisites]]
=== Prerequisites

- If you don't have Docker installed, https://www.docker.com/products/docker-desktop[download and install Docker Desktop] for your operating system.
- If you're using Microsoft Windows, then install https://learn.microsoft.com/en-us/windows/wsl/install[Windows Subsystem for Linux (WSL)].

[discrete]
[[local-dev-quick-start]]
=== Run `start-local`

To set up {es} and {kib} locally, run the `start-local` script:

[source,sh]
----
curl -fsSL https://elastic.co/start-local | sh
----
// NOTCONSOLE

This script creates an `elastic-start-local` folder containing configuration files and starts both {es} and {kib} using Docker.

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

* *{es}*: http://localhost:9200
* *{kib}*: http://localhost:5601

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.

[CAUTION]
====
This setup is for local testing only. HTTPS is disabled, and Basic authentication is used for {es}. For security, {es} and {kib} are accessible only through `localhost`.
====

[discrete]
[[api-access]]
=== API access

An API key for {es} is generated and stored in the `.env` file as `ES_LOCAL_API_KEY`.
Use this key to connect to {es} with a https://www.elastic.co/guide/en/elasticsearch/client/index.html[programming language client] or the <<rest-apis,REST API>>.

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

[source,sh]
----     
source .env
curl $ES_LOCAL_URL -H "Authorization: ApiKey ${ES_LOCAL_API_KEY}"
----
// NOTCONSOLE

[discrete]
[[local-dev-additional-info]]
=== Learn more

For more detailed information about the `start-local` setup, refer to the https://github.com/elastic/start-local[README on GitHub].
Learn about customizing the setup, logging, and more.

[discrete]
[[local-dev-next-steps]]
=== Next steps

Use our <<quickstart,quick start guides>> to learn the basics of {es}.
