Magento is a robust e-commerce platform that offers a plethora of incredible features. It's a powerful e-commerce content management system that supports hundreds of thousands of online stores across the web. Every time a new version of this platform pops up, many people grab the opportunity and rush to install it on web hosting providers or localhost.
Installing Magento 2 on a local host can be a daunting experience for developers as it presents numerous hurdles. It requires a lot of tweaking and server configurations as well as the tiresome setup of the composer. One way of evading these complexities when installing Magento 2 on your localhost, is the use of XAMPP. The Cross-platform, Apache, MariaDB, PHP and Perl (XAMPP) is a free and open-source Apache distribution that contains PHP, MariaDB database, and Perl. It is an easy-to-install, platform-agonistic web server solution pack that makes it easy for users to craft local web servers for deployment purposes.
This tutorial will help you Install Magento 2 on a local host using XAMPP.
Ready? Let’s get started!
Before we proceed, make sure you have the following:
- XAMPP installed in your PC
- Magento 2 Downloaded
Besides, Magento 2 installation requires the following:
- PHP 5.5x or 5.6x
- Apache 2.2 or 2.4
- MySQL 5.6x
If you have all the above requirements in place, let's proceed with the installation.
Step 1- Setting The Stage
- Open XAMPP server and start both MySQL and Apache applications. The background color of these services will be green when they open successfully.
- Extract your Magento 2 files in the htdocs folder of your XAMPP server.
Step 2 - Installing The Composer
Our Magento 2 installation will be facilitated by the composer. The composer makes it easy to manage the core Magento attributes including its extensions, their dependencies, as well as the entire Magento system. Its an incredible tool built for effective dependency management in PHP. The tool enables you to declare the libraries to be leveraged by the project and controls install/update aspects for you.
- To install and configure the composer, first download, then run composer-setup.exe.This will automatically install the latest version of composer and create the PATH to help you call “composer “ from any directory in the command line.
- This will take you to a new page. Select Install Shell Menus and click Next.
- Next, the installation will need a php.exe path to continue the setup. Click Browse to provide the directory of the folder containing the php.exe.
- Select the php.exe folder, and click Open to continue.
- Click Install in the subsequent window to kickstart the installation.
- Next, click Install to finalize the installation.
- That's it! The composer is fully installed but not enabled. To enable the extension, uncomment the line “extension=php_intl.dll” and remove the semicolon from the start of that line. Restart your XAMMP server.
- Next, locate the Magento 2 folder in the htdocs folder. Long press the shift key, right click, then select Open command window here. This will open the command prompt on location.
- Run the command “composer install” in the command prompt to install your Magento 2 application on the localhost.
Note: If the command prompt gives the error below, locate the Magento 2 directory, right-click the composer.lock file then select composer update.
This will give you the desired results
- Get verified developer’s username and password from Magento.com, then click MyAccount. Under the developer tab, select Secure Keys, to generate the authentication keys.
- The Public key is the Username whereas the Private key is the password. Next fashion an empty database featuring the correct permissions in phpmyadmin.
Step 3 - Installing Magento 2
- Enter the Magento 2 URL with the prefix localhost. For example; localhost/magento2-developer/setup*/landing and click Enter. This will take you to a new page, click Agree and Setup Magento to continue.
- This will take you to the Magento Installer page. Click Start Readiness Check to initiate the installation.
This will prompt the installer to check the installation environment for readiness. Once the check is complete, click Next to proceed.
- Enter the correct Database credentials that you created in the previous step, then click Next to continue.
- Next, enter the web configuration details such as admin URL, store URL, https option, and Apache rewrites, then click Next.
- The next step is Customizing your store. Here you will be required to set the Currency, Timezone, and language
- The next step is Creating Admin Account. Enter the back-end admin credentials including email, Username, and password to complete the account setup, then click Next
- By now, you Magento 2 application is ready for installation on your localhost. Click Install Now to implement the platform.
This will start the installation
CAUTION: Do not close the browser until the setup is 100% complete.
- Once the installation is complete, you’ll get the following success page. Click Launch Magento Admin to log in to the backend.
- Enter the admin credentials, and click Sign In.
- Give it time, then open the homepage
Congratulations! You have successfully installed Magento 2 on localhost using XAMPP. You can now access the admin area and the front-end of your store to explore the exciting features of Magento 2.