How to install Magento 2.4 on localhost (Xampp, Windows OS)

Step 1: Install Elasticsearch

- Download the Elasticsearch package from

- Extra the zip file into \xampp\htdocs\

Install Elasticsearch

- Run elasticsearch.bat as Administrator (The file is in \xampp\htdocs\elasticsearch-7.10.2\bin)

Install Elasticsearch

- Check the availability of Elasticsearch by URL, it looks like below screenshot:

Install Elasticsearch

Step 2: Install Magento 2.4

- Make sure PHP extensions (in php.ini) enabled: intl, soap, sockets, xsl, sodium

- Change Validator.php, see this link

- Change Gd2.php, see this link

- Disable Magento_TwoFactorAuth (if you get an Authentication Error) by command line

- Run command line to install Magento project:

php bin/magento setup:install --base-url="" --db-host="localhost" --db-name="magento_241" --db-user="root" --admin-firstname="admin" --admin-lastname="admin" --admin-email="[email protected]" --admin-user="admin" --admin-password="admin123" --language="en_US" --currency="USD" --timezone="America/Chicago" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host="" --elasticsearch-port=9200

Install Magento 2.4

Back to Top