How to Install Opencart

Added on June 19, 2019

Learn how to install Opencart on your web hosting account using cPanel

Installing Opencart for the first time is a fairly simple process. The instructions only apply to a brand new install and are not to be used for any sort of an Opencart upgrade process.

Requirements

1) Domain Name

2) Web Hosting Plan

Optional

1) FTP Program

To get started, you'll need to download the current Opencart Zip file located at https://www.opencart.com/index.php?route=cms/download

Create a Database and a Database User

Next, you'll want to login to your cPanel account and create a new database and a database user. When choosing a database user password, please use the password generator and copy the password in a safe place. You'll need this one time during the install and likely won't need it again thereafter.

After you've created the Database and the Database User, you'll need to 'add the user to the database' and choose 'All Privileges' during the process.

We have a more detailed explanation available in our Knowledgebase found here: Database Tutorial

Upload Zip File to Web Server

Now it's time to upload the Zip File that you downloaded earlier from the Opencart website. There are a couple of ways to do this:

a) Using File Manager with cPanel

b) Using an FTP program

While we constantly use an FTP program, we actually suggest using File Manager in this instance.

Using File Manager

Once you're logged into cPanel, you'll find an icon for File Manager (usually located near the top of your screen). Click it and File Manager will open in a new tab or window.

Next, choose the location where you want to have your store located. For most, this is in public_html/ or var/www/html (depending on your hosting provider's configuration). If you've created a sub folder or sub domain, navigate to that location in File Manager.

Next, click the upload button and select the Zip File from your hard drive to upload to the web server. Once the upload is completed, click to highlight the uploaded file and then click extract. Use the default location suggested to unzip the files.

After the Zip file is extracted, you'll need to 'select all' and move the files up one level. If you're not already showing 'hidden files' within File Manager, make sure to check the box to do so. This allows you to also select the file .htaccess.txt and move it along with the other selected files. Any other 'hidden files' don't need to be moved.

Now, for the sake of cleaning up and removing un needed files / folders, select the following files and folders and delete them:

  • The original Zip file(opencart-version.zip)
  • The folder named 'upload' (This folder should now be emtpy after you've moved all of the contents 'up one level' from the instructions above.
  • build.xml
  • CHANGELOG_AUTO.md
  • CHANGELOG.md
  • composer.json
  • composer.lock
  • install.txt
  • license.txt
  • README.md
  • upgrade.txt

The last step is to rename config-dist.php and admin/config-dist.php to config.php and admin/config.php . These files are in the download as config-dist.php to prevent those who are upgrading from accidentally overwriting their existing config.php files.

Using an FTP Program

This process takes a bit longer than using the File Manager method and you'll see why in a moment.

Start out by making sure you've got an FTP program and you're able to connect to your web hosting server. Once connected, navigate to the location you want to install Opencart in. For most, this is in public_html/ or var/www/html (depending on your hosting provider's configuration). If you've created a sub folder or sub domain, navigate to that location within your FTP connection.

Now it's time to locate the Zip File on your local Hard Drive and extract it locally before uploading to the web server. Once extracted, make sure you're showing 'Hidden Files' so that you can upload the .htaccess.txt file found in the 'upload' folder. Once this file is uploaded, you may go back to not showing the 'Hidden Files' and continue uploading the following folders and files:

Folders

  • admin
  • catalog
  • image
  • install
  • system

Files

  • config-dist.php
  • index.php
  • php.ini

The last step is to rename config-dist.php and admin/config-dist.php to config.php and admin/config.php . These files are in the download as config-dist.php to prevent those who are upgrading from accidentally overwriting their existing config.php files.

Executing the Install Process

To begin, open your web browser and go to yourdomain.com/install or yourdomain.com/sub-folder/install (wherever you uploaded the files to) and you'll see the setup screen. Fill in all fields and go through each step. This is where you'll need to enter the database name, database username and password all created earlier.

For security purposes, do not choose the username 'admin' and use a strong password. Here's a site where you can generate a strong random password: https://www.avast.com/en-us/random-password-generator

Once the install process is successfully completed, you'll need to delete the install folder using File Manager or FTP.

Your Opencart store has been installed and you're ready to begin adding products and designing your Opencart storefront.