# Cannot connect to ES remotely even with ufw firewall

**URL:** <https://discuss.elastic.co/t/cannot-connect-to-es-remotely-even-with-ufw-firewall/129951>\
**Category:** Elasticsearch\
**Created:** [April 29, 2018, 10:52am UTC](https://discuss.elastic.co/t/cannot-connect-to-es-remotely-even-with-ufw-firewall/129951 "2018-04-29T10:52:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [April 29, 2018, 10:52am UTC](https://discuss.elastic.co/t/cannot-connect-to-es-remotely-even-with-ufw-firewall/129951/1 "2018-04-29T10:52:55Z")

</div>

I have configured Elasticsearch to bind to `localhost:9200` on the DB server, then allow my app server to connect to it with `ufw`. However, when I try to `curl` the DB server from my app server, I am unable to connect to it.

My workaround at the moment is to us `nginx` to listen to 9201 and send traffic to 9200. I am then able to run `curl dbserver:9201`.

I would like to setup multiple nodes, however, and I can’t figure out how I can get around this problem.

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [April 30, 2018, 4:36am UTC](https://discuss.elastic.co/t/cannot-connect-to-es-remotely-even-with-ufw-firewall/129951/2 "2018-04-30T04:36:24Z")

</div>

You need to make it bind to public ip. Try configuring with: `network.host: ["_local_", "_site_"]`

Also, know that this will effectively put it [Production Mode](https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html#_development_vs_production_mode)

---

<div class="post-metadata">

**Author:** ![smlbiobot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smlbiobot/32/29622_2.png) [@smlbiobot](https://discuss.elastic.co/u/smlbiobot)\
**Post date:** [April 30, 2018, 10:26am UTC](https://discuss.elastic.co/t/cannot-connect-to-es-remotely-even-with-ufw-firewall/129951/3 "2018-04-30T10:26:44Z")

</div>

Thanks—that works!

---

<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:** [May 28, 2018, 10:26am UTC](https://discuss.elastic.co/t/cannot-connect-to-es-remotely-even-with-ufw-firewall/129951/4 "2018-05-28T10:26:47Z")

</div>

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