MGT Cloud Log is here!

How​ ​to​ ​install​ ​Magento 2​ ​Beta​ ​with​ ​Sample​ ​Data​ ​using​ ​MGT Development​ ​Environment

August 18, 2017 - Chinmaya Chandel # Magento 2 Beta, Magento 2 Beta with Sample Data

Introduction

In the following tutorial, I want to show you how to install Magento 2 Beta with Sample Data using MGTDevelopment Environment. We are going to install Magento 2.2.0-rc2.0. Newer Magento 2 Versions can be found at GitHub: https://github.com/magento/magento2/releases

Preparations

You need to have Docker installed. If you do not have it already, you can follow our documentation below for the installation:

https://www.mgt-commerce.com/documentation/mgt-development-environment-get-started

After Docker has been installed, run a Docker container (MGT Development Environment), following our tutorial below:

https://www.mgt-commerce.com/documentation/mgt-development-environment-run-container

Magento 2.2 Beta Installation Steps

1. Login into your docker container with ssh by using the following command to connect

ssh root@127.0.0.1
Password: root

2. Navigate to the home directory

cd /home/cloudpanel/htdocs/

3. Clone the beta branch from GitHub

git clone --branch 2.2.0-rc2.0 https://github.com/magento/magento2.git magento2.dev

Git clonet

4. Install dependencies with composer

To install the dependencies go to the document root of your magento2 installation and execute the command "composer install."

cd /home/cloudpanel/htdocs/magento2.dev/
composer install

5. Create Domain / NGINX Vhost in CloudPanel

To access Magento 2 in your browser later you first need to create a domain / vhost in your CloudPanel.

Open the browser and enter http://127.0.0.1:3333 to access your CloudPanel.

Click in the menu on "Domains" and create the domain "magento2.dev" with Magento 2 Vhost Template.

Create Domain

6. Create a Database

For the installation, we need a MySQL database which can be easily created through CloudPanel.

Click on the left menu "Databases" and create a database with the name "magento2".

Create Database

6. Adding a hosts file entry

To resolve the domain magento2.dev, you need to add a hosts file entry in our /etc/hosts file.

If you don't know how to add an entry you can follow the instructions in our documentation:

https://www.mgt-commerce.com/documentation/mgt-development-environment-usage-host-file

After you have added the entry it should look like below:

Hosts File Entry

7. Install Magento 2 with the web based Setup Wizard. Open your browser enter http://magento2.dev/ to start with the installation.

Magento 2 Web Based Setup Wizard

When you enter the database credentials use "root" as database username and password.

Installing the Sample Data for Magento 2 Beta

1. Login into your docker container with ssh by using the following command to connect

ssh root@127.0.0.1
Password: root

2. Go to htdocs directory and clone magento2 sample data repository

cd /home/cloudpanel/htdocs/
git clone --branch 2.2-develop https://github.com/magento/magento2-sample-data.git magento2-sample-data

3. Build Sample Data symlinks by executing the following command

php -f /home/cloudpanel/htdocs/magento2-sample-data/dev/tools/build-sample-data.php -- --ce-source="/home/cloudpanel/htdocs/magento2.dev"

4. Install sample data by executing the setup:upgrade command

php /home/cloudpanel/htdocs/magento2.dev/bin/magento setup:upgrade

5. Reset file owner and permissions

chown -R clp:clp /home/cloudpanel/htdocs/magento2.dev/
chmod -R 775 /home/cloudpanel/htdocs/magento2.dev/

6. Open http://magento2.dev/ in your browser and enjoy the latest Magento 2 beta with Sample Data