DropVPS Team
Writer: John hens
How to install magento 2 on windows server 2022

Table of Contents
What you will read?
Magento 2 is a leading eCommerce platform. Installing it on Windows Server 2022 provides a secure and stable environment for running an online store efficiently.
Step 1: Install XAMPP
XAMPP installs Apache, MySQL, and PHP together, which are required to run Magento on Windows Server:
# Download XAMPP from https://www.apachefriends.org
# Run the installer and select Apache, MySQL, PHP
# Start Apache and MySQL from XAMPP Control Panel
Step 2: Enable PHP Extensions
Magento needs specific PHP extensions to function correctly, so enabling them in php.ini is essential:
; Enable these extensions
extension=php_intl
extension=php_mbstring
extension=php_xml
extension=php_bcmath
extension=php_curl
After enabling PHP extensions, restart Apache so the changes take effect:
net stop Apache2.4
net start Apache2.4
Step 3: Create MySQL Database
Magento requires a dedicated database to store all products, customers, and orders safely:
CREATE DATABASE magento;
CREATE USER 'magentouser'@'localhost' IDENTIFIED BY 'StrongPassword123';
GRANT ALL PRIVILEGES ON magento.* TO 'magentouser'@'localhost';
FLUSH PRIVILEGES;
Step 4: Install Composer and Download Magento
Composer is needed to download Magento with all dependencies, placing it in the web server root folder:
cd C:\xampp\htdocs
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento2
Step 5: Set Folder Permissions
Proper permissions ensure Apache can read and write Magento files, preventing errors with caching, logging, or modules:
# Right-click on folder > Properties > Security
# Give full control to the user running Apache
Step 6: Complete Magento Setup
The installation wizard completes Magento setup through the browser by connecting the database and creating the admin account:
http://localhost/magento2
You can also complete Magento setup using the command line interface:
cd C:\xampp\htdocs\magento2
bin/magento setup:install ^
--base-url=http://localhost/magento2 ^
--db-host=127.0.0.1 ^
--db-name=magento ^
--db-user=magentouser ^
--db-password=StrongPassword123 ^
--admin-firstname=Admin ^
--admin-lastname=User ^
--admin-email=admin@localhost ^
--admin-user=admin ^
--admin-password=Admini Password 123 ^
--language=en_US ^
--currency=USD ^
--timezone=America/New_York ^
--use-rewrites=1