How we can install magento 2.2.0 via command line command(CLI) using Ubuntu ? Could you please some share command?

 php bin/magento setup:install --backend-frontname="admin" --key="admin" --session-save="files" --db-host="localhost" --db-name="magento_2_db" --db-user="root" --db-password="root" --base-url="http://local.magento.com/" --base-url-secure="https://local.magento2.com/" --admin-user="admin" --admin-password="admin123" --admin-email="pramod.kharade@example.com" --admin-firstname="Pramod" --admin-lastname="Kharade"
  • Just one change: Encryption key must be 32 character string without any white space Aug 30 '19 at 9:49

Yes, You can install using Command. Magento 2 has ability do that:

php bin/magento setup:install --base-url= \
--db-host=localhost --db-name=magento --db-user=magento --db-password=magento \
--admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com \
--admin-user=admin --admin-password=admin123 --language=en_US \
--currency=USD --timezone=America/Chicago --use-rewrites=1

See more at Magento Dev doc: http://devdocs.magento.com/guides/v2.2/install-gde/install/cli/install-cli-install.html

  • Hello sir @Amit Bera i am trying to install magneto 2.4 using CLi getting this issue Could not validate a connection to Elasticsearch. No alive nodes found in y our cluster Aug 5 '20 at 7:30

Go to your root directory likes:  


php bin/magento setup:install
php bin/magento setup:install --base-url=https://www.printkuchbhi.com/ --db-host=localhost --db-name=production --db-user=prod-user --db-password=awpVFGDXs5LBVC34 --admin-firstname=PrintKuchBhi --admin-lastname=Admin --admin-email=hello@printkuchbhi.com --admin-user=printkuchbhi --admin-password=printkuchbhi@123 --language=en_US --currency=INR --use-rewrites=1

Also, make sure there should not be any space between value. Like, there should not be --admin-firstname=Print Kuch Bhi. It will give error like,

Error: Too many arguments, expected arguments command

So, it should be --admin-firstname=PrintKuchBhi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.