# Connection refused on port 9200

**URL:** <https://discuss.elastic.co/t/connection-refused-on-port-9200/65399>\
**Category:** Elasticsearch\
**Created:** [November 8, 2016, 7:51pm UTC](https://discuss.elastic.co/t/connection-refused-on-port-9200/65399 "2016-11-08T19:51:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cormack12](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@cormack12](https://discuss.elastic.co/u/cormack12)\
**Post date:** [November 8, 2016, 7:51pm UTC](https://discuss.elastic.co/t/connection-refused-on-port-9200/65399/1 "2016-11-08T19:51:24Z")

</div>

Hi,

I'm following the guide over at digitalocean getting the ELK stack up on Ubuntu server 16. I've installed elasticsearch 2.4.1 and I just can't seem to get any sort of response out of it, never mind setting up Nginx and Kibana etc,

> curl: (7)Failed to connect to localhost port 9200: Connection refused

Here is the output of the system status:

> nadmin@anon:~$ sudo systemctl status elasticsearch  
> â elasticsearch.service - Elasticsearch  
> Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)  
> Active: failed (Result: exit-code) since Tue 2016-11-08 14:45:40 GMT; 4h 34min ago  
> Docs: [http://www.elastic.co](http://www.elastic.co)  
> Main PID: 11415 (code=exited, status=1/FAILURE)

> Nov 08 14:45:40 anon elasticsearch[11415]: #  
> Nov 08 14:45:40 anon elasticsearch[11415]: # Please see the documentation for further information on configuration options:  
> Nov 08 14:45:40 anon elasticsearch[11415]: # [http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/setup-configuration.html)  
> Nov 08 14:45:40 anon elasticsearch[11415]: #  
> Nov 08 14:45:40 anon elasticsearch[11415]: # ---------------------------------- Cluster -----------------------------------  
> Nov 08 14:45:40 anon elasticsearch[11415]: #  
> Nov 08 14:45:40 anon elasticsearch[11415]: # Use a descriptive name for your cluster:  
> Nov 08 14:45:40 anon systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE  
> Nov 08 14:45:40 anon systemd[1]: elasticsearch.service: Unit entered failed state.  
> Nov 08 14:45:40 anon systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

And the Network section of my yml file:

> # ---------------------------------- Network -----------------------------------
> 
> # 
> 
> # Set the bind address to a specific IP (IPv4 or IPv6):
> 
> # 
> 
> network.host: localhost  
> network.bind\_host: localhost  
> network.publish\_host: localhost
> 
> # 
> 
> # Set a custom port for HTTP:
> 
> # 
> 
> http.port: 9200
> 
> # 
> 
> # For more information, see the documentation at:
> 
> # [http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html](http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html)
> 
> #

Obviously these are 'current' state. I've googled round and tried various things for troubleshooting. Disabled the firewall, commented out ipv6 in /etc/hosts - what can I check next?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [November 8, 2016, 8:11pm UTC](https://discuss.elastic.co/t/connection-refused-on-port-9200/65399/2 "2016-11-08T20:11:23Z")

</div>

Check Elasticsearch's log file (/var/log/elasticsearch) for clues.

---

<div class="post-metadata">

**Author:** ![jk\_lmnop](https://avatars.discourse-cdn.com/v4/letter/j/53a042/32.png) [@jk\_lmnop](https://discuss.elastic.co/u/jk_lmnop)\
**Post date:** [November 8, 2016, 8:14pm UTC](https://discuss.elastic.co/t/connection-refused-on-port-9200/65399/3 "2016-11-08T20:14:39Z")

</div>

> [@cormack12](#):
>
> following the guide over at digitalocean getting the ELK stack up on Ubuntu server 16

Hi,  
I have followed many of the tutorials over at DO as well as the ELK posts. Please be wary of the system requirements, exact E,L,K and NGINX versions at use in-line with UB16.04

Have you followed it line for line, amending anything that is of a red font color.

---

<div class="post-metadata">

**Author:** ![cormack12](https://avatars.discourse-cdn.com/v4/letter/c/e19adc/32.png) [@cormack12](https://discuss.elastic.co/u/cormack12)\
**Post date:** [November 9, 2016, 3:54pm UTC](https://discuss.elastic.co/t/connection-refused-on-port-9200/65399/4 "2016-11-09T15:54:42Z")

</div>

Just for info, completely rebuilt the VM again and installed each item step by step testing as I went. Now working. I think the problem was around the ssl htpasswd user for future reference.

Thanks anyway.

---

<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:** [December 7, 2016, 3:54pm UTC](https://discuss.elastic.co/t/connection-refused-on-port-9200/65399/5 "2016-12-07T15:54:45Z")

</div>

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