Use code MGT25 to get $25 off! Limited time offer on Cloudways Magento hosting

How to Install Magento 2 on Localhost Using XAMPP

Magento 2 is a powerful ecommerce platform loaded with an arsenal of useful features. There are hundreds of thousands of ecommerce stores built on the popular ecommerce CMS. However, many people face issues in installing Magento 2 on localhost.

In this tutorial, I am going to teach you how to install Magento 2 on localhost. Magento is releasing updated versions of Magento 2 day-by-day. Hence, I am going to install Magento 2.1.4 on my localhost using XAMPP for this tutorial.


  • Apache 2.2 or 2.4
  • PHP 5.6.5–5.6.x, 7.0.2, 7.0.4, 7.0.6–7.0.x
  • MySQL 5.7

To read more requirements, click here.

Download and Extract Magento 2

Go to the Magento official website and download Magento 2.

download magento 2

Now go to xampp/htdocs and create the directory ‘magento.’ Extract the Magento 2.1.4 archive in xampp/htdocs/magento.

create directory

Open XAMPP Control Panel

Now open your XAMPP Control Panel.

open xampp

Click on Apache’s Config and then navigate to PHP (php.ini).

config xamp

Now search for extension=php_intl.dll and extension=php_xsl.dll, and remove the semicolon “;” at the beginning from both.




Start the Apache and MySQL services from XAMPP control panel.

open services

Install Magento 2 on Localhost

Go to phpMyAdmin and create a database with the name magento2.

create database

Open the web browser and explore localhost/magento. Now click on Agree and Setup Magento.

agree setup

The first step for installing Magento 2 on localhost is to perform a Readiness check. After successful checking, click on Next.

Readlines check

Now the database configuration page will appear. Here, enter database details and database name which will be the same as the one you created in phpMyAdmin (magento2). After completing this step, click on Next.

database configuration

Now complete the web configuration, your store, and admin panel address. After web configuration, click on Next.

web configuration

Now customize your store and click on Next.

customize store

Create an Admin account and click on Next.

Admin account

All ready! Just hit the Install Now button.

Install Now

Open your store by exploring localhost/magento and you will see the following result:

output frontend

Open your admin panel by exploring localhost/admin and the following screen will appear:

output admin

Note: If the following error appears on accessing the admin panel, just go to xampp/htdocs/magento/var/cache and delete all the folders from it.

admin error

Final Words:

After following the steps above, you should be able to install Magento 2 on localhost using XAMPP. Now start adding the products and explore the awesome features of Magento 2. If you have any questions about the tutorial above or would like to share your thoughts, just leave a comment below.

About Author

Syed Muneeb Ul Hasan is an expert in PHP and Magento, he prefers to educate users in implementing and learning Magento. When not working, he loves to watch cricket.

  • Prafull

    SQLSTATE[HY000] [2006] MySQL server has gone away
    while installing magento 2

    • Ihor Kalaida

      In MYSQL setup, set wait_timeout to a value such as 500,

  • Sovai Kean

    After installed successfully, error style and icon not showing

    • Please remove the following:


      • Tamal Dey

        I have done all this. But in windows under xampp magento2.1.1 with composer running dead slow.
        Dashboard icons not displaying properly.
        I have to wait 1-2 minutes after clicking any dashboard icon to get response out of it.
        Please suggest the solution.
        I have also change as you suggested in php.ini file.

  • Aleem

    How to configure Cron job in this case ?

  • Neelakanta Kalla

    awesome bro

  • Junaid Ur Rehman

    Dear Brother,

    appreciated your work and very useful information. Right now after installation of magento, facing admin page issue. when I am going to localhost/magento or but not getting admin login page. what can i do to resolve ?

    • Junaid Ur Rehman

      when i am going on page is directing on my domain does that means magento has been installed ?

      • Thanks for your appreciation.

        1. To access admin panel, enter localhost/magento/admin in the web browser.
        2.You mean that it is redirecting to the homepage of your Magento store?

  • Arun Kumar

    thanks bro i appreciate your work ….khudaa hafij

  • Tiger Xiaoxun Huang

    Thank you buddy, it really helps me a lot. However, I have a problem that I failed the readiness check due to a lack of php extension missing. I do not have PHP Extension soap, how to fix this problem. Do I need to download the .dll?

    • Tiger Xiaoxun Huang

      OK, I solved it. Hope it will be fine.

    • You’re Welcome and I think its not normal, and is it working fine now?

  • Jes

    I am having an issue which seems to be common and no answers I have found actually work. None of the links in the admin section work. Cannot open system, stores etc. Any ideas?

  • Danish Imran

    Dear Brother..

    I appreciated your information regarding MAGENTO.. Now i have installed successfully but i am facing an error of CRON Job.. kindly advise how to rectify that issue.

    • Thanks for your appreciation. Can you please tell me that which error are you facing?

  • ankit

    How to upload free downloadable theme on magento, xampp localhost.

  • venkata

    Hi syed,
    I have followed the same procedure for installation without any kind of deviation.The installation completed successfully but when i tried to login to the magento admin, the page keeps on loading forever.And i am not getting any kind of error messages.Please help

  • Shashwath K R

    The installation has completed,but when i tried to open admin panel its keep on loading ,plzz solve this.

  • Harsh Bhatt

    I am facing error as soon as i explore localhost/magento to set up magento on my xampp. It says “Autoload error” & “Vendor autoload is not found. Please run ‘composer install’ under application root directory.” please Help..

  • cany

    hello sir,
    installed magento but giving msg like this ‘Magento supports PHP 7.0.2, 7.0.4, and 7.0.6 or later. Please read Magento System Requirements.’

    • cany

      PHP Version 5.5.9 is not enough

      • This version of PHP was used for the sole purpose of writing this article. Since it was written a long time back, I implemented Magento 2.1.X. Anyway, thanks for highlighting and we are planning to update the “requirement” section of this article very soon

    • cany

      Magento-CE-2.2.2 downloaded this version and installed in xampp, unzipped in httdocs

  • Leon Toys

    Hi , After access installation Magento2 with WAMPP, i have problem with Admin panel (404 not found) and my home page not work correctly, please help me

  • Sree Venkata Prathyusha Vudath

    I have tried all the steps..everything works successfully , but at the end in the last step to access the admin panel i get an error of :

    Object not found!
    The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

    If you think this is a server error, please contact the webmaster.

    Error 404
    Apache/2.4.29 (Win32) OpenSSL/1.0.2n PHP/7.0.27

    Please help. I am unable to access the admin and also my homepage, has no css in it. simple html is being displayed.

    • Go to xampp/htdocs/magento/var/cache and delete all the folders from it, Thanks!

  • Agkem Impex

    I installed magento 2 but admin panel open very slowly also frontend. and if i try to add product it took more then 2 min to open product page.

    • this is a perfect process for installing M2 localhost using Xampp.

      try again if you still same error.

  • Bash

    Thank you! I’ve been trying to install Magento on my system for far too long and just kept running into error after error. Your walkthrough is the only thing that worked and it’s very simple too!