Magento 2

Install Magento 2 Using Composer in localhost XAMPP server

Install Magento 2 Using Composer in localhost. In this article I will guide to you how to install composer and how to install Magento 2 with Composer in localhost XAMPP server or web server.

At first we want to know about Magento 2 System Requirements? Here is the full checklist.

Step 1: Install Composer

After setup XAMPP server go htdocs directory E:\xampp\htdocs and Download and Run the Composer Windows Installer from here:
Download Composer

Check the installation using composer -V
Output: Composer version 1.10.1 2020-03-13 20:34:27

If you want to Composer setup on web server please please login into SSH terminal and run following commands to check and install composer. If nothing displays or you face any errors, please install Composer Download Composer

Step 2: Setup Virtual Hosts

Setup Virtual Hosts and create a url for run magento project. Open E:\xampp\apache\conf\extra\httpd-vhosts.conf add following lines for setup Virtual Hosts.

Step 3: Setup a URL

Setup URL on windows host file. Open C:\Windows\System32\drivers\etc\hosts add following lines for browse site via browser.

Step 4: Download Magento 2

Go to XAMPP server htdocs E:\xampp\htdocs directory via SSH terminal and Run the following command in the htdocs directory.

Note: I have define “magento23” is project install directory in Setup Virtual Hosts section.

Step 5: Create The Database

Create an empty database to work with MySQL in case you have already created so ignore database creating step and next step.

Step 6: Install Magento 2

Run the following lines in Command Line to install your Magento 2

Magento 2 console command setup:install install Magento 2 via Command Line. If this command run without error you can see like following image:

Install Magento 2 by command line

Please check your Magento 2 project admin amd database information in app\etc\env.php file backend and db section.

Now Magento 2 setup is done in XAMPP windows server. Now write in your web browser and enjoy magento 2 project.

Exception: in module: ‘Magento_Backend’ block’s name: ‘require.js’

If we gitting Exception: Invalid template file: vendor/magento/module-backend/view/adminhtml/templates/page/js/require_js.phtml in module: ‘Magento_Backend’ block’s name: ‘require.js’

Open file vendor\magento\framework\View\Element\Template\File\Validator.php line no 138.

change line 138 from


See more derails Here…

Thank you for carefully read my article If you have any query please Leave your query on following comment section or contact with us. Please LIKE and SHARE

Related Articles

Leave a Reply

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