Create Magento project
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition=2.4.6 .
To install Magento 2
php bin/magento setup:install --base-url=https://yourdomain.com --db-host=localhost --db-name=magento --db-user=root --db-password=MYSQL_ROOT_PW_HERE --admin-firstname=Yujin --admin-lastname=Boby [email protected] --admin-user=OkAdmin --admin-password=ADMIN_PW_HERE --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --backend-frontname="admin" --search-engine=elasticsearch7
To create an Admin user, run
php bin/magento admin:user:create --admin-user="serverok" --admin-firstname="Server" --admin-lastname="Ok" --admin-email="[email protected]" --admin-password="secUre@1919"
Maintenance mode
php -d memory_limit=-1 bin/magento maintenance:enable
Check Maintenance mode status
php -d memory_limit=-1 bin/magento maintenance:status
To allow IP in maintance mode
php -d memory_limit=-1 bin/magento maintenance:allow-ips 117.247.196.198 112.133.248.2
Flush Magento cache
php bin/magento cache:flush
Deploy static content
php -d memory_limit=-1 bin/magento setup:static-content:deploy
php -dmemory_limit=6G bin/magento setup:static-content:deploy -f de_DE en_US it_IT fr_FR
Change admin login path
php bin/magento setup:config:set --backend-frontname="admin_path"
Show Magento configuration. The second command shows the configuration related elastic search
php bin/magento config:show
php bin/magento config:show | grep 'elastic'
See Magento 2