# Cannot contact elasticsearch at localhost:9200 from apache docker container

**URL:** <https://discuss.elastic.co/t/cannot-contact-elasticsearch-at-localhost-9200-from-apache-docker-container/115498>\
**Category:** Elasticsearch\
**Created:** [January 15, 2018, 8:44am UTC](https://discuss.elastic.co/t/cannot-contact-elasticsearch-at-localhost-9200-from-apache-docker-container/115498 "2018-01-15T08:44:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mallek\_bh](https://avatars.discourse-cdn.com/v4/letter/m/85e7bf/32.png) [@mallek\_bh](https://discuss.elastic.co/u/mallek_bh)\
**Post date:** [January 15, 2018, 8:44am UTC](https://discuss.elastic.co/t/cannot-contact-elasticsearch-at-localhost-9200-from-apache-docker-container/115498/1 "2018-01-15T08:44:56Z")

</div>

I have installed logstash and elasticsearch as services on manjaro linux , i'am using logstash to get data from a mairadb container and it works just fine , elasticsearch seems to work perfectly as well , but when i try to contact elasticsearch from my app on the apache container i get this message :

Elasticsearch request failed: 7 - Failed to connect to 127.0.0.1 port 9200: Connection refused

any help would be much appreciated

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 15, 2018, 9:06am UTC](https://discuss.elastic.co/t/cannot-contact-elasticsearch-at-localhost-9200-from-apache-docker-container/115498/2 "2018-01-15T09:06:01Z")

</div>

What are elasticsearch logs? Do you expose the 9200 port?

---

<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:** [February 12, 2018, 9:06am UTC](https://discuss.elastic.co/t/cannot-contact-elasticsearch-at-localhost-9200-from-apache-docker-container/115498/3 "2018-02-12T09:06:38Z")

</div>

Closed on February 12, 2018, 9:06am UTC

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