Lately, I’m helping my wife set-up her first e-commerce site so got my hands dirty with Magento 2 (Community Edition) installation on Ubuntu (14.04.4 x64). I compiled these steps to serve as a guide for me or whomever tackling this type of installation process. This instruction assumes that you have a bare/clean Ubuntu server (14.04.4 x64) and you’re installing Magento 2 Community Edition On A LAMP server.
Login to your server.
I have a remote Ubuntu so I’m using Window’s Putty to connect from my Windows machine.
Install Apache 2.2 or higher server.
apt-get update
apt-get install apache2
To check if Apache is installed, direct your browser to your server’s IP address (eg. http://12.34.56.789). The page should display the words “It works!“. If you have a remote server, you can run the following command to reveal your server’s IP address.
ifconfig eth0 | grep inet | awk '{ print $2 }'
Install PHP 5.6 to ensure meeting Magento 2’s system requirement.
The last "apt-get” command below is a one line in the terminal.
apt-get -y update
add-apt-repository ppa:ondrej/php
apt-get -y update
apt-get -y install php5.6 php5.6-mcrypt php5.6-mbstring
php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl
Once the install finishes, run the following commands.
a2enmod rewrite
php5enmod mcrypt
service apache2 restart
Verify if PHP 5.6 is successfully installed.
php -v
Also to ensure that Apache is using the right PHP version (necessary in case of multiple PHP versions installed),
nano /var/www/html/info.php
This will open an editable window. Type this php code.
<?php
phpinfo();
Browse to http://{youserverip}/info.php and verify that Apache is using PHP 5.6.
Otherwise, checkout this blog on how to configure Apache to load the right version.
Install MySQL 5.6. Magento 2 requires version 5.6.
apt-get update
apt-get install mysql-server-5.6
Checkout this link for a more in-depth information about this step.
At this point, we now have a running LAMP system that meets Magento 2’s requirement. Next steps are the installation of Composer and Git. These softwares are used to pull/update the Magento 2 source code from the repo.
Continue to Part 2 ->