# Kibana multiple hosts in Docker Compose

**URL:** https://discuss.elastic.co/t/kibana-multiple-hosts-in-docker-compose/234403
**Category:** Kibana
**Tags:** docker
**Created:** [May 26, 2020, 7:29pm UTC](https://discuss.elastic.co/t/kibana-multiple-hosts-in-docker-compose/234403 "2020-05-26T19:29:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![grantcurell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grantcurell/32/23813_2.png) [@grantcurell](https://discuss.elastic.co/u/grantcurell)
#### Post date: [May 26, 2020, 7:29pm UTC](https://discuss.elastic.co/t/kibana-multiple-hosts-in-docker-compose/234403/1 "2020-05-26T19:29:13Z")

</div>

I saw other threads on this, but they closed without resolution. I have a post on StackOverflow and it's entirely possible I'm missing something obvious, but I haven't been able to get multiple hosts to work with docker compose.

> <https://stackoverflow.com/questions/62010914/what-is-the-syntax-for-elasticsearch-hosts-in-docker-compose>

List of failures:

```auto
  ELASTICSEARCH_HOSTS: ['http://es01:9200','http://es02:9200','http://es03:9200','http://es04:9200']
  ELASTICSEARCH_HOSTS="['http://es01:9200','http://es02:9200','http://es03:9200','http://es04:9200']"
  - ELASTICSEARCH_HOSTS=['http://es01:9200','http://es02:9200','http://es03:9200','http://es04:9200']
  - ELASTICSEARCH_HOSTS="["http://es01:9200","http://es02:9200","http://es03:9200","http://es04:9200"]"
  ELASTICSEARCH_HOSTS:
    - "<host1>"
    - "<host2>"

```

What is the syntax for multiple hosts? Given the confusion surrounding this problem, suggest updating the docs [here](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html) with the syntax.

---

<div class="post-metadata">

### Author: ![grantcurell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grantcurell/32/23813_2.png) [@grantcurell](https://discuss.elastic.co/u/grantcurell)
#### Post date: [May 26, 2020, 7:34pm UTC](https://discuss.elastic.co/t/kibana-multiple-hosts-in-docker-compose/234403/2 "2020-05-26T19:34:49Z")

</div>

I just got an answer on SO.

`ELASTICSEARCH_HOSTS: '["http://es01:9200","http://es02:9200","http://es03:9200","http://es04:9200"]'`

That's the magic syntax.

---

<div class="post-metadata">

### Author: ![myasonik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/myasonik/32/62369_2.png) [@myasonik](https://discuss.elastic.co/u/myasonik)
#### Post date: [May 26, 2020, 8:19pm UTC](https://discuss.elastic.co/t/kibana-multiple-hosts-in-docker-compose/234403/3 "2020-05-26T20:19:15Z")

</div>

Glad you got the answer you were looking for!

I opened up an issue in Kibana for us to improve our docs ([#67407](https://github.com/elastic/kibana/issues/67407)).

---

<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: [June 23, 2020, 8:19pm UTC](https://discuss.elastic.co/t/kibana-multiple-hosts-in-docker-compose/234403/4 "2020-06-23T20:19:19Z")

</div>

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