# Error running Kibana docker-compose

**URL:** <https://discuss.elastic.co/t/error-running-kibana-docker-compose/184349>\
**Category:** Kibana\
**Created:** [June 5, 2019, 12:08pm UTC](https://discuss.elastic.co/t/error-running-kibana-docker-compose/184349 "2019-06-05T12:08:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbranco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbranco/32/47543_2.png) [@dbranco](https://discuss.elastic.co/u/dbranco)\
**Post date:** [June 5, 2019, 12:08pm UTC](https://discuss.elastic.co/t/error-running-kibana-docker-compose/184349/1 "2019-06-05T12:08:38Z")

</div>

Hello everyone,

I am trying to run elk stack in a machine using docker:

OS: Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-45-generic x86\_64)

I have installed docker and docker-compose in it.

Then run:

`docker run -d -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.1.1`

And I can use curl localhost:9200, perfectly!!!

So I decided to package it into a docker compose file:

```auto
version: '2'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - discovery.type=single-node
  kibana:
    image: docker.elastic.co/kibana/kibana:7.1.1
    ports:
      - "5601:5601"
    environment:
      ELASTICSEARCH_HOSTS: http://localhost:9200
    depends_on:
      - elasticsearch

```

And the elasticsearch is running OK, since I can still access via **curl** , but Kibana throw an error

```auto
kibana_1 | {"type":"log","@timestamp":"2019-06-05T12:07:31Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://localhost:9200/"}
kibana_1 | {"type":"log","@timestamp":"2019-06-05T12:07:31Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
kibana_1 | {"type":"log","@timestamp":"2019-06-05T12:07:31Z","tags":["warning","task_manager"],"pid":1,"message":"PollError No Living connections"}

```

What is going on, I also have added container name and replace localhost by the container name with no luck. Any idea of what could be wrong?

Kind regards  
Daniel Branco

---

<div class="post-metadata">

**Author:** ![thekm1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thekm1/32/35926_2.png) [@thekm1](https://discuss.elastic.co/u/thekm1)\
**Post date:** [June 5, 2019, 12:31pm UTC](https://discuss.elastic.co/t/error-running-kibana-docker-compose/184349/2 "2019-06-05T12:31:10Z")

</div>

Hi @dbranco  
Try changing the environment var `ELASTICSEARCH_HOSTS : http://localhost:9200` to `ELASTICSEARCH_HOSTS : http://elasticsearch:9200`

I am not an expert in docker-compose, but as far as I know the kibana container needs to connect directly to the elasticsearch container if you use localhost for `ELASTICSEARCH_HOSTS: http://localhost:9200` then the connection is addressed to himself(kibana container) instead of the elasticsearch container.

Let me know if this helped.

---

<div class="post-metadata">

**Author:** ![dbranco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dbranco/32/47543_2.png) [@dbranco](https://discuss.elastic.co/u/dbranco)\
**Post date:** [June 5, 2019, 1:59pm UTC](https://discuss.elastic.co/t/error-running-kibana-docker-compose/184349/3 "2019-06-05T13:59:35Z")

</div>

Thank you very much Mathew, I was almost sure I changed it before maybe I had a typo and got desperate blind. I just copy/paste from your comment and solved my problem.

---

<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 3, 2019, 1:59pm UTC](https://discuss.elastic.co/t/error-running-kibana-docker-compose/184349/4 "2019-07-03T13:59:42Z")

</div>

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