How to install Magento 2.x on XAMPP server ( Localhost ).

In this tutorial, we will go through step by step installation of Magento store on Xampp Localhost.
This installation process includes 4 main steps:

  1. Install Xampp.
  2. Pre-configuration before installing Magento.
  3. Install Magento on Localhost.
  4. Recommended settings after installing Magento.

1. Installing Xampp on localhost.

We have a full Xampp installation tutorial, you can see this guide to install Xampp on localhost.

2. Pre-configuration before installing Magento.

Configure php.ini
After starting Xampp, click on “Config” button  of Apache
Install magento
In, turn on these extensions:


Note: simply remove “;” at the beginning of each line to enable the extensions.
Next, start apache and mysql.
Install magento
Config hosts file
In your computer, locate C:\Windows\System32\drivers\etc\hosts. Edit the file with notepad and insert this line localhost

3. Install Magento on localhost.

Step 1: download latest Magento CE (Community Edition) with sample data from
Install magento
After downloading the files, the exact source code of Magento and put to PHP folder (www on appserv or wamp, htdocs on xampp).

Step 2: import sample data.
Go to phpMyAdmin and create a new database ‘Magento’.
Install magento
Create Database “Magento”:
Install magento
Next, Go to privileges tab, add a user account
Install magento
Create the Database user by adding Username, Hostname (Here it is localhost) and password.
Install magento
Select Check all privileges to database ‘Magento’ and click on ‘GO’ button.
Install magento
Check all Database-specific privileges and click ‘GO’
Note: You can download sample data from link

* Step 3: Setup
Assuming that we install Magento to folder “Magento”, now, go to your browser and access this link:
Now you will see Magento installation interface:
Install magento
Select “I agree to the above terms and conditions” and “Next” to proceed to next step to start Readiness check. In this tab, you can check the requirements are met or not.

Install magento
If the Magento requirements not met, it will show the error. Click “Next” when you are ready to continue.
Install magento
Once it passed the readiness test, click “Next” to go to database configuration page
Install magento
Now, enter database information:
+ Host: host name (localhost)
+ Username: username of database user
+ Password: password of user
+ Table prefix: prefix of table in database
Install magento
Now, Installer automatically set you the administration panel address, Click Next to continue.
Install magento
Modify these options for your Magento site:

+ Locale: Language
+ Timezone: your store timezone
+ Default currency: default currency you want to use for your store

After you’re done, click on “Continue” to enter Magento admin details:
+ User name
+Email Address
+ Password
Install magento
Click ‘Next’.
Install magento
Click “Continue” to finish the installation.
Install magento
Now we’ve done with Magento installation on localhost.
Install magento
You can go to admin section by clicking on button “Go to Backend”. Alternately, type the URL “http://localhost/magento/admin_****” on the browser.
Install magento

To go front end, click on button “Go to Front end” or use “http://localhost/magento”.
Install magento

4. Some recommended setting after installing Magento.

Magento uses many types of cache to increase load speed as well as reduce the number of database queries. So it’s essential to refresh these caches every time we make a change.
In the admin section, go to System-> Cache Management.
Click on “Select all” and Flush Magento Cache. Which start refreshing all types of cache in Magento.

Anwar Yakkiparamban

Anwar Yakkiparamban is the founder of Lauyou Learning. Prior to Lauyou learning, Anwar worked at ARD Engineering & Development, Qatar. He holds bachelor degree in Electronics and Communication Engineering from Govt. Engineering College Idukki.

You may also like...