After the official release of Magento 2, users were eager to install it on their local machines or staging websites to check out the new features. However, as many developers reported, installing Magento 2 on the localhost proved to be quite a challenge.
In this article, I will explain how to install Magento in localhost XAMPP using Composer in a step-by-step tutorial.
Magento 2 has very specific server requirements that require a lot of server configuration and tweaking, along with setting up Composer (not a default option at many platforms).
Let me clear up why Composer is really important for Magento 2. Composer is an essential requirement for managing the Magento system, extensions, the involved dependencies, and for declaring libraries for the project.
Before you start, you need to have these things at hand:
1: XAMPP Server installed on your computer with the latest PHP 7.3 or 7.4.
2: Download Magento 2.4.1 along with sample data (You can download Magento 2 from this link)
3:Here are the basic Magento 2.4.1 server requirements:
- Apache Version 2.2 or 2.4
- PHP Version 7.3.x or 7.4.x
- MySQL Version 5.6.x, 5.7.x
- Elasticsearch 7.6.x or higher
Scalable, Super Fast, & Secure Magento Hosting
Our Clients Love us because we never compromise on these features
I will cover the entire process of installing Magento 2 on localhost so that you would not face any issues in replicating the process:
- Open the XAMPP server and start Apache and MySQL applications.
- Extract Magento 2.4.1 files to your xampp/htdocs folder.
Download and run Composer-Setup.exe. This will install the latest version and set up your path so that you can “call” Composer from any directory.
This article was written by Fayyaz Khattak and originally published on The Official Cloudways Blog.