# Installed Elasticsearch docker does not have a password

**URL:** <https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 18, 2021, 10:12am UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805 "2021-08-18T10:12:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![evo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evo/32/77073_2.png) [@evo](https://discuss.elastic.co/u/evo)\
**Post date:** [August 18, 2021, 10:12am UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/1 "2021-08-18T10:12:25Z")

</div>

I have just following the docker installation guide and have got ES up and running but anyone can add documents to it.

I am confused on how to secure it. Is the authentication only pre-configured in the paid version?

What are correct steps to add a simple password to the free version running in docker?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 18, 2021, 1:51pm UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/2 "2021-08-18T13:51:40Z")

</div>

Here is how I'm setting that with docker compose ( `docker-compose.yml`):

```auto
---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD
      - xpack.security.enabled=$ELASTIC_SECURITY
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks: ['stack']

  kibana:
    image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
    environment:
      - ELASTICSEARCH_USERNAME=elastic
      - ELASTICSEARCH_PASSWORD=$ELASTIC_PASSWORD
    ports: ['5601:5601']
    networks: ['stack']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']

networks:
  stack: {}

```

`.env` file is:

```auto
ELASTIC_VERSION=7.14.0
ELASTIC_SECURITY=true
ELASTIC_PASSWORD=changeme

```

It's a similar way for Docker. 😉

---

<div class="post-metadata">

**Author:** ![evo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evo/32/77073_2.png) [@evo](https://discuss.elastic.co/u/evo)\
**Post date:** [August 18, 2021, 10:03pm UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/3 "2021-08-18T22:03:37Z")

</div>

Thanks for the help. The docs are a little confusing around this topic

---

<div class="post-metadata">

**Author:** ![evo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evo/32/77073_2.png) [@evo](https://discuss.elastic.co/u/evo)\
**Post date:** [August 18, 2021, 11:03pm UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/4 "2021-08-18T23:03:16Z")

</div>

Does this work with version 5.6? I realised i needed older version to work with mongo connector and this doesn't seem to be setting the password for tag 5.6.16.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 19, 2021, 3:02am UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/5 "2021-08-19T03:02:28Z")

</div>

Maybe with a commercial license? I'm not sure.

But you should not be using any 5.x version anymore and upgrade to the latest 6.8 at the very least or better install 7.14.0.

And anyway, we are not providing anymore commercial licenses for 5.x versions as they are not supported.

---

<div class="post-metadata">

**Author:** ![evo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/evo/32/77073_2.png) [@evo](https://discuss.elastic.co/u/evo)\
**Post date:** [August 19, 2021, 9:33am UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/6 "2021-08-19T09:33:43Z")

</div>

I have a mongodb that is around 1TB in size and I want to use elastic search to create an index for it but all the guides I have found refer to connectors that don't work with recent versions.

Do you have any advice?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 14, 2021, 2:10pm UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/7 "2021-09-14T14:10:55Z")

</div>

You need to send your existing data to elasticsearch.  
That means:

- Read from the database (`SELECT * from TABLE`)
- Convert each record to a JSON Document
- Send the json document to elasticsearch, preferably using the `_bulk` API.

Logstash can help for that (have a look at [MongoDB Logstash Integration [Solved]](https://discuss.elastic.co/t/mongodb-logstash-integration-solved/122299)). But I'd recommend modifying the application layer if possible and send data to elasticsearch in the same "transaction" as you are sending your data to the database.

I shared most of my thoughts there: [Advanced Search for Your Legacy Application - -Xmx128gb -Xms128gb](http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/)

Have also a look at this ["live coding" recording](https://www.elastic.co/fr/blog/how-to-add-powerful-search-existing-sql-applications-elasticsearch-video-tutorial).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 12, 2021, 2:11pm UTC](https://discuss.elastic.co/t/installed-elasticsearch-docker-does-not-have-a-password/281805/8 "2021-10-12T14:11:29Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
