# How do I setup Elasticsearch for my store?

To set it up Elasticsearch we will create a Docker container by running the following command in our terminal:

```bash
docker run -d \
  -p 9200:9200 \
  -m 1GB \
  -e "discovery.type=single-node" \
  -e "xpack.security.enabled=false" \
  elasticsearch:8.17.4
```

- `-d` Enables detached mode, meaning the container will run in the background without blocking the terminal.
- `-p 9200:9200` Maps port `9200` on your local machine (host) to port `9200` inside the container.
- `-m 1GB` Limits the container's memory usage to 1 GiB (else it will reserve 50% of your Docker memory).
- `-e "discovery.type=single-node"` Sets the environment variable to configure Elasticsearch to run in `single-node` mode.
- `-e "xpack.security.enabled=false"` Disables X-Pack security, meaning no authentication is required for accessing Elasticsearch.

<p class="callout info">You can check for the latest version to install instead of `8.17.4` [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/es-release-notes.html).</p>

<p class="callout info">You can ensure Elasticsearch is running by visiting [http://localhost:9200](http://localhost:9200/).</p>