Magento 2 is the best eCommerce solution, now Web Dux will show you how to install Magento 2 on your Magento hosting by command line: Composer and Magento CLI.

Magento 2 Installation

In your “public_html” directory run this command, which we assume that you have installed Composer on your Magento hosting, if not you should install composer first.

composer create-project --repository-url= magento/project-community-edition .

Note: To install Magento 2 in the current directory (e.g. public_html) do not forget to add the (.) dot in the end.

public_html directory

Insert your username and password. For user name and password go to and select on My Account button shown in the top-right corner. After Logging in, go to Developers > Secure Keys and Generate your new SECURE KEYS.


Public Key: Is your username

Private Key: Is your password

Magento Secure Key

After inserting your username and password, it will ask for store credentials. Type “yes”.

Magento 2 Installation

Magento 2 will now start downloading in your server.

Magento 2 Installation

After downloading, it will want your “GitHub OAuth token”

Magento 2 Installation

You have to create it from your GitHub account ( For this, Go to Settings > Personal Access tokens and Generate new Token. Copy the token and provide it to the composer. After inserting “GitHub OAuth token”, you should see the following screen.

Magento 2 Installation

Magento 2 is now installed. You now need to set proper permissions for your Magento 2 Store. Magento have few sets of recommended permissions which we will apply on our installation.

a ) Owner must have full access to files.

b ) Web Server must have write permission on var, app/etc and pub directory.

c ) Execute permission of bin/magento.

Issuing the following commands will give your website owner and group full permission and would restrict other users with no access. Additionally, it will provide executable permissions to bin/magento file. Execute the command after changing your current directory to your site’s web root.

Use this command for permissions

Magento 2 Installation

Magento CLI: We will now be using magento CLI for the configuration of our site. Before doing that we’ll export it’s PATH so it can be executed from any directory. Execute this “export PATH=$PATH:$(pwd)/bin” command from your Webroot.

Magento 2 Configuration: Magento CLI has plenty of commands which we will discuss in detail on a separate blog. For now I’ll be using the “magento setup:install” command which will configure our application. This command have various options, but we will use the one’s which are required for initial setup of our store. Use appropriate values with each option.

Note: Please don’t forget change above sample data, such as to your domain, dbname to your database etc.

After a successful installation of Magento 2 on your Magento hosting, this is how your Magento 2 Frontend and Backend should look like.

Magento 2 Installation

Magento 2 Admin Login

Magento 2 Admin Dashboard

There you have it!

Your very own Magento 2 standard store is now ready for customizations! Add products and improvise according to the holiday season to reap the benefits!


You may also like

Leave A Comment

Please enter your name. Please enter an valid email address. Please enter message.