Installation Steps of OpenCart 2.0 on CentOS 7

OpenCart is a Open source e-commerce software that allows us to build or create our own online store free of cost. Opencart is also known as shopping cart which is based on PHP. In this post we will discuss the installation steps of OpenCart on CentOS 7.x.Before starting the installation following should be installed on your Linux system.

  • PHP
  • Database Server ( MySQL / MariaDB )
  • Web Server ( Apache )

In my case php, database server and Web server are already installed on my linux system. If in case they are not installed then use the yum command to install these packages.

Install the required PHP extension for Opencart Installation :

[root@linuxtechi ~]# yum install php-mysql php-gd php-curl php-pecl-zip

Create Database and user for OpenCart :

connect to mysql console , run the following commands

mysql> create database shoppingcart_db;
Query OK, 1 row affected (0.01 sec)

mysql> create user 'shopuser'@'localhost' IDENTIFIED BY 'cart@123#';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON shoppingcart_db.* TO 'shopuser'@'localhost';
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)


Restart Web Server Services :

[root@linuxtechi ~]# systemctl restart httpd.service
Download the latest version of OpenCart( using wget Command
[root@linuxtechi ~]# wget
[root@linuxtechi ~]# unzip
[root@linuxtechi ~]# ls -ld opencart-
drwxr-xr-x. 3 root root 4096 Mar 30 13:52 opencart-
[root@linuxtechi ~]# ls -l opencart-
total 64
-rw-r--r--. 1 root root 2106 Mar 30 13:52 build.xml
-rw-r--r--. 1 root root 2256 Mar 30 13:52
-rw-r--r--. 1 root root 2577 Mar 30 13:52 install.txt
-rw-r--r--. 1 root root 34529 Mar 30 13:52 license.txt
-rw-r--r--. 1 root root 3042 Mar 30 13:52
-rw-r--r--. 1 root root 5897 Mar 30 13:52 upgrade.txt
drwxr-xr-x. 7 root root 4096 Mar 30 13:52 upload
[root@linuxtechi ~]#

Create opencart directory under /var/www/html and sync or copy all the files of upload folder to opencart folder using rsync command

[root@linuxtechi ~]# mkdir /var/www/html/opencart
[root@linuxtechi ~]# rsync -Waq opencart-* /var/www/html/opencart/
Set the Required Permissions
[root@linuxtechi ~]# chown -R apache /var/www/html/opencart/
[root@linuxtechi ~]# cd /var/www/html/opencart/
[root@linuxtechi opencart]# mv config-dist.php config.php
[root@linuxtechi opencart]# chmod 755 config.php
[root@linuxtechi opencart]# cd admin/
[root@linuxtechi admin]# mv config-dist.php config.php
[root@linuxtechi admin]# chmod 755 config.php

At this point of time command line installation task is completed. Now open the web browser , type : “http://<IP_Address/FQDN_of_Your_System>/opencart” to Start the Graphical Installation .

Step:1 Accept the “License agreement”, click on continue…


Step:2 At this stage installer checks whether Web server meets all the technical requirements or not. It will also check for the required permissions.


Click on Continue…

Note : In case if you are getting this “Warning: mCrypt extension needs to be loaded for OpenCart to work!” , mCrypt is a PHP extension which is not available in the default yum repository of CentOS 7.x ,so to resolve this issue follow the below Steps :

Go to the tmp directory and run the following commands :

[root@linuxtechi tmp]# wget
[root@linuxtechi tmp]# yum install php-mcrypt
[root@linuxtechi tmp]# systemctl restart httpd.service
Step:3 Define the Database connection details along with the user name and password for admin access on opencart.


Click on continue….

Step:4 Installation Finished, delete your installation directory

Installation-complete -opencart
Go to opencart directory , delete the install folder using rm command as shown below :

[root@linuxtechi opencart]# rm -rf install

Step:5 Login to OpenCart Admin Panel

Open the Web Broswer type :

Replace the ip address according to your setup. Enter the admin credentials that we have set in above steps.


After entering the credentials , OpenCart Admin Dashboard will open as shown below :


OpenCart installation is completed Now. Your online store is ready, enjoy and have fun 🙂

Share on:

I am a Cloud Consultant with over 15 years of experience in Linux, Kubernetes, cloud technologies (AWS, Azure, OpenStack), automation (Ansible, Terraform), and DevOps. I hold certifications like RHCA, CKA, CKAD, CKS, AWS, and Azure.

3 thoughts on “Installation Steps of OpenCart 2.0 on CentOS 7”

  1. Thanks for the nice writeup. It was helpful.

    I faced some issues with the file permissions. It was saying config.php as unwritable
    If you are not able to proceed because of correct permissions of the files, then try to disable selinux and restart the server. It worked for me.

  2. Thanks for sharing this helpful guide, I was having an issue while installing Opencart through SSH, Your guide helped me a lot and here’s another guide from where I got help, ‘’, Hope, it will help your readers as well.


Leave a Comment