Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to expose my Elastic Search server to the internet?

I've done installed my ElasticSearch (ES) Server on a VPS Centos. I did test the ES inside the Server and it response correctly.

My next step, is to allow my website which is host on a different web host to access and index its data content into my ES server.

My question is, what is the recommended way of exposed the ES to the internet, so my website can access to it to perform index and search? Is there's authentication method that I need to install ?

like image 940
mana Avatar asked Sep 05 '25 02:09

mana


1 Answers

You need to include network.host:0.0.0.0 in your elasticsearch.yml file so that it listens on the non-loopback address and after that, if your app-server and ES are both in the same VPC, app-server will be able to connect to ES(provided if you exposed 9200 port in security group(in case of AWS).

And hopefully, your app-server port is exposed to the internet which internally connects to ES, you should not expose 9200 port of ES or Elasticsearch to the internet.

If you want an extra layer of security, you can enable x-pack basic which is included in the free tier and can be enabled using xpack.security.enabled: true in elasticsearch.config.

Refer x-pack features and configuration for more info.

like image 51
Amit Avatar answered Sep 07 '25 20:09

Amit