Wednesday, Jul 20, 2022 / / Surbhi Patel

How to Install Magento 2 on a Windows PC

It takes a lot of preparation and development to launch an ecommerce store or update Magento to the latest version. The best way to explore and test Magento’s features is to install it on a local server.

The Magento 2.4 version is only supported on Linux-based operating systems. However, you can install and configure Magento locally on a Windows computer.

Magneto Installation Step For Windows

Step 1

Download Magento (Note: Not included sample data)



Step 2

Downloaded folder put in this path xampp/htdocs/foldername(as per your project name)


Step 3

Download Elasticsearch and install

=> (http://localhost:9200/)


Step 4

Create database On localhost

=> http://localhost/phpmyadmin/


Step 5

E:\xampp\htdocs\learnmagento\vendor\magento\framework\Image\Adapter Gd2.php

comment this function =>validateURLScheme and put below code:

private function validateURLScheme(string $filename) : bool


$allowed_schemes = [‘ftp’, ‘ftps’, ‘http’, ‘https’];

$url = parse_url($filename);

if ($url && isset($url[‘scheme’]) && !in_array($url[‘scheme’], $allowed_schemes) && !file_exists($filename)) {

return false;


return true;



Step 6


changes in Validator.php file

line 141 comment and put new path $realPath = str_replace(‘\\’,’/’,$this->fileDriver->getRealPath($path));


Step 7


changes in PluginListGenerator.php

line 158 comment and put $cacheId = implode(‘-‘, $this->scopePriorityScheme) . “-” . $this->cacheId;


Step 8

E:\xampp\php changes in php.ini file


Line 943 – extension=soap

Line 944 – extension=sockets

Line 949 – extension=xsl

Using below command install magento 2 :


Step 9

php bin/magento setup:install –base-url=”http://localhost/magento22/”

–db-host=”localhost” –db-name=”magento22″ –db-user=”root” –db-password=””
–admin-firstname=”admin” –admin-lastname=”admin”
–mailto:admin-email=”[email protected]” –admin-user=”admin”
–admin-password=”admin123″ –use-rewrites=”1″ –backend-frontname=”admin”


Step 10

Run command

At below path:-


php bin/magento indexer:reindex index:trigger

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy-f

php bin/magento deploy:mode:set developer

php bin/magento cache:clean

php bin/magento cache:flush

php bin/magento module:disable Magento_Csp

php bin/magento module:disable Magento_TwoFactorAuth

not requires = 18 – Insert Query DATA = “INSERT INTO `core_config_data`(`path`,`value`) VALUES (‘dev/static/sign’, 0) ON DUBLICATE KEY UPDATE `value`=0


Step 11


changes in di.xml change the word “Symlink” to “Copy”


Step 12

Run magento project =>http://localhost/foldername/admin


Step 13

Install Magento 2.4 in Windows 10 using composer and command line with Elasticsearch.

Follow the below link:


Below is the command to change the composer version

  • “composer self-update –rollback” to return to version 2.1.5

Virtual Host

Open the below link:

And add the following changes in the below path file:-



You have successfully installed the latest Magento version (2.4.3) on your local Windows system. Magento is a versatile and flexible framework that enables you to build up your ecommerce store regardless of its size or business model.

Voila and it’s done. Please let us know if there is anything we missed. Waiting for your comments. Stay tuned.

Surbhi Patel

You have a visionWe know the way to get you there.