# How can I access elasticsearch cluster created by docker compose by using actual ip address?

**URL:** <https://discuss.elastic.co/t/how-can-i-access-elasticsearch-cluster-created-by-docker-compose-by-using-actual-ip-address/326037>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [February 21, 2023, 8:30am UTC](https://discuss.elastic.co/t/how-can-i-access-elasticsearch-cluster-created-by-docker-compose-by-using-actual-ip-address/326037 "2023-02-21T08:30:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LongKang\_Fan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/longkang_fan/32/97516_2.png) [@LongKang\_Fan](https://discuss.elastic.co/u/LongKang_Fan)\
**Post date:** [February 21, 2023, 8:30am UTC](https://discuss.elastic.co/t/how-can-i-access-elasticsearch-cluster-created-by-docker-compose-by-using-actual-ip-address/326037/1 "2023-02-21T08:30:59Z")

</div>

Hi Community.

I am following the instructions in this tutorial -- Start a multi-node cluster with Docker:

> **[Install Elasticsearch with Docker | Elasticsearch Guide \[8.6\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html)**

I could access Elasticsearch by using this command "**curl --cacert ca.crt -u elastic:rogerfan [https://localhost:9200](https://localhost:9200)**" with the ca.crt file under "/ **usr/share/elasticsearch/config/certs/ca/ca.crt**" either from the docker container or the host.

However, when I changed the **localhost** to its actual IP **192.168.xxx.xxx** , it shows:

[root@localhost ~]# curl --cacert certs/ca/ca.crt [https://192.168.39.12:9200](https://192.168.39.12:9200)  
curl: (51) Unable to communicate securely with peer: requested domain name does not match the server's certificate.

I wonder if this is caused by the ca-certificates, I tried to find the location of http\_ca.crt but just ca.crt was found... So I am not quite sure what is the reason and how can I resolve it.

Thanks

---

<div class="post-metadata">

**Author:** ![LongKang\_Fan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/longkang_fan/32/97516_2.png) [@LongKang\_Fan](https://discuss.elastic.co/u/LongKang_Fan)\
**Post date:** [February 21, 2023, 9:36am UTC](https://discuss.elastic.co/t/how-can-i-access-elasticsearch-cluster-created-by-docker-compose-by-using-actual-ip-address/326037/2 "2023-02-21T09:36:26Z")

</div>

Hi  
After changing the instance.yml file into this:  
elasticsearch@d407cef250af:~/config/certs$ cat instances.yml  
instances:

- name: es01  
dns:
  - es01
  - localhost  
ip:
  - 127.0.0.1
  - 192.168.39.12

- name: es02  
dns:
  - es02
  - localhost  
ip:
  - 127.0.0.1
  - 192.168.39.12

- name: es03  
dns:
  - es03
  - localhost  
ip:
  - 127.0.0.1
  - 192.168.39.12

I could use ca.crt to access [https://192.168.39.12:9200](https://192.168.39.12:9200) by **"curl --cacert certs/ca/ca.crt [https://192.168.39.12:9200](https://192.168.39.12:9200/)"**

But am I doing the right thing？

---

<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 21, 2023, 9:36am UTC](https://discuss.elastic.co/t/how-can-i-access-elasticsearch-cluster-created-by-docker-compose-by-using-actual-ip-address/326037/3 "2023-03-21T09:36:40Z")

</div>

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