# Create user in elasticsearch

**URL:** <https://discuss.elastic.co/t/create-user-in-elasticsearch/182401>\
**Category:** Elasticsearch\
**Created:** [May 23, 2019, 10:33am UTC](https://discuss.elastic.co/t/create-user-in-elasticsearch/182401 "2019-05-23T10:33:33Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [May 23, 2019, 12:49pm UTC](https://discuss.elastic.co/t/create-user-in-elasticsearch/182401/2 "2019-05-23T12:49:05Z")

</div>

Here is 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
      - cluster.name=elasticsearch
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - cluster.routing.allocation.disk.threshold_enabled=false
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD
      - xpack.security.enabled=$ELASTIC_SECURITY
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
      - 9300:9300
    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.1.0
ELASTIC_SECURITY=true
ELASTIC_PASSWORD=changeme

```

And if the context of integration tests with Maven:

> <https://github.com/dadoonet/fscrawler/blob/c6fbca653db7dbcfa344f7de180e6c9f8bda6599/integration-tests/it-v7/pom.xml#L169-L201>

HTH

---

_[View the full topic](https://discuss.elastic.co/t/create-user-in-elasticsearch/182401)._
