r4pt3r-blog

Home Projects AboutRSS

Installing Magento 2

  • magento-2,
  • web-framework,
  • e-commerce,
  • web-devolpment

How to install Magento 2 on Ubuntu

What is Magento ?

Magento is a web framework for e-commerce websites. Magento have two versions which are Magento 1.x and Magento 2.x. Magento 2.x is having more cool features.

System requirements

  • Apache 2.2 or 2.4
  • Nginx 1.x
  • MySQL 5.6, 5.7
  • PHP 7.1.3+, 7.2.x

Follow with the commands

Update all the packages

 sudo apt-get update

Install PHP MySQl and all other extensions

sudo apt-get install apache2 php libapache2-mod-php mysql-server php-mysql php-dom php-simplexml php-curl php-intl php-xsl php-mbstring php-zip php-xml composer
sudo apt-get install php7.2-gd
sudo apt-get install php7.2-mcrypt
sudo apt-get install php-soap
sudo a2enmod rewrite

Go inside Apache2 config files and search for Indexes, then change AllowOverride from ‘none’ to ‘all’

sudo vim /etc/apache2/apache2.conf

Then restart Apache

systemctl restart apache2.service

Go inside the /var/www/html clone the Magento 2 files

sudo git clone https://github.com/magento/magento2.git
cd magento2
composer install

If composer install shows any errors it maybe missing of any php extensions, then just try once more after installing those php extensions.

Change permissions

sudo chown -R www-data:www-data .

Now the Magento 2 is installed. Now you can check your localhost and configure Magento 2. You have to make a database for Magento 2. Intsalling instructions will guides you further.