Tag: Magento 2 developer

How to install Magento 2.0 on Digital Ocean or Ubuntu 14.04

Digital Ocean is founded in 2011. This is a great VPS hosting service provider for developer. Globo Software Solution JSC is also using Digital Ocean for Magento web development. Magento 2.0 has just released in November, 2015. Today, I’m going to instruct you how to install Magento 2.0 on Ubuntu 14.04. My droplet is 2 GB Ram and 40 GB disk because my company is developing about 20 Magento ecommerce websites in the droplet. But for you, I recommend to start a droplet with 1 GB Ram and 30GB dick. It is enough for development purposes.

Before follow the tutorial, your VPS must be installed: Ubuntu, LAMP, phpMyAdmin. You can read how to install those by read bellow tutorial:

Alright, now let’s start step by step to install magento 2.

Step 1: Install all Required tools, libraries, Other Preliminaries

  1. Install Git
    To install git, run the command:

    sudo apt-get install git

    In order to use git with GitHub (required for your Magento2 installation), you will need to key an SSH key pair as follows:

    ssh-keygen -t rsa

    Press Enter to save the file. Then, run the following commands to navigate to your new key file and view its contents:

    cd /root/ssh
    cat id_rsa.pub

    You have to copy the key to clipboard and add the SSH key to GitHub.If you don’t know how to add SSH key, just do follow step: Go to your GitHub -> click to your profile account in top right -> click to Settings -> click to SSH keys in left side bar. From there, you can add the copied SSH key to GitHub
    Add SSH key to GitHub

  2. Install Composer:
    To install Composer, create an empty directory and switch to it. In the root folder:

    mkdir composer
    cd composer
    curl -sS https://getcomposer.org/installer | php
    mv composer.phar /usr/local/bin/composer

  3. Generate your GitHub access token for Composer:
    Login to your GitHub, then to go setting and click Personal access tokens > Click to Generate new token > Copy the token to clipbroad.
    Generate token github
    To set the Git authorization token in Composer, type:

    composer config -g github-oauth.github.com YourToken/em>

  4. Enable ext-mcrypt:

    php5enmod mcrypt

  5. Install ext-intl:

    apt-get install php5-intl

  6. Install ext-intl:

    sudo apt-get install php5-xsl

Step 2: Clone Magento 2.0 from GitHub

To clone Magento 2 repository, you have to copy SSH clone URL from Magento 2 in GitHub. You can found the SSH clone URL from here: https://github.com/magento/magento2
Clone Magento2 from Github

Now you have to go to directory where you will install Magento2. It is often /var/www/html/ or /var/www/.

cd /var/www/html/magento2

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

Step 3: Install with Composer

Ensure that you are in directory /var/www/html/magento2/

composer install

Step 4: Set permission for Apache(www-data) user

Ensure that you are still in directory /var/www/html/magento2/. Or not, don’t do the command

chown -R www-data:www-data *

Step 5: Create database and user

Now, you have to using phpMyAdmin to create database and user.

  1. Login to your phpmyadmin: http://YourDropletIPAdress/phpmyadmin
  2. Create mysql Database: create mysql database for magento 2
  3. Create mysql User
    Screenshot at Jan 10 21-37-18
    Set permission for the user
    Screenshot at Jan 10 21-39-02

Step 6: Run Magento installion

Now go to your browser and access to your magento2 directory. For me it is http://YourDropletIPAdress/magento2/