How to install Magento 2 quickly using CLI

How to install Magento 2 quickly using CLI

Undoubtedly, Magento 2 installation process using the wizard in the browser is quite cumbersome and time consuming, especially when we go with sample data. Over to that, we at KiwiCommerce tells you a complete new tactic to install Magento 2 within matters of minutes, and that is with the use of CLI.

Below is a couple of steps that lets you install and run Magento 2 in no time:

Step 1: Download Magento 2.

Here, we can get Magento 2 Files using composer or directly get zip from

Using composer

Get latest Magento version by running below command in the console.

composer create-project --repository-url= magento/project-community-edition <directory>

Or to get a specific version of Magento, add an extra argument in command as below:

composer create-project --repository-url= magento/project-community-edition 2.1.7 <directory>

Here <directory> is in which you want to install Magento. If you do not specify <directory> then it creates project-community-edition.

Download direct Zip

We can download Magento 2 full release with or without sample data from and extract it where you want to install, Please check below screenshot.

Magento2 Download

Step 2: Install using CLI

After set up Magento 2 file system, run below command in CLI from Magento 2 root folder to install it quickly.

php bin/magento setup:install \
--base-url= \
--db-host=localhost \
--db-name=magento \
--db-user=root \
--db-password=123456 \
--admin-firstname=root \
--admin-lastname=localhost \
[email protected] \
--admin-user=admin \
--admin-password=admin123 \
--backend-frontname=admin \
--language=en_US \
--currency=USD \
--timezone=America/Chicago \

Check above options in detail below:

Option NameValueRequired?
–base-urlBase URL to use to access your Magento Admin and storefrontNo
–db-hostYour database host. For ex. `localhost`No
–db-userYour database user. For ex. `root`No
–db-passwordYour database user’s password.No
–admin-firstnameMagento admin user’s first name.Yes
–admin-lastnameMagento admin user’s last name.Yes
–admin-emailMagento admin user’s e-mail address.Yes
–admin-userMagento admin username.Yes
–admin-passwordMagento admin user password.Yes
–backend-frontnameUniform Resource Identifier (URI) to access the Magento Admin or omit this parameter to let Magento generate a random URI for you.No
–languageLanguage code to use in the Admin and storefront.No
–currencyDefault currency to use in the storefront.No
–timezoneDefault time zone to use in the Admin and storefront.No
–use-rewrites1 means you use web server rewrites for generated links in the storefront and Admin.
0 disables the use of web server rewrites. This is the default.


Here I’ve added some option in above command which I think are required but not compulsory. The above command should be edited to your needs and executed from the Magento 2 root directory. If everything went correct, you will be informed that the installation has been completed.

For more detail please refer this link:


You’re done! Now you know the complete process to install Magento 2 using CLI, and of course quickly. Even if you’re stuck somewhere, connect us and we will be glad to help you. 🙂

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *