Home >How to Install Magento 2

How to Install Magento 2

Magento is an open-source e-commerce platform. On November 2015, Magento 2 was released. Let’s experience Magento 2 now.

Firstly, you can see the following document on Magento DevDocs:

Magento 2.0.x: https://devdocs.magento.com/guides/v2.0/install-gde/system-requirements-tech.html.

Magento 2.1.x: https://devdocs.magento.com/guides/v2.1/install-gde/system-requirements-tech.html.

Magento 2.2.x: https://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html.

Install From Archive File

Step 1: Download archive file at https://magento.com/tech-resources/download. You can choose types of the archive file, include or exclude sample data. You should choose the newest version to download, in this tutorial we’ll install Magento 2.1.9.

Step 2: Extract archive file and upload to root directory.

Step 3: Go to your website and follow Setup Wizard.

Example: http://mystore.com.

Click button “Agree and Setup Magento” to start installing Magento 2.

Click button “Start Readiness Check” to check system requirement.

Waiting until the notification is shown then click “Next”.

Fill in database information then click “Next”.

Fill in your store information.

Select “Time Zone”, “Currentcy” and “Language”. If you want to enable/disable any modules, let’s click “Advanced Modules Configurations”.

Create admin account to manage your store.

Click button “Install Now”.

Installation successful. Save your store information.

Install Via Composer

You can get composer from this link: https://getcomposer.org/.

Step 1: Run this command in the root directory which you want to download Magento 2.

composer create-project --repository-url=https://repo.magento.com/ 
magento/project-community-edition

You need to enter public key and private key. You can get at here: https://marketplace.magento.com/customer/accessKeys/.

Step 2: You can go through Setup Wizard or navigation to Magento 2 root directory then run this command to install Magento 2.

Remember to change options with your website information:

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

After installation completed, you will see the following message:

[SUCCESS]: Magento installation complete.
[SUCCESS]: Magento Admin URI: /admin_im53pc

Your URL admin in Magento 2 is http://mystore.com/admin_im53pc.

Step 3: Deploy static view files, run this command.

php bin/magento setup:static-content:deploy

Step 4: (Optional).

If you want to install sample data, run this command:

php bin/magento sampledata:deploy
php bin/magento setup:upgrade

You will see the following message “Please re-run Magento compile command”, run this command:

php bin/magento setup:di:compile

Install By Cloning Repositories

Note: This will clone latest version for Development purpose.

More information here: https://devdocs.magento.com/guides/v2.2/install-gde/bk-install-guide.html.

Navigate to Magento 2 root directory and run this command to clone Magento 2 from the repository:

git clone git@github.com:magento/magento2.git <your Magento 2 directory>

Example: git clone git@github.com:magento/magento2.git mystore.

After finishing, navigate to your Magento 2 directory, in my case is “mystore” and run:

composer install

Now, you can go through Setup Wizard at step 3 in Install With Archive File or run command to install Magento 2 at step 2 in Install Via Composer.

Hope that this article will be helpful for your requirements. Don’t forget to find more articles relating to Magento 2 Development in our website.

If you have any problems or need our professional service, please email us support@bsscommerce.com. You can also find the right solution in our best-in-class https://bsscommerce.com/magento-2-extensions.html

< Previous Post
Next Post >
+ posts