# Unable to access EC2 ElasticSearch7.5.2 Server using EC2 Public IP on local machine

**URL:** <https://discuss.elastic.co/t/unable-to-access-ec2-elasticsearch7-5-2-server-using-ec2-public-ip-on-local-machine/221854>\
**Category:** Elasticsearch\
**Created:** [March 3, 2020, 10:38am UTC](https://discuss.elastic.co/t/unable-to-access-ec2-elasticsearch7-5-2-server-using-ec2-public-ip-on-local-machine/221854 "2020-03-03T10:38:01Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rameshkr1994](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rameshkr1994/32/59029_2.png) [@rameshkr1994](https://discuss.elastic.co/u/rameshkr1994)\
**Post date:** [March 3, 2020, 1:03pm UTC](https://discuss.elastic.co/t/unable-to-access-ec2-elasticsearch7-5-2-server-using-ec2-public-ip-on-local-machine/221854/3 "2020-03-03T13:03:38Z")

</div>

Hi @shaheryar.malik.  
please check as below , it may be helpful to you!  
We can’t access this elastic search from remote machine as below image :

For localhost or private IP-  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/a/ea41b6bfb205010a5b84b21688e3894c918c8222.png)  
For VM Public IP 👎  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/6/46adc19bfbd1529fef21eb50e24de3128b853bee.png)

we need to make as IP based elastic search for access through the network

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/e/1ecc479b34455cc4197cf4ba2f17f57420422e50.png)  
Edit hosts file as below :  
$nano /etc/hosts  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/0/a0ecd11188701681694ffe57b14e597ce48cd01a.png)

Just map IGIVM with VM Public IP address as below :

Save this file .  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/5/5502f4e4aae04d35d26e99382d7caf04f9aa0063.png)  
Stop elastic search and restart It as below image:-  
Command :-

$systemctl stop elasticsearch.searvice

$ systemctl start elasticsearch.searvice

$ systemctl status elasticsearch.searvice

NOW WE CAN SEE ELASTIC SEARCH IS UP AND RUNNING.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/1/91229332e81e1d21edbc9105418e66781c7eb899.png)  
NOW we can access this elastic search from remote machine  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9d9cc395c8dd22422b9d602d9d2153729507628c.png)

Thanks  
HadoopHelp

---

_[View the full topic](https://discuss.elastic.co/t/unable-to-access-ec2-elasticsearch7-5-2-server-using-ec2-public-ip-on-local-machine/221854)._
