cPanel

Install OpenCart on cPanel hosting (manual install)

Install OpenCart manually on cPanel: prepare PHP, create the database, upload the upload folder contents, run the installer, then secure the admin, storage folder and config files.

IntermediatecPanel hosting3 min read

OpenCart is a lightweight open-source shopping cart that runs well on standard PHP hosting. This guide shows how to install OpenCart on cPanel manually and lock it down after installation.

Before you start

  • A cPanel account, a domain with SSL active, and the OpenCart release ZIP from the official site.
  • The release's PHP requirements (OpenCart 4 needs a newer PHP than 3.x).

Prepare PHP

  1. In cPanel → Software → Select PHP Version, choose a supported version.
  2. Enable curl, gd, zip, mbstring, mysqli, zlib and opcache.
  3. Set memory_limit to 256M and upload_max_filesize to 16M or more under Options.

Create the database

In cPanel → Databases → Manage My Databases, create a database and a user, and add the user to the database with all privileges.

Upload the files

  1. Extract the ZIP on your computer. Only the contents of the upload folder are needed.
  2. Upload those contents to public_html (or your domain's root) with File Manager or SFTP. Uploading a ZIP of them and extracting in File Manager is fastest.
  3. Rename the config files:
    • config-dist.php → config.php
    • admin/config-dist.php → admin/config.php

Run the installer

  1. Browse to https://example.com/install/.
  2. Accept the licence. The pre-installation check must show all green; fix anything red in cPanel and refresh.
  3. Enter the database details: driver MySQLi, hostname localhost, the full database user and name, and a table prefix (oc_ by default).
  4. Create the admin username, password and email.
  5. Finish, then delete the install folder in File Manager.

Secure OpenCart

  • Move the storage folder: OpenCart's dashboard shows a notice to move system/storage outside the web root. Use the built-in button (OpenCart 4) or move it manually to e.g. /home/USER/storage/ and update DIR_STORAGE in both config files.
  • Rename the admin folder (supported in OpenCart 4 via the dashboard notice); update paths in admin/config.php if done by hand.
  • Protect config files: set config.php and admin/config.php to 444 or 644 so they are not writable.
  • Enable SSL: in System → Settings → Server set Use SSL and make sure the config URLs use https://.
  • Install only trusted extensions and keep OpenCart updated.

Post-install settings

  • SEO URLs: rename .htaccess.txt to .htaccess, then enable SEO URLs in System → Settings → Server.
  • Mail: choose SMTP under System → Settings → Mail with a cPanel mailbox.
  • Cron: OpenCart 4 has a cron URL under Extensions → Cron Jobs; add it in cPanel → Advanced → Cron Jobs.

Troubleshooting

  • Blank page or 500 error: check error_log and the storage logs folder; usually a PHP version mismatch.
  • Installer says config.php is not writable or missing: rename the -dist files and set them to 644 during install.
  • Images or styles missing after enabling SSL: update HTTP_SERVER in the config files to https://.
  • Admin login refreshes without logging in: session or cookie domain issues; clear cookies and confirm the URL matches the config.

OpenCart FAQ

Can I install OpenCart with Softaculous?

Yes, if Softaculous offers it on your server; it automates these same steps.

OpenCart 3 or 4?

Choose OpenCart 4 for new shops unless an extension you rely on only supports 3.x.

Is OpenCart suitable for large stores?

It handles small to medium catalogues well; for very large stores consider a VPS and caching.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.