# Cannot reach kibana in docker

**URL:** https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732
**Category:** Kibana
**Created:** [April 4, 2018, 11:47am UTC](https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732 "2018-04-04T11:47:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [April 4, 2018, 11:47am UTC](https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732/1 "2018-04-04T11:47:08Z")

</div>

Hi,

I assume it is some stupid little error, but I cannot reach my kibana running in a docker container. (i am quite new to docker, but I like it so far 😉 )

I took following image: `docker.elastic.co/kibana/kibana:6.2.3`

docker ps shows me the following:

```
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fb97e3925da3 docker.elastic.co/kibana/kibana:6.2.3 "/bin/bash /usr/loca…" About an hour ago Up 21 minutes 0.0.0.0:15601->5601/tcp kibana
e087cf628a3a docker.elastic.co/logstash/logstash:6.2.3 "/usr/local/bin/dock…" About an hour ago Up About an hour 5044/tcp, 9600/tcp logstash_ingest_1
cf3f150d5e1d redis "docker-entrypoint.s…" 8 days ago Up 6 days 0.0.0.0:6379->6379/tcp redis

```

Inside the docker container it seems fine:

```
bash-4.2$ curl localhost:5601
<script>var hashRoute = '/kibana-TSI/app/kibana';
var defaultRoute = '/kibana-TSI/app/kibana';

var hash = window.location.hash;
if (hash.length) {
  window.location = hashRoute + hash;
} else {
  window.location = defaultRoute;
}</script>bash-4.2$

```

When I want to connect from the host this happens:

```
[root@server ~]$ curl localhost:15601
curl: (56) Recv failure: Connection reset by peer
[root@server ~]$ curl xxx.xxx.xxx.xxx:15601
curl: (7) Failed connect to xxx.xxx.xxx.xxx:15601; Connection refused

```

I am creating the container with following script:

```
 cat docker_kibana.sh
#!/bin/bash
HOST_PORT=15601
KIBANA_ELASTICSEARCH_URL=http://139.1.117.41:19200
CPU_LIMIT=1.0
CONFIG_HOST=/usr/local/elastic/docker/kibana/config
CONFIG_DOCKER=/usr/share/kibana/config
#IMAGE=blacktop/kibana:6.2.3-xp
IMAGE=docker.elastic.co/kibana/kibana:6.2.3

sudo docker run \
-d \
--cpus=$CPU_LIMIT \
--init \
-v $CONFIG_HOST:$CONFIG_DOCKER \
--name kibana \
--hostname kibana \
-e KIBANA_ELASTICSEARCH_URL=$KIBANA_ELASTICSEARCH_URL \
-p 0.0.0.0:$HOST_PORT:5601 \
$IMAGE

```

my effective kibana.yml wihtout comments looks like that:

```
server.port: 5601
server.basePath: "/kibana-TSI"
elasticsearch.url: "http://xxx.xxx.xxx.xxx:19200"
elasticsearch.requestTimeout: 60000
xpack.security.enabled: false

```

Any help is appreciated.  
Thanks in Advance, Andreas

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [April 4, 2018, 2:10pm UTC](https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732/2 "2018-04-04T14:10:34Z")

</div>

Am not too sure of the docker config. Let me ping my colleague @jarpy who might shed more light on this when he has some time.

Thanks  
Rashmi

---

<div class="post-metadata">

### Author: ![jarpy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jarpy/32/51290_2.png) [@jarpy](https://discuss.elastic.co/u/jarpy)
#### Post date: [April 6, 2018, 2:01am UTC](https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732/3 "2018-04-06T02:01:25Z")

</div>

Hi,

You'll want to set `server.host` in your `kibana.yml`. If you don't, Kibana will default to only binding to `localhost`. The important part to that is that the container is its own "localhost", so the default value will only allow Kibana to be seen from _inside the container_, which is clearly not what you want.

That's why, in the default config, we set `server.host` to `0` (shortcut for `0.0.0.0`).

> <https://github.com/elastic/kibana-docker/blob/master/build/kibana/config/kibana-oss.yml>

---

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [April 9, 2018, 11:06am UTC](https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732/4 "2018-04-09T11:06:25Z")

</div>

oh great. Thanks, now it works like charme.

---

<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 7, 2018, 11:06am UTC](https://discuss.elastic.co/t/cannot-reach-kibana-in-docker/126732/5 "2018-05-07T11:06:26Z")

</div>

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