Reading list Switch to dark mode

    Installing Magento 2.4

    Updated 11 March 2024

    Hi, Magento 2.4 has been launched on 28th July 2020. You can read the release notes from here.

    While installing Magento 2.4 I faced some issues here I am going to explain that.

    Most people install Magento using the web UI, but now in Magento 2.4, you can only install it via CLI.

    Using the Magento 2 Elastic Search now your customers can easily search using the fastest search engine.

    You can check its server requirements from here. Magento 2.4 is recommended to install on PHP 7.4 even it can be installed on 7.3 but it is not recommended, also apache 2.4 which is the same as the old version, and now you have to upgrade your MySQL version to the latest MySQL 8.

    Searching for an experienced
    Magento 2 Company ?
    Find out More

    Note:

    But even after upgrading above and all the PHP required extensions, you need to configure and install elastic search 7.6.x on your system, or any other server to install Magento 2.4 because elastic search is now the default search engine for Magento frontend, so now you cannot install Magento without the elastic search.

    Lets see step by step how to install Magento 2.4 from CLI:

    # first check if elastic server is installed 
    # using curl elastic-server-ip:port
    # for example
    curl localhost:9200
    # will output server info if started otherwise start the server
    
    # now download Magento2.4 using composer
    mkdir DIRECTORY_WHERE_YOU_WANT_TO_INSTALL
    cd DIRECTORY_WHERE_YOU_WANT_TO_INSTALL
    composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.4.0 .
    # after downloading Magento now use below command to install it 
    php bin/magento setup:install --base-url=http://your-host/m2.4/ \
    --db-host=db-host --db-name=db-name --db-user=db-user --db-password=db-password \
    --admin-firstname=Magento --admin-lastname=User [email protected] \
    --admin-user=admin --admin-password=admin123 --language=en_US \
    --currency=USD --timezone=America/Chicago --use-rewrites=1 \
    --search-engine=elasticsearch7 --elasticsearch-host=elastic-host \
    --elasticsearch-port=elastic-port --backend-frontname=admin
    # now your magento is ready for development

    Another thing to note Magento 2.4 is not installable on Windows or Mac, it is now only supported in Linux distributions such as CentOS, Ubuntu, Debian and similar.

    Another issue that you will face, after installation is done, you will not be able to login Magento admin panel because in Magento2.4 two-factor authentication is installed and it will not let you log in until you provide the correct email and configure SMTP so that Magento can send an email, in that case, the only solution I found is to disable the two-factor authentication module:

    php bin/magento module:disable Magento_TwoFactorAuth

    Thanks 🙂 .

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    3 comments

  • Noury Micron
    • ashutosh srivastava (Moderator)
      • ashutosh srivastava (Moderator)
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home