Install Magento on Server

Shailesh Bhagliya
1 min readSep 19, 2022

follow following step for the install magento 2 on server

1.Create New Database (click on MySQL® Databases) for that.

2.Add New User

3. add Add New User (MySQL Users on same screen.)

4. Add User To Database (On same screen)

5. Go to public_html folder then run following command

/usr/local/bin/ea-php81 -d memory_limit=-1 /opt/cpanel/composer/bin/composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.4.5 . --ignore-platform-reqs

Note: change php version and Magento version as per requirement

after add Magento 2 public and private key for next progress

6. run following command after downloading all files

ea-php81 -d memory_limit=-1 bin/magento setup:install --base-url="https://shailesh.dev.com/" --db-host="localhost" --db-name="shailesh_dev245" --db-user="shailesh_dev245" --db-password="shailesh_dev245" --admin-firstname="shailesh" --admin-lastname="admin" --admin-email="shailesh@gmail.com" --admin-user="admin" --admin-password="admin@123" --language="en_US" --currency="INR" --timezone="Asia/Kolkata" --use-rewrites="1" --backend-frontname="admin" --search-engine=elasticsearch7 --elasticsearch-host="localhost" --elasticsearch-port=9200

Note: Change details as per your setup on above command.

7. after Magento installation done run following command.

rm -rf var/view_processed/ pub/static/* generation/

rm -rf var/view_processed/ pub/static/* generation/
php -d memory_limit=-1 bin/magento s:up
php -d memory_limit=-1 bin/magento s:d:c
php -d memory_limit=-1 bin/magento s:s:d -f en_USphp -d memory_limit=-1 bin/magento cache:clean
php -d memory_limit=-1 bin/magento cache:flush
chmod -R 0777 var/cache/ pub/static/

8. After all commands are done, please check your admin and site frontend.

for the admin you have to disable one module using following command.

bin/magento module:disable Magento_TwoFactorAuth
bin/magento cache:flush

--

--