How to install magento 2.4

A few things have changed with the release of magento 2.4 in terms of the installation process.

Although you can still download a zip file and upload to your server, the recommended way for most situations is now to use composer.

“Download” magento

In your web server docroot directory create a new composer project by running the following command:

 composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

You will be requested for your Magento authentication keys, which you can create by going to your Magento Marketplace account.

Install magento

Another big change that came with magento 2.4 is that you no longer have the web wizard install. You must install magento using the command line (which is not as user friendly for most people).

Also, it is now mandatory to have an elasticsearch engine running. If you do not have it then you either need to install it or use magento 2.3.x :(.

If you use Cloudways you just need to enable the service and you are good to go :).

In your magento root directory run the following command:

php bin/magento setup:install --base-url=http://www.myurl.com/ \
--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \
--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=localhost \
--elasticsearch-port=9200

In the above example, you are install magento for url http://www.myurl.com/ in a local database named magento (with the same user and password) and creating an admin with username admin and passowod admin123. Your elasticsearch engine is version 7 and is running on your server in port 9200.

Don’t forget to change the values according to your particular situation.

Leave a Reply

Your email address will not be published.