Magento – ElasticSearch Error while Installing Magneto 2.4 using CLI

magento2magento2.4

I'm trying to install a fresh Magento 2.4 CE on my local PC.

Here are my configurations:

  1. Magento 2.4 CE
  2. Apache 2.4.41 (Ubuntu)
  3. PHP 7.4.8 (cli)
  4. mysql Ver 8.0.21 for Linux on x86_64 (MySQL Community Server – GPL)
  5. Ubuntu 20.04 LTS

I'm trying to install using CLI with this command:

    php bin/magento setup:install 
    --backend-frontname="admin" 
    --key="240d2e12f0f04fdd2dfd2a9bd616b1f6" 
    --session-save="files" 
    --db-host="localhost:9200" 
    --db-name="magento24" 
    --db-user="root" 
    --db-password="admin123" 
    --base-url="http://127.0.0.1/magento24/" 
    --base-url-secure="https://127.0.0.1/magento24/" 
    --admin-user="admin" 
    --admin-password="admin123" 
    --admin-email="admin@admin.com" 
    --admin-firstname="admin" 
    --admin-lastname="khan"

I am getting error Here

In SearchConfig.php line 81:
                                                                           
  Could not validate a connection to Elasticsearch. No alive nodes found in your cluster 

                                                             
           

Best Answer

As per Magento documentation, you must install ElasticSearch first before installing Magento.

Magento Docs

Easiest way to run it in local environment is with Docker. Here's a guide for that: Install ElasticSearch with Docker

Related Topic