Install Magento 2 On Localhost

In this post we will learn, download the Magento 2.4 using composer and install the Magento 2.4 software from the command line on localhost windows 10.

Also you have downloaded Magento 2 then installing? Or installed via composer? If issue solved,Click Kudos & Accept as Solution. ‎ 10:40 PM ‎ 10:40 PM. Re: Instalation at 51% Magento 2 localhost Hi, @Manthan Dave I download 7.2.30 / PHP 7.2.30 from XAMPP site and ver 2.3.5-p1 fro Magento site. Create a host for running Magento 2.3.0 on your localhost: On your Windows 10, go to the path C: Windows System32 drivers etc, open the hosts file Insert the new row: and press the ctrl + s for saving the new data. To install Magento 2 with PHP7 on localhost, first step, you must download Magento 2 zip file from download page. Step 2 After download Magento 2, you might start your EasyPHP DevServer. You might click on EasyPHP DevServer icon in Taskbar, then click Open Dashboard. Magento 2.1, manuall install extensions wont work Hot Network Questions Must observables be Hermitian only because we want real eigenvalues, or is more to that? Open your store by exploring localhost/Firstmagento on your browser. For Admin Panel; Open your admin panel by exploring localhost/admin, a login page will appear. So that’s all for this “How to Install Magento 2.2.1 on Localhost Using XAMPP” friends. We learned how to run magento on localhost. If you found it helpful then, please SHARE.


Before you continue, you must do the following:

  • Get authentication keys for the Magento code repository.

PHP Configuration

Install Localhost Windows 10

Edit php.ini file for increase memory limit and enable required extensions. You can required extensions from this link System Requirements. In xampp server maximum extensions enable.

Also need to change below in php.ini:

Increase memory limit


Enable below extensions by remove semicolon(;) from begining of the line.


Get Authentication Keys

Get authentication keys form Magento officeal website after login. After login you can get Access Keys, public key and private key. Public key is username and private key is password. We will use this creadentials for download Magento using composer.

Install Composer

Download compser version 1.10.20 from this link Install Composer. After download composer.phar file paste there you want download Magento.

For example, we can paste composer.phar file in c:xampphtdocs

Download Magento 2.4 Using Compser

Now download Magento 2.4 using composer using below command.

For example

Note: After download magento create zip file for creating next project or reintall magento. Because Magento download via composer is taking 15-20 min.

Install Elasticsearch

Download Elasticsearch according your operating system. In this lesson we have used Windows 10. After download Elasticsearch zip file and paste in C drive and unzip this zip file. And run below command.

After run Elasticsearch, we can check url http://localhost:9200 in browser then we can see output like below.

Create Database

Create database for your project. In this lesson we have created database magento241

Install Magento 2.4 via Command Line

Now we will install Magento 2.4 via command line on windows localhost. If you want to install Magento on localhost then need to changes in file vendormagentoframeworkImageAdapterGd2.php like below code.

Replace with

After above changes then run below command for install Magento 2.4

Localhost Install Php

php bin/magento setup:install --base-url=http://localhost/magento241/ --db-host=localhost --db-name=magento241 --db-user=root --db-password= --admin-firstname=Amit --admin-lastname=Kumar [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

Fixed Admin Login Issue

After installatin if showing black page on admin login page then need changes in file vendormagentoframeworkViewElementTemplateFileValidator.php like below code.

Replace with

Disable TwoFactorAuth Module

Setup Magento 2 On Localhost

In localhost you can disable module Magento_TwoFactorAuth via running below command. Utc real time.

Install Magento 2 On Localhost

Fixed Icon and Images Loading Issue

If images and icons is not loading then run below commands

I hope after follow the above steps, Magento 2.4 installation will be success!!

How to install magento 2 on xampp server localhost

Magento 2.0



In this lesson we have learnt download Magento 2.4 via composer and install of Magento 2.4 via command line on localhost windows 10. I have also learnt installation of Elasticsearch on windows 10.

How To Install Magento 2 On Localhost

This lesson also available on YouTube

Please leave comments

How To Install Magento 2 On Wamp Server Localhost

Video Tutorials on YouTube