# Reaching elasticsearch externally

**URL:** https://discuss.elastic.co/t/reaching-elasticsearch-externally/196600
**Category:** Elasticsearch
**Tags:** docker
**Created:** [August 23, 2019, 10:02pm UTC](https://discuss.elastic.co/t/reaching-elasticsearch-externally/196600 "2019-08-23T22:02:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![codecandy](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@codecandy](https://discuss.elastic.co/u/codecandy)
#### Post date: [August 23, 2019, 10:02pm UTC](https://discuss.elastic.co/t/reaching-elasticsearch-externally/196600/1 "2019-08-23T22:02:16Z")

</div>

I am trying to reach ES via a GO Client - the official GO Client from ES is able to connect. however, I am trying to see is this client is reaching the ES instance

> **[olivere/elastic](https://github.com/olivere/elastic)**
>
> Elasticsearch client for Go. Contribute to olivere/elastic development by creating an account on GitHub.

It is not working because the transport publish address of the instance is always 172.20.0.2:9200

I tried to change this with the following command -  
docker run -d -p 5601:5601 -p 9200:9200 -p 5044:5044 --name elk sebp/elk elasticsearch -Enetwork.publish\_host=_local_ -Enetwork.host=_local_,_site_

the docker container starts.. how ever the http "publish\_address": "172.20.0.2:9200"

I also tried with a docker-compose like,

```
- cluster.name=eslocal
- bootstrap.memory_lock=true
- http.host=127.0.0.1
- transport.host=127.0.0.1
- network.publish_host=127.0.0.1
- transport.publish_port=9200

```

Neither is this working.. Is there any other possibility to expose the instance out side the docker container so that an external application can access the stored data ?

thanks  
CC

---

<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: [August 26, 2019, 8:54am UTC](https://discuss.elastic.co/t/reaching-elasticsearch-externally/196600/2 "2019-08-26T08:54:19Z")

</div>

have you tried setting `0.0.0.0` as `http.host` setting to bind to any interface?

---

<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 23, 2019, 8:54am UTC](https://discuss.elastic.co/t/reaching-elasticsearch-externally/196600/3 "2019-09-23T08:54:21Z")

</div>

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