# Kibana "Unable to revive connection" to Elasticsearch on Docker

**URL:** https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944
**Category:** Elasticsearch
**Created:** [April 14, 2020, 2:55pm UTC](https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944 "2020-04-14T14:55:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ffcandido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ffcandido/32/66289_2.png) [@ffcandido](https://discuss.elastic.co/u/ffcandido)
#### Post date: [April 14, 2020, 2:55pm UTC](https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944/1 "2020-04-14T14:55:27Z")

</div>

Hi everyone,

I'm using Docker Compose to run Elasticsearch Single Node on Docker with Kibana. I reviewed my files several times and no luck so far.

I'm getting "Unable to revive connection: [http://elasticsearch:9200/](http://elasticsearch:9200/)" message. I tried to declare same network for both containers but I got the same error. When I tried to ping from kibana to elasticsearch container, it responds. Unfortunetely Kibana container doesn't have curl or telnet or even wget to test [http://elasticsearch:9200](http://elasticsearch:9200)

This is my docker-compose.yaml file:

```auto
    version: '3.7'
    services:
      elasticsearch:
        image: docker.elastic.co/elasticsearch/elasticsearch:6.3.2
        container_name: elasticsearch
        environment:
          - cluster.name=docker-cluster
          - discovery.type=single-node
        ulimits:
          memlock:
            soft: -1
            hard: -1
          nofile:
            soft: 65536
            hard: 65536
        cap_add:
          - IPC_LOCK
        volumes:
          - esdata:/usr/share/elasticsearch/data
        ports:
          - 9200:9200
          - 9300:9300
      kibana:
        image: docker.elastic.co/kibana/kibana:6.3.2
        container_name: kibana
        environment:
          - ELASTICSEARCH_HOSTS=http://elasticsearch:9200
        ports:
          - 5601:5601
        depends_on:
         - elasticsearch
    volumes:
      esdata:
        driver: local

```

---

<div class="post-metadata">

### Author: ![ffcandido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ffcandido/32/66289_2.png) [@ffcandido](https://discuss.elastic.co/u/ffcandido)
#### Post date: [April 14, 2020, 3:04pm UTC](https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944/2 "2020-04-14T15:04:26Z")

</div>

I just solved my problem...

I had to add two environment variables to elasticsearch container:

```auto
      - "http.host=0.0.0.0"
      - "transport.host=127.0.0.1"

```

And voilá!

---

<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: [April 14, 2020, 3:32pm UTC](https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944/3 "2020-04-14T15:32:23Z")

</div>

Thank you for sharing your solution.

Here is how I'm setting that with docker compose ( `docker-compose.yml`). It's not exactly the same thing so I thought I'd share it with you:

```auto
---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD
      - xpack.security.enabled=$ELASTIC_SECURITY
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    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.6.2
ELASTIC_SECURITY=true
ELASTIC_PASSWORD=changeme

```

---

<div class="post-metadata">

### Author: ![ffcandido](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ffcandido/32/66289_2.png) [@ffcandido](https://discuss.elastic.co/u/ffcandido)
#### Post date: [April 14, 2020, 4:35pm UTC](https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944/4 "2020-04-14T16:35:38Z")

</div>

Well, thanks for taking your time to reply this.

I really liked your docker-compose.yaml file. I'll use as reference when I upgrade my elasticsearch version to 7. I'm working with 6.3.2 since I need to upgrade others dependencies first in order to migrate everything at once.

---

<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 12, 2020, 4:35pm UTC](https://discuss.elastic.co/t/kibana-unable-to-revive-connection-to-elasticsearch-on-docker/227944/5 "2020-05-12T16:35:43Z")

</div>

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