I am trying to upgrade my magento 2.3.5 to 2.4.4 and seting up magento in docker

I have installed elasticsearch as well using docker via docker-compose.yml and able to access it with elasticsearch:9200 from magento instance , but when i am running php setup upgrade command then it gives me below error Could not validate a connection to Elasticsearch. No alive nodes found in your cluster

can any one let me know what can be the issue.

  • Did you get your answer? Jul 14, 2022 at 6:44

1 Answer 1


After building up your container update host url for elasticsearch. Type following command from CLI

bin/magento config:set catalog/search/elasticsearch7_server_hostname elasticsearch

Or, you can manually update the elasticsearch host from Store Configurations

By default, elasticsearch host url is localhost

I hope this will resolve your problem

  • I done this step already but no luck and still same issue. Jul 14, 2022 at 7:01
  • Did you flush the cache after that? Well this is the same problem I had and got it resolved Jul 14, 2022 at 7:20
  • Yes I did that as well Jul 14, 2022 at 8:25
  • Try to add this in your /etc/hosts file host.docker.internal Jul 14, 2022 at 9:02
  • Also check your .env file for elasticsearch host For reference: magento.stackexchange.com/a/352034/21432 Jul 14, 2022 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.