# How to configure the publish address of elasticsearch 5.0 with CLI flags

**URL:** https://discuss.elastic.co/t/how-to-configure-the-publish-address-of-elasticsearch-5-0-with-cli-flags/74884
**Category:** Elasticsearch
**Created:** [February 13, 2017, 1:02pm UTC](https://discuss.elastic.co/t/how-to-configure-the-publish-address-of-elasticsearch-5-0-with-cli-flags/74884 "2017-02-13T13:02:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fvosberg](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fvosberg](https://discuss.elastic.co/u/fvosberg)
#### Post date: [February 13, 2017, 1:02pm UTC](https://discuss.elastic.co/t/how-to-configure-the-publish-address-of-elasticsearch-5-0-with-cli-flags/74884/1 "2017-02-13T13:02:59Z")

</div>

I've used elasticsearch 2.0 with start up flags to configure the publish\_addres. I need the publish address to be configured, because I want to start elasticsearch in a docker container and access it from outside. So the publish address must be the IP of the docker host, which is in my case 192.168.99.100. I want to access elasticsearch on port 9201.

`docker run -d -p 9201:9201 --name elasticsearch_test elasticsearch:5.2-alpine elasticsearch -Enetwork.publish_host="192.168.99.100" -Ehttp.port="9201"`

which is like the old command

`docker run -d -p 9201:9201 --name elasticsearch_test elasticsearch:2.4.1 elasticsearch -Des.network.publish_host="192.168.99.100" -Des.http.port="9201"`

But when I start the container and look into the logs I don't get the publish address `192.168.99.100:9201`, but `192.168.99.100:9300` and `172.17.0.2:9201`. How can I force elasticsearch to use my combination of address and port?

Thanks in advance

Output of `curl -XGET docker.dev:9201/_nodes?pretty`

`{ "_nodes" : { "total" : 1, "successful" : 1, "failed" : 0 }, "cluster_name" : "elasticsearch", "nodes" : { "BYDksDQMQLOC-F9A9tJCBg" : { "name" : "BYDksDQ", "transport_address" : "192.168.99.100:9300", "host" : "192.168.99.100", "ip" : "192.168.99.100", "version" : "5.2.0", [...] "settings" : { [...] "http" : { "host" : "0.0.0.0", "type" : { "default" : "netty4" }, "port" : "9201" }, "transport" : { "type" : { "default" : "netty4" } }, "network" : { "bind_host" : "0.0.0.0", "publish_host" : "192.168.99.100" } }, "os" : { "refresh_interval_in_millis" : 1000, "name" : "Linux", "arch" : "amd64", "version" : "4.4.43-boot2docker", "available_processors" : 1, "allocated_processors" : 1 }, "process" : { "refresh_interval_in_millis" : 1000, "id" : 1, "mlockall" : false }, [...] "transport" : { "bound_address" : ["[::]:9300" ], "publish_address" : "192.168.99.100:9300", "profiles" : { } }, "http" : { "bound_address" : ["[::]:9201" ], "publish_address" : "172.17.0.2:9201", "max_content_length_in_bytes" : 104857600 }, [...] } } }`

---

<div class="post-metadata">

### Author: ![msimos](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@msimos](https://discuss.elastic.co/u/msimos)
#### Post date: [February 13, 2017, 10:01pm UTC](https://discuss.elastic.co/t/how-to-configure-the-publish-address-of-elasticsearch-5-0-with-cli-flags/74884/2 "2017-02-13T22:01:55Z")

</div>

Hi,

Can you try and set transport.tcp.port and/or transport.publish\_port and transport.publish\_host. And see if this has any effect.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-transport.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-transport.html)

---

<div class="post-metadata">

### Author: ![fvosberg](https://avatars.discourse-cdn.com/v4/letter/f/35a633/32.png) [@fvosberg](https://discuss.elastic.co/u/fvosberg)
#### Post date: [February 17, 2017, 8:04pm UTC](https://discuss.elastic.co/t/how-to-configure-the-publish-address-of-elasticsearch-5-0-with-cli-flags/74884/3 "2017-02-17T20:04:10Z")

</div>

Thank you very much. That made it. I had to change `http.port` to `transport.publish_port`

The following command works as expected

```
docker run -d -p 9201:9201 --name elasticsearch_test elasticsearch:5.2-alpine elasticsearch -Enetwork.publish_host="192.168.99.100" -Etransport.publish_port="9201"
```

---

<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: [March 17, 2017, 8:04pm UTC](https://discuss.elastic.co/t/how-to-configure-the-publish-address-of-elasticsearch-5-0-with-cli-flags/74884/4 "2017-03-17T20:04:27Z")

</div>

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