Apache · Apache 2.4 · e-Commerce · LAMP · OpenCart · Web Server

Installing OpenCart on Ubuntu 14.04

OpenCart is an Open Source e-commerce application based on PHP. Opencart requires Apache, MySQL and PHP. Let us look at how to install OpenCart 2.1.0 on Ubuntu 14.04, in this article.

Update the package list and upgrade the packages.

apt-get update && apt-get dist-upgrade

Reboot the machine if kernel is upgraded.


Install LAMP server using the following command.

apt-get install lamp-server^

Install the other dependencies needed.

apt-get install php5-gd php5-curl php5-mcrypt unzip

Enable the PHP module ‘mcrypt’ using the following command.

php5enmod mcrypt

Download OpenCart package on the present directory.

wget https://github.com/opencart/opencart/archive/

Extract the package in the present location.


The directory extracted will be similar to ‘opencart-’. Now move the files inside this directory to ‘/var/www/html’.

mv opencart-* /var/www/html/

Change directory to ‘/var/www/html’.

cd /var/www/html

Rename the file ‘config-dist.php’ to ‘config.php’.

mv config-dist.php config.php

Change the ownership of all the files in the present directory to www-data:www-data.

chown -R www-data:www-data /var/www/html

Now let us create a database and related user.

mysql -uroot -p
mysql> create database opencart;
mysql> GRANT ALL ON opencart.* TO 'opencartuser'@'localhost' IDENTIFIED BY 'opencartpassword';
mysql> quit

The installation can be started by using the following URL on the browser.


Complete the installation through the web pages. Once the installation is complete remove the install directory.

rm -rf install

Here you go. You OpenCart installation is done.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s