Elasticsearch: Failed to connect to localhost port 9200 – Connection refused

Edit /etc/elasticsearch/elasticsearch.yml and add the following line:

network.host: 0.0.0.0

This will “unset” this parameter and will allow connections from other IPs.

Leave a Comment