# ELK 791 Docker compose and security

**URL:** <https://discuss.elastic.co/t/elk-791-docker-compose-and-security/258821>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, docker\
**Created:** [December 16, 2020, 8:43am UTC](https://discuss.elastic.co/t/elk-791-docker-compose-and-security/258821 "2020-12-16T08:43:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vincent2mots](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent2mots/32/55226_2.png) [@vincent2mots](https://discuss.elastic.co/u/vincent2mots)\
**Post date:** [December 16, 2020, 8:43am UTC](https://discuss.elastic.co/t/elk-791-docker-compose-and-security/258821/1 "2020-12-16T08:43:36Z")

</div>

Hi there! I would like to test the security functionnalities within a docker-compose stack.

Here is my stack :

```
version: '2'
services:
  # Noeud nodeB1
  nodeToutSeul:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
    container_name: nodeToutSeul
    environment:
      - node.name=nodeToutSeul
      - cluster.name=cluster_securite
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms1024m -Xmx2048m"
      - network.bind_host=0.0.0.0
      - xpack.security.enabled=true
      - xpack.license.self_generated.type=trial
    ports:
      - 9200:9200
    networks:
      - esnet
    volumes:
      - nodeToutSeul:/usr/share/nodeToutSeul/data 

  # Kibana  
  kibana_secu:
    image: docker.elastic.co/kibana/kibana:7.9.1
    container_name: kibana_secu
    environment:      
      SERVER_NAME: kibana_secu
      ELASTIC_USER: elastic
      ELASTIC_PASSWORD: "giMiG6FAB7ZGr0dliEzO"
      ELASTICSEARCH_HOSTS: '["http://nodeToutSeul:9200"]'
      xpack.monitoring.enabled: "false"
    ports:
     - 5601:5601
    networks:
      - esnet
      
# Définition des volumes   
volumes:
  nodeToutSeul:
    driver: local

# Définition du réseau entre les noeuds
networks:
  esnet:

```

I used the command **bin/elasticsearch-setup-password** auto to generate the passwords and I can access to the elasticsearch url (using port 9200)

However, my Kibana doesn't want to start... and I think I made a mistake into my docker-compose file...

Could you please help me?

Best regards

---

<div class="post-metadata">

**Author:** ![vincent2mots](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent2mots/32/55226_2.png) [@vincent2mots](https://discuss.elastic.co/u/vincent2mots)\
**Post date:** [December 16, 2020, 12:57pm UTC](https://discuss.elastic.co/t/elk-791-docker-compose-and-security/258821/2 "2020-12-16T12:57:37Z")

</div>

I finnaly found a solution using the volume to mount a kibana.yml :

```
version: '2'
services:
  # Noeud nodeB1
  nodeToutSeul:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.9.1
    container_name: nodeToutSeul
    environment:
      - node.name=nodeToutSeul
      - cluster.name=cluster_securite
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms1024m -Xmx2048m"
      - network.bind_host=0.0.0.0
      - xpack.security.enabled=true
      - xpack.license.self_generated.type=trial
    ports:
      - 9200:9200
    networks:
      - esnet
    volumes:
      - nodeToutSeul:/usr/share/nodeToutSeul/data 

  # Kibana  
  kibana_secu:
    image: docker.elastic.co/kibana/kibana:7.9.1
    volumes:
     - /root/kibana.yml:/usr/share/kibana/config/kibana.yml
    container_name: kibana_secu
    ports:
     - 5601:5601
    networks:
      - esnet
      
# Définition des volumes   
volumes:
  nodeToutSeul:
    driver: local

# Définition du réseau entre les noeuds
networks:
  esnet:
```

---

<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:** [January 13, 2021, 12:57pm UTC](https://discuss.elastic.co/t/elk-791-docker-compose-and-security/258821/3 "2021-01-13T12:57:43Z")

</div>

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