# Unable to set password for elastic (7.1.1)

**URL:** <https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [June 17, 2019, 10:07pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160 "2019-06-17T22:07:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryh](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryh](https://discuss.elastic.co/u/ryh)\
**Post date:** [June 17, 2019, 10:07pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/1 "2019-06-17T22:07:26Z")

</div>

Hi All,

I'm trying to set a default password for the elastic user through Docker. But my ELASTIC\_PASSWORD key isn't working. Here's my docker-compose file.

```auto
version: '3'
services:
  elasticsearch:
    hostname: elasticsearch
    image: newstack/elasticsearch:latest
    build:
      context: elasticsearch
      dockerfile: Dockerfile
    environment:
      - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
      - ELASTIC_PASSWORD=changeme
    ports:
      - 9200:9200
      - 9300:9300

```

Here's my config yml file

```auto
cluster.name: elasticsearch-master
node.name: elasticsearch-node
network.host: 0.0.0.0

# minimum_master_nodes need to be explicitly set when bound on a public IP
# set to 1 to allow single node clusters
# Details: https://github.com/elastic/elasticsearch/pull/17288
# discovery.zen.minimum_master_nodes: 1
#cluster.initial_master_nodes:
  #- elasticsearch-node

discovery.type: single-node
bootstrap.memory_lock: true
xpack.security.enabled: true

```

Any ideas?

Thanks in advance,  
Ry

---

<div class="post-metadata">

**Author:** ![ryh](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryh](https://discuss.elastic.co/u/ryh)\
**Post date:** [June 17, 2019, 10:07pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/2 "2019-06-17T22:07:57Z")

</div>

Also, is there an easier way of creating a set of users with passwords?

---

<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:** [June 20, 2019, 12:55pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/3 "2019-06-20T12:55:30Z")

</div>

Here is what I'm using:

`.env` file:

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

```

`docker-compose.yml` file:

```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: {}

```

---

<div class="post-metadata">

**Author:** ![ryh](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryh](https://discuss.elastic.co/u/ryh)\
**Post date:** [June 20, 2019, 4:11pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/4 "2019-06-20T16:11:29Z")

</div>

Are you using the basic license?

I'll try this out and replay back in a few.

Thanks,  
Ry

---

<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:** [June 20, 2019, 5:02pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/5 "2019-06-20T17:02:30Z")

</div>

There is no data dir when I start. So yes it's a basic license.

---

<div class="post-metadata">

**Author:** ![ryh](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryh](https://discuss.elastic.co/u/ryh)\
**Post date:** [June 20, 2019, 6:22pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/6 "2019-06-20T18:22:45Z")

</div>

Works!

Thank you so much!

---

<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:** [July 18, 2019, 6:22pm UTC](https://discuss.elastic.co/t/unable-to-set-password-for-elastic-7-1-1/186160/7 "2019-07-18T18:22:53Z")

</div>

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