# To run Elastic Search on localhost

**URL:** https://discuss.elastic.co/t/to-run-elastic-search-on-localhost/12295
**Category:** Elasticsearch
**Created:** [June 6, 2013, 12:07pm UTC](https://discuss.elastic.co/t/to-run-elastic-search-on-localhost/12295 "2013-06-06T12:07:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kaush777](https://avatars.discourse-cdn.com/v4/letter/k/43a26b/32.png) [@kaush777](https://discuss.elastic.co/u/kaush777)
#### Post date: [June 6, 2013, 12:07pm UTC](https://discuss.elastic.co/t/to-run-elastic-search-on-localhost/12295/1 "2013-06-06T12:07:29Z")

</div>

Hi All,

I want the elastic search to listen on the ports - 9300 to 9400 and 9200  
by only localhost. I have set the bind and publish host as the default :  
192.168.0.1 only.Also, in the url as well i am using localhost. But still  
it listens on this port from everywhere, even though I have not asked for  
it to listen.

So it seems I am missing some configuration. Any pointers here?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 6, 2013, 12:10pm UTC](https://discuss.elastic.co/t/to-run-elastic-search-on-localhost/12295/2 "2013-06-06T12:10:45Z")

</div>

Hey,

can you post your configuration maybe, as it is easier to check.  
Also calling netstat -tulpe (for Linux, no sure about mac os x) shows, that  
elasticsearch is bound to all ips?  
In addition it would be useful to know the elasticsearch version you are  
using.

--Alex

On Thu, Jun 6, 2013 at 2:07 PM, Kaushal [kaush.mu@gmail.com](mailto:kaush.mu@gmail.com) wrote:

> Hi All,
> 
> I want the Elasticsearch to listen on the ports - 9300 to 9400 and 9200  
> by only localhost. I have set the bind and publish host as the default :  
> 192.168.0.1 only.Also, in the url as well i am using localhost. But still  
> it listens on this port from everywhere, even though I have not asked for  
> it to listen.
> 
> So it seems I am missing some configuration. Any pointers here?
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Tobias\_Reiper](https://avatars.discourse-cdn.com/v4/letter/t/50afbb/32.png) [@Tobias\_Reiper](https://discuss.elastic.co/u/Tobias_Reiper)
#### Post date: [June 6, 2013, 4:45pm UTC](https://discuss.elastic.co/t/to-run-elastic-search-on-localhost/12295/3 "2013-06-06T16:45:35Z")

</div>

On Thursday 06 June 2013 05:37 PM, Kaushal wrote:

> Hi All,
> 
> I want the Elasticsearch to listen on the ports - 9300 to 9400 and  
> 9200 by only localhost. I have set the bind and publish host as the  
> default :  
> 192.168.0.1 only.Also, in the url as well i am using localhost. But  
> still it listens on this port from everywhere, even though I have not  
> asked for it to listen.  
> Assuming you have 3 interfaces in your system  
> eth0 at 192.168.0.1  
> lo at 127.0.0.1  
> wlan0 at 192.168.1.1

if u set bind\_host to 0.0.0.0 . it is going to listen on all interfaces  
if u set bind\_host to 192.168.0.1. it is going to listen on eth0  
if u set bind\_host to 127.0.0.1. it is goint to listen on lo which  
serves all localhost queries.  
by default publish\_host the first interface it finds other than  
bind\_host. But you can set it to 0.0.0.0 to listen on all no lo interfaces.

According to your requirement.

- bind\_host should be 127.0.0.1
- publish\_host seems ok with your requirement.

> So it seems I am missing some configuration. Any pointers here?
> 
> --  
> You received this message because you are subscribed to the Google  
> Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:32am UTC](https://discuss.elastic.co/t/to-run-elastic-search-on-localhost/12295/4 "2017-07-06T02:32:35Z")

</div>


