# Unable to connect to kibana localhost refused to connect

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109>\
**Category:** Kibana\
**Created:** [August 23, 2017, 4:49pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109 "2017-08-23T16:49:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![saqib1](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@saqib1](https://discuss.elastic.co/u/saqib1)\
**Post date:** [August 23, 2017, 4:49pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/1 "2017-08-23T16:49:38Z")

</div>

Hello,  
i am new to elk stack and setting up on my local server. I ran the elastic search and tried the localhost:9200 in browser and elastic search worked fine for me.  
But i tried to run kibana using localhost:5601 but it is showing me ERR\_CONNECTION\_REFUSED.  
Please Help me to fix. thanks

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [August 23, 2017, 6:09pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/2 "2017-08-23T18:09:01Z")

</div>

Where are you seeing `ERR_CONNECTION_REFUSED`, in the browser when you open localhost:5601, or as part of the output when you start the Kibana server?

---

<div class="post-metadata">

**Author:** ![saqib1](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@saqib1](https://discuss.elastic.co/u/saqib1)\
**Post date:** [August 23, 2017, 6:14pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/3 "2017-08-23T18:14:07Z")

</div>

when i open localhost:5601 in the browser

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [August 23, 2017, 6:14pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/4 "2017-08-23T18:14:56Z")

</div>

Does the server start up when you run `bin/kibana`? Do you see any error messages when it does?

---

<div class="post-metadata">

**Author:** ![saqib1](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@saqib1](https://discuss.elastic.co/u/saqib1)\
**Post date:** [August 23, 2017, 6:17pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/5 "2017-08-23T18:17:44Z")

</div>

Actually i am new to ELK . can you please tell me how to run this command?

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [August 23, 2017, 6:27pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/6 "2017-08-23T18:27:41Z")

</div>

Sure. In much the same way you had to start the Elasticsearch server, you also need to start the Kibana server. It is its own process, completely separate from Elasticsearch.

If you downloaded one of the compressed packages (tar.gz or zip), you uncompress it and cd into the resulting path, just like with Elasticsearch. From there, run `./bin/kibana` on linux/osx or `.\bin\kibana.bat` on windows.

If you're using one of the packages (RPM for example), the service should start automatically. If it does not, you should still have some system level service you can run. I don't know offhand what the command is, but I don't think you're using a package anyway. If I'm wrong, let me know what OS you're on and I can hunt down the answer for you.

Note that you'll need to run both Elasticsearch and Kibana, so you will have two server running. One on port 9200 (Elasticsearch, you already have this working) and one on port 5601 (Kibana, which will talk to your Elasticsearch server).

Let me know if any of that isn't clear.

---

<div class="post-metadata">

**Author:** ![saqib1](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@saqib1](https://discuss.elastic.co/u/saqib1)\
**Post date:** [August 23, 2017, 6:28pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/7 "2017-08-23T18:28:35Z")

</div>

i used this command to run kibana and it does not show me any errors in command line  
`sudo docker run -d --name kibana -p 5601:5601 -e ELASTICSEARCH_URL=http://elasticsearch:9200 --net host kibana`

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [August 23, 2017, 6:42pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/8 "2017-08-23T18:42:09Z")

</div>

Ah, you're using the Docker image. It looks like you're forwarding the port correctly, but the option for the Elasticsearch looks wrong. `elasticsearch:9200` isn't a valid hostname... it might be in the image, but I doubt it.

Are you also running Elasticsearch in a Docker image? I don't know much about making Docker containers talk to one another, but from the Kibana Docker docs, it looks like you want to use `--link` to link that container with the Elasticsearch one. I don't know how to use that option, but I suspect it's just a name matching. Assuming that container is just named `elasticsearch`, maybe something like this would work?

```auto
sudo docker run -d --name kibana -p 5601:5601 --link elasticsearch:elasticsearch --net host kibana

```

---

<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:** [September 20, 2017, 6:42pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-kibana-localhost-refused-to-connect/98109/9 "2017-09-20T18:42:33Z")

</div>

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