How To Install Magento 2 on Localhost

by Cloudways  December 14, 2015

After the official release of Magento 2, a number of people went on to install it on their localhost or their hosting server providers. For developers, Magento 2 installation on localhost is a pretty painful experience.

 Install Magento 2 on Localhost Using Xampp

Magento 2 comes with many requirements. Magento 2 requires a lot of server configurations and tweaking along with composer setup which are not set by default. Let me clear this for a lot of those who are wondering why composer is really a need in Magento 2. Composer enables us to manage the Magento system, extensions, its dependencies, and also allows us to declare libraries for the project. In this article, I will explain how you can install Magento 2 on your localhost by using XAMPP.

Before you start your installation, you need to have these things on hand:

1: XAMPP Server installed in your computer.

2: Magento 2 Downloaded (You can download Magento 2 from this link)

Magento 2 has some installation requirements like:

  • Apache Version 2.2 or 2.4
  • PHP Version 5.5.x or 5.6.x
  • MySQL Version 5.6x

Now we can go towards the installation processes. I will be covering the whole installation step-by-step to make it easy for you:

  • Open your XAMPP server and start Apache and MySQL applications

image01

  • Extract Magento 2 files in your xampp/htdocs folder

Install Composer

Download and run Composer-Setup.exe. It will install the latest composer version and set up your path so that you can just call “composer” from any directory in your command line.

image03

Click next and select “Install Shell Menus”

image02

In the next step, you would need php.exe path to proceed with the composer setup and provide the path of php.exe

image05

image05

Now click on install to see the final step

image07

image06

After installing the composer, you must enable the extension (php_intl.dll) in your php.ini file. To enable the extension, go to your php.ini and uncommenting the line “extension=php_intl.dll” and just remove semicolon “;” from the starting of the line and restart your XAMPP control panel.

After this, go to the Magento 2 folder inside your htdocs folder. Hold the Shift key and right click, and Select “Open command window here”. This will open command prompt on the location.

In command prompt, execute the command “composer install”. This will install Magento 2 on your localhost.

Note: If you see the error show in the image below, then go to your Magento 2 directory and right-click on composer.lock file and select “composer update”

image09

image08

Get your Username and Password from Magento.com and click My Account. Now click on Secure Keys under Developers tab on the left hand.

image12

Your Public key is your Username and your Private key is your password.

image10

Now create an empty database with correct permissions in your phpmyadmin.

Installation

  • Enter your Magento 2 URL in browser e.g. localhost/m2

image11

Click on Agree and Set Up Magento.

image13

Magento 2 will check your environment for readiness. Click on Start Readiness Check.

image14

Now enter your database information that you previously created.

image15

Click next, and you will be asked for web configurations like store URL, admin URL, Apache rewrites and https options.

image16

Click Next, and select your Timezone, Currency and language in “Customize Your Store” section.

image17

Click next, and insert your back-end Admin username, email and password to setup Admin credentials.

image18

Now click next and Magento 2 is ready to be installed on your localhost. Click on Install Now and as a word of caution, don’t close your browser until setup is done.

image19

image20

 

image00

Congratulations! You have now successfully installed Magento 2 on your localhost. You can now start making your preferred customizations and launch your own ecommerce store based on the most famous Magento software.

Worried about hosting? You don’t need to worry as long as Cloudways Managed Magento Hosting is here for increasing your everyday sales and taking away your server side management hassles. You just focus on building an awesome Magento 2 based ecommerce website and we will take care of the rest. And if you have any issues while installing Magento 2, you can go ahead and ask me via the comments section.

Note: If you face an error in your Magento 2 Admin url, then Go to your Magento 2 database and search “core_config_data” table and change the following 2 rows

 

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Cloudways

Cloudways is a European MSP that provides custom cloud design, deployment and management solutions on leading cloud providers.

Stay Connected:

You Might Also Like...

  • Mark Henry

    It is very useful. Thanks for sharing such a great post. Keep it up.

  • I follow this process and successfully install magento but i do it manually. I don’t use composer or bower.

    • Dev Das

      How did you do it manually? I was trying and it didn’t work :o(

      • Why it did nt work? Can you tell me any error you get?

  • Alexis Rengifo

    First time and it went well, thanks.

  • Thiago Oliveira

    After installing this problem occurs :

    This page has a redirect loop

    Already edited rows in the table ” core_config_data ” but the problem continues.

    Some other solution ?

  • The easiest way to install Magento 2 is to install it from archive file. You can download it from magentocommerce download page. Access the website folder like localhost/magento2 and follow the setup wizard.