Feb 27, 2017

Video - How to Install Magento 2 with Sample Data via Command Line

Video - How to Install Magento 2 with Sample Data via Command Line
I show How to Install Magento 2 with Sample Data via Command Line. We go through a set of commands required to download, install and configure Magento 2 on local environment.

I made it. I've started my Magento video series where I am planning to share my knowledge about Magento 2. Please welcome my new Magento DevChannel Youtube channel.

It took me a year before I promissed to start Video Blog back in January 2016 and actually made it in February 2017. In the first video I show How to Install Magento 2 with Sample Data via Command Line. We go through a set of commands required to download, install and configure Magento 2 on local environment.

As this is my first Magento tutorial video I am expecting feedback from you guys to adjust myself and the way I record video for the future. Leave the comments below or email me. Enjoy watching.

Prerequisites

You should have the following tools installed on your environment:

  1. PHP 5.6+, better to have PHP 7.0.x
  2. Apache2
  3. MySQL 5.6 or 5.7
  4. Composer

Commands for installing Magento 2

Create new directory:

$ mkdir magento2

Create new Magento 2 Community Edition project using composer:

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

Login to a MySQL console as root:

$ mysql -u root

Create new database:

$ create database magento2tutorial;

Create new database user with permissions for magento2tutorial database:

$ GRANT ALL PRIVILEGES ON magento2tutorial.* To 'magento2'@'localhost' IDENTIFIED BY '123123q';

Exit from database console:

$ exit

Change permissions for magento script:

$ chmod a+x bin/magento

Install Magento 2 via command line:

$ bin/magento setup:install --base-url=http://tutorial.magento2.dev --db-host=localhost --db-name=magento2tutorial --db-user=magento2 --db-password=123123q --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=123123q --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

Open an Apache2 httpd-vhosts.conf file:

$ sudo vi /etc/apache2/extra/httpd-vhosts.conf

Add new virtual host:

<VirtualHost *:80>
    ServerName tutorial.magento2.dev
    DocumentRoot "/Users/pronko/Sites/tutorials/magento2/pub"
    ErrorLog "/private/var/log/apache2/magento2-error_log"
    CustomLog "/private/var/log/apache2/magento2-access_log" common
    ServerAdmin user@example.com
</VirtualHost>

Open hosts file:

$ sudo vi /etc/hosts

Add new record with custom domain name:

127.0.0.1 tutorial.magento2.dev

Restart Apache2 server:

$ sudo /usr/sbin/httpd -k restart

Install Magento 2 Sample Data using the sampledata:deploy command:

$ bin/magento sampledata:deploy

Create new Public/Private Key from www.magento.com website and enter it when CLI will request Username and Password.

Run upgrade command to install Sample Data:

$ bin/magento setup:upgrade

Subscribe to my Channel

If you like my first video go ahead and subscribe to my Magento DevChannel Youtube channel.

magento 2 howto video

Share Article

Related Articles

Comments

Next Article Previous Article

Join Devletter Community

Subscribe to FREE Magento 2 tips and tutorials email I send every week.

I will send you my 3 best tutorials with interesting content immediately.

LinkedIn Twitter Facebook