Just want to write this post to share my findings on how to install Magento 2.0 on XAMPP in localhost.

I got a windows 8.1 laptop and the below post describes installing Magento 2.0

Step 1: XAMPP

Download XAMPP from https://www.apachefriends.org/index.html.  Please ensure you have MySQL 5.6 or higher and PHP 5.5 or greater.  Refer http://devdocs.magento.com/guides/v2.0/install-gde/system-requirements.html for the exact system requirements.

Once installed ensure that the XAMPP is running by launching http://127.0.0.1 or http://localhost

I installed XAMPP under D:\xampp folder.  It is always better not to install under C drive.

Step 2: Install Composer

Download composer from https://getcomposer.org/.  I just downloaded the Windows setup file and I installed.  While installation it will ask for the PHP installation directory.  By default it will identify the PHP path.  In case if that doesn’t defaulted then please select the path where php.exe exists.  It will be usually under XAMPP php folder.

Step 3: Download Magento

Download magento from http://www.magentocommerce.com/.  I downloaded the CE edition with Sample data. I created a folder ‘magent20’ under ‘D:\xampp\htdocs\’ and extracted the downloaded magento ZIP package.

Step 4: Create Database

Launch the PhpMyAdmin using http://localhost/phpmyadmin and create a database called ‘magento20db’.

Step 5: Update Magento Dependencies

To update Magento dependencies you need to have secure keys to connect Magento repository.  Go to http://www.magentocommerce.com/ and create an account.  Login and click ‘My Account’ and click ‘Connect’.  Click on ‘Secure Keys’ and create a key.  Give the name as ‘repo.magento.com’ and create the key.  It will generate a private and public key.  Note these keys in a notepad.

Now open a cmd prompt.  Go to the magento root folder.  In my case go to ‘D:\xampp\htdocs\mgento20’ and type ‘composer update’.  This will ask for a username and password connect to the magento repository.  Give the public key as username and private key as password.

This will now connect to the Magento repository and download all the dependencies.  You much be connected to Internet.

Step 6: Install Magento

Launch ‘http://127.0.0.1/magento20’ from the browser.  Do not launch using localhost because that created some problem for me.  Always use 127.0.0.1 instead of localhost.  This will take you to the Magento installation page and you can just continue till end.  Input the database details which we have created earlier.  The default username is ‘root’ and password is empty.  At the end of installation page, it will provide you a summary of details which will contain the admin and frontend URL.  Note down in the notepad.

Step 7: Post Installation (Troubleshooting)

Launch the admin back-end URL.  For the first time it might take some time and it will give you a login page.  The login page contains a magento logo and ensure that the magento logo appears correct.  If it is broken then you have to clean up the static content as below.

Open windows explorer and go to ‘D:\xampp\htdocs\magento20\pub\static’ folder.  Clear all the content inside except the ‘.htaccess’ file.

Open the cmd prompt and go to ‘D:\xampp\htdocs\magento20\bin’ folder and run the below command

php magento setup:static-content:deploy

This will run for a while with lots of dots….  Once complete try launching the Magento admin URL and it should work fine.