Setup & Installing Magento2.4

Hello Guys,
Magento 2.4 has been released on 28th July 2020. We can read the release notes from here.

While installing new Magento 2.4, we experienced some of the issues which we are going to share here in the blog post. In Magento 2.4, we can only install Magento via CLI and not from web UI.
We must check its server requirements from here.

Magento 2.4 is recommended to install on PHP 7.4, apache 2.4, and latest MySQL 8.

Now, we will need to configure and install elastic search 7.6.x on our system or any other server system to install Magento 2.4 because elastic search is now the default search engine for Magento frontend instead of mysql search engine, so now we cannot install Magento without the elastic search as it becomes mandatory to install Magento 2.4.x now.

Lets see how we can install Magento 2.4 using CLI:

1) We need to check first if elastic server is installed using following command:
Command: curl elastic-server-ip:port

For example:
curl localhost:9200

Above command will output server info if it is started otherwise we need start the server first.

2) Now download Magento2.4 using composer using following commands running step by step:


composer create-project --repository-url= magento/project-community-edition:2.4.0

3) After downloading Magento 2.4, we need to use following command to install the setup:

php bin/magento setup:install --base-url=http://our-host/mag24/ \
--db-host=enter-db-host --db-name=enter-db-name --db-user=enter-db-user --db-password=enter-db-password \
--admin-firstname=MagentoFirst --admin-lastname=MagentoLast \
--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

4) Now we have successfully installed Magento and is ready for development. But you will not be able to use admin part as in Magento2.4 two-factor authentication is installed and it will not let us log in until we provide the correct email and configure SMTP so that Magento can send an email.
To resolve this issue, we found a solution to disable the two-factor authentication module by following command:

php bin/magento module:disable Magento_TwoFactorAuth

Now you can use the admin and enjoy the development. Hope this helps!

Leave a Reply