How to install OpenCart on a Linux Virtual Server

opencartOpenCart is an easy to use and search engine friendly open source PHP based online shopping cart for all Internet merchants who want to create their own online business and participate in e-commerce.

This install guide assumes that Apache, MySQL and PHP 5 are already installed and configured on one of our Linux Virtual Server hosting plans.

Open the PHP configuration file (php.ini) and check if ‘Register Globals’, ‘Magic Quotes GPC’ and ‘Session Auto Start’ settings are set to Off and the ‘File Uploads’ setting is set to On. In order to find the location of ‘php.ini’ configuration file, execute the following command:

# php -i | grep php.ini
 Configuration File (php.ini) Path => /etc
 Loaded Configuration File => /etc/php.ini

Also, make sure that PHP is compiled with the following extensions: MySQL, GD, cURL, mCrypt and ZIP.

Download OpenCart from the OpenCart website ( . At the time of writing this tutorial, the latest stable version is OpenCart

cd /var/www/html/
unzip v1.5.5*

Log in to the MySQL console and create a database called ‘opencartdb’, assign a user to it, and assign the user ALL Privileges:

mysql> create database opencartdb;
mysql> GRANT ALL PRIVILEGES ON opencartdb . * TO opencart@'localhost' IDENTIFIED BY 'xxxxxx' WITH GRANT OPTION;
mysql> flush privileges;

Do not forget to change ‘xxxxxx’ with your ‘opencart’ MySQL user password.
Alternatively, the MySQL database for the OpenCart shopping cart system can be created using phpMyAdmin.

Execute the following commands:

mv opencart- opencart
chgrp apache -R opencart/
cd opencart
mv upload store
cd store
mv config-dist.php config.php
mv admin/config-dist.php admin/config.php

Make sure the following files and directories are writable for your web server user:


Open http://<>/opencart/store/ in your favorite web browser, follow the onscreen instructions and complete the installation.

opencart installation - step2

Do not forget to delete the install directory after the installation is complete for security reasons.

The administrator back-end is now available at http://<>/opencart/store/admin/

Of course, if you are one of our Linux VPS customers, you don’t have to do any of this, simply ask our admins, sit back and relax. Our admins will install it for you immediately. You may also refer to our guide on How to Install OpenCart on Ubuntu 18.04.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment

To prove you are human please solve the following *