Installing Magento Open Source on Windows 11
This tutorial will guide you through the steps to install Magento Open Source on your Windows 11 system using Composer.
Prerequisites
Before we start, make sure that you have the following software installed on your system:
- Composer
- Git
- XAMPP or any other web server software
Download Magento Open Source
- Go to the official GitHub repository for Magento Open Source at https://github.com/magento/magento2.
- Click on the "Code" button and select "Download ZIP".
- Extract the ZIP file to your preferred location on your local machine.
Install Composer Dependencies
Open a command prompt and navigate to the extracted Magento directory.
Run the following command to install the Magento-specific PHP dependencies:
composer install -vvvThis may take some time depending on your internet connection and system performance.
Configure the Database
Open your XAMPP or preferred web server software and create a new MySQL database for Magento.
Navigate to the
app/etc/env.phpfile in the Magento directory and configure the database connection by replacing the following fields with your database connection details:'host' => '<database_host>', 'dbname' => '<database_name>', 'username' => '<database_username>', 'password' => '<database_password>',
Configure Magento
In the Magento directory, navigate to the
pub/folder and copy theindex.php.samplefile.Paste the copied file and rename it to
index.php.Open the
index.phpfile in a text editor and navigate to line 11, and replace the following line:$params[Bootstrap::initParamFile] = __DIR__ . '/bootstrap.php';with
$params[Bootstrap::initParamFile] = __DIR__ . '/app/bootstrap.php';Save and close the
index.phpfile.
Start the Web Server
Open XAMPP or your preferred web server software and start the Apache and MySQL servers.
Navigate to the Magento directory and run the following command to start the Magento CLI:
php bin/magento setup:install --base-url=<your_base_url> --backend-frontname=<your_backend_name> --db-host=<database_host> --db-name=<database_name> --db-user=<database_user> --db-password=<database_password>Replace the fields with your web server URL and database connection details.
Once the installation is complete, navigate to your web server URL to start working with Magento.
Congratulations! You have installed Magento Open Source on your Windows 11 system.