# What is the correct way to start up elasticsearch & kibana and connect them under docker swarm

**URL:** <https://discuss.elastic.co/t/what-is-the-correct-way-to-start-up-elasticsearch-kibana-and-connect-them-under-docker-swarm/302551>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 16, 2022, 10:57am UTC](https://discuss.elastic.co/t/what-is-the-correct-way-to-start-up-elasticsearch-kibana-and-connect-them-under-docker-swarm/302551 "2022-04-16T10:57:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![UchihaYuki](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/uchihayuki/32/104442_2.png) [@UchihaYuki](https://discuss.elastic.co/u/UchihaYuki)\
**Post date:** [April 16, 2022, 10:57am UTC](https://discuss.elastic.co/t/what-is-the-correct-way-to-start-up-elasticsearch-kibana-and-connect-them-under-docker-swarm/302551/1 "2022-04-16T10:57:48Z")

</div>

I will post most relevant info from my docker-compose.yml. Please look at the following:

```auto
services:
  es-1:
    hostname: es-1
    environment:
      - ELASTIC_PASSWORD=${ADMIN_PASSWORD}
      - node.name=es-1
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es-2,es-3
      - cluster.initial_master_nodes=es-1,es-2,es-3
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - xpack.security.enabled=false
   es-2: ...
   es-3: ...

  kibana:
    image: docker.elastic.co/kibana/kibana:8.1.2
    environment:      
      - ELASTICSEARCH_USERNAME=elastic
      - ELASTICSEARCH_PASSWORD=${ADMIN_PASSWORD}
      - ELASTICSEARCH_HOSTS=["http://es-1:9200","http://es-2:9200","http://es-3:9200"]

```

The problem is the super user elastic is not allowed in kibana. Is there any other build-in user I can use to make a quick connection between elastic and kibana?

By the way, all of my services run behind a reverse proxy service (traefik).

I'm new to this, just try to make it work and see what I can get out of it.

Thank you.

Edit:  
My workaround is to change the password of build-in user kibana\_system after Elasticsearch started, then use that user to initialize kibana. But I hope I can set the password of kibana\_system in environment variable somehow.

---

<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:** [May 14, 2022, 10:57am UTC](https://discuss.elastic.co/t/what-is-the-correct-way-to-start-up-elasticsearch-kibana-and-connect-them-under-docker-swarm/302551/2 "2022-05-14T10:57:59Z")

</div>

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