# Kibana 4.1.2 insists on using localhost:9200 to connect to ES

**URL:** <https://discuss.elastic.co/t/kibana-4-1-2-insists-on-using-localhost-9200-to-connect-to-es/32229>\
**Category:** Kibana\
**Created:** [October 15, 2015, 3:00am UTC](https://discuss.elastic.co/t/kibana-4-1-2-insists-on-using-localhost-9200-to-connect-to-es/32229 "2015-10-15T03:00:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark.betz](https://avatars.discourse-cdn.com/v4/letter/m/c0e974/32.png) [@mark.betz](https://discuss.elastic.co/u/mark.betz)\
**Post date:** [October 15, 2015, 3:00am UTC](https://discuss.elastic.co/t/kibana-4-1-2-insists-on-using-localhost-9200-to-connect-to-es/32229/1 "2015-10-15T03:00:13Z")

</div>

Hi, guys. Having an odd problem. I am installing Kibana 4.1.2 into a Docker container based on Ubuntu 14.04 LTS. I am installing it as follows:

cd /opt && wget -q [https://download.elastic.co/kibana/kibana/kibana-4.1.2-linux-x64.tar.gz](https://download.elastic.co/kibana/kibana/kibana-4.1.2-linux-x64.tar.gz) &&   
tar -zxf kibana-4.1.2-linux-x64.tar.gz &&   
rm kibana-4.1.2-linux-x64.tar.gz &&   
mv kibana-4.1.2-linux-x64 kibana

On container start I am copying a slightly modified kibana.yml into /opt/kibana/config/. This file has been edited so that the elasticsearch.url property looks like this:

elasticsearch.url: "http://%1:%2"

At container start a sed command is executed to substitute the actual IP and port on which to connect to elasticsearch. The host is set to a public IP of a test cluster, and the port to 9200. I have inspected inside this container and verified that the edits are applied correctly. I have also verified that the es cluster can be reached and queried at that address.

When I start /opt/kibana/bin/kibana I get the following in the log, and the server never becomes responsive on port 5601:

{"name":"Kibana","hostname":"kibana","pid":11,"level":50,"err":"Request error, retrying -- connect ECONNREFUSED","msg":"","time":"2015-10-15T02:45:21.615Z","v":0}  
{"name":"Kibana","hostname":"kibana","pid":11,"level":40,"msg":"Unable to revive connection: [http://localhost:9200/","time":"2015-10-15T02:45:21.618Z","v](http://localhost:9200/%22,%22time%22:%222015-10-15T02:45:21.618Z%22,%22v)":0}  
{"name":"Kibana","hostname":"kibana","pid":11,"level":40,"msg":"No living connections","time":"2015-10-15T02:45:21.618Z","v":0}  
{"name":"Kibana","hostname":"kibana","pid":11,"level":30,"msg":"Unable to connect to elasticsearch at [http://localhost:9200](http://localhost:9200). Retrying in 2.5 seconds.","time":"2015-10-15T02:45:21.620Z","v":0}

The last event is then repeated every 2.5 seconds until shutdown.

The only other details I can add are that, since we're in a docker container kibana is being run as root. That means the kibana.yml file is also owned by root after I copy it in. I have noted that the owner/group of the unpacked archive files is set to staff:501 or something like that. I have no idea if that's correct or not, but I can say that chowning the whole tree to root:root did not seem to have any effect.

Hopefully someone can point me in the right direction here. Thanks a lot!

---

<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 6, 2017, 2:11pm UTC](https://discuss.elastic.co/t/kibana-4-1-2-insists-on-using-localhost-9200-to-connect-to-es/32229/2 "2017-07-06T14:11:20Z")

</div>


