# Kibana in docker while elasticsearch in host machine - is it possible? - please help

**URL:** https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917
**Category:** Kibana
**Tags:** docker
**Created:** [April 20, 2020, 6:26pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917 "2020-04-20T18:26:55Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Venkatesh\_Murthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatesh_murthy/32/66160_2.png) [@Venkatesh\_Murthy](https://discuss.elastic.co/u/Venkatesh_Murthy)
#### Post date: [April 20, 2020, 6:26pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/1 "2020-04-20T18:26:56Z")

</div>

i Pulled Docker image for Kibana 7.6.2. Is there a way the kibana connects to host machine elasticsearch ? if yes what parameter should i give in the docker run command ?  
i tried  
docker run -d --name kibana761 -e ELASTICSEARCH\_HOSTS=http://localhost:9200 -p 5601:5601 [docker.elastic.co/kibana/kibana:7.6.2](http://docker.elastic.co/kibana/kibana:7.6.2)

when i run the container it says no living connectsions. Should the elasticsearch also be in another container ?

---

<div class="post-metadata">

### Author: ![LizaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lizad/32/51074_2.png) [@LizaD](https://discuss.elastic.co/u/LizaD)
#### Post date: [April 21, 2020, 2:12am UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/2 "2020-04-21T02:12:30Z")

</div>

Hi @Venkatesh_Murthy,

To have Kibana connect to Elasticsearch you need to use the --link parameter. See example from: [https://www.elastic.co/guide/en/kibana/current/docker.html](https://www.elastic.co/guide/en/kibana/current/docker.html)

```auto
 docker run --link YOUR_ELASTICSEARCH_CONTAINER_NAME_OR_ID:elasticsearch -p 5601:5601 {docker-repo}:{version}

```

Hope this helps,

Thanks  
Liza

---

<div class="post-metadata">

### Author: ![Venkatesh\_Murthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatesh_murthy/32/66160_2.png) [@Venkatesh\_Murthy](https://discuss.elastic.co/u/Venkatesh_Murthy)
#### Post date: [April 21, 2020, 5:18pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/3 "2020-04-21T17:18:48Z")

</div>

the example you provided is giving link to another container, my question is about linking it to host machine's instance and not to another container.

---

<div class="post-metadata">

### Author: ![LizaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lizad/32/51074_2.png) [@LizaD](https://discuss.elastic.co/u/LizaD)
#### Post date: [April 21, 2020, 6:20pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/4 "2020-04-21T18:20:29Z")

</div>

Hi @Venkatesh_Murthy,

Yes you can connect the host machine, sorry I missed that. Add `--network host` to your docker run command for starting Kibana.

Thanks,  
Liza

---

<div class="post-metadata">

### Author: ![Venkatesh\_Murthy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/venkatesh_murthy/32/66160_2.png) [@Venkatesh\_Murthy](https://discuss.elastic.co/u/Venkatesh_Murthy)
#### Post date: [April 22, 2020, 6:53pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/5 "2020-04-22T18:53:09Z")

</div>

> [@LizaD](#):
>
> `--network host`

i provided the following command:

docker run -d --name kibana761 --network host -p 5601:5601 [docker.elastic.co/kibana/kibana:7.6.2](http://docker.elastic.co/kibana/kibana:7.6.2)

and the container is still unable to connect and says unable to revive connections, no living connections as errors

---

<div class="post-metadata">

### Author: ![LizaD](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lizad/32/51074_2.png) [@LizaD](https://discuss.elastic.co/u/LizaD)
#### Post date: [April 22, 2020, 7:30pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/6 "2020-04-22T19:30:44Z")

</div>

Thanks @Venkatesh_Murthy,

For your command above did you also include:  
` -e ELASTICSEARCH_HOSTS=http://localhost:9200` ?

If so, can you try to run curl command on elasticsearch to see if it is running  
`curl -X GET 'localhost:9200/_cluster/health?pretty`

---

<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 20, 2020, 7:30pm UTC](https://discuss.elastic.co/t/kibana-in-docker-while-elasticsearch-in-host-machine-is-it-possible-please-help/228917/7 "2020-05-20T19:30:51Z")

</div>

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