We are at our first installation, and we did install Magento 2.4 without Elasticsearch as we didn't know it was mandatory.

Now, sysadmin added Elasticsearch as a service on the server, but in Magento -> Store -> Settings -> Catalog Search, we have no options.

We see that we should have installed Elasticsearch prior to installing Magento.

Is there a solution without reinstalling everything?

Thank you.


To answer your question, yes, I think it should be possible to enable the Elasticsearch connection without reinstalling the whole Magento project. Just make sure your Elasticsearch is installed properly, the version is compatible with your Magento install (according to https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html, accepted Elasticsearch version should be 7.x).

Now, in order to connect Magento to the Elasticsearch service, run the following commands:

php bin/magento config:set catalog/search/engine elasticsearch7
php bin/magento config:set catalog/search/elasticsearch7_server_hostname <elasticsearch_hostname>
php bin/magento config:set catalog/search/elasticsearch7_server_port <elasticsearch_port>

Just make sure you replace the hostname and port placeholders with the actual Elasticsearch connection data. Flush caches and you should be good to go.


Elasticsearch is saparate configuration and mendatory for Magento2.4. you can downlaod from here: https://www.elastic.co/downloads/elasticsearch and install.

you will get this link to run elasticsearch in your local: http://localhost:9200/

screenshot: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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