You can run OpenCart on HostGator in about fifteen minutes using the Softaculous installer in cPanel, or in about an hour if you prefer a manual upload that gives you control over folder placement and PHP settings. Shared hosting is fine for a small catalog; once you add several thousand products, heavy extensions, or real traffic, a HostGator VPS is the sensible next step. This guide covers both install paths, the post install hardening OpenCart expects, cron, SSL, and how to keep the store fast and upgradable.
install folder, move the storage directory outside public_html, switch the store URL to https, and add a cron job for the OpenCart scheduler.OpenCart 4.x runs on any HostGator plan that includes cPanel, from the Hatchling, Baby and Business shared tiers up to VPS and dedicated servers. The sections below assume a shared plan and note where a VPS changes the picture.
Check the OpenCart 4.x requirements against your plan
The official OpenCart system requirements list an Apache web server (recommended), PHP 8.0 or later, and a database that supports MySQLi or PDO (MySQL and MariaDB both work, with MySQLi preferred). The PHP extensions OpenCart checks for during installation are cURL, GD, iconv, mbstring, OpenSSL, ZipArchive and zlib. HostGator’s shared servers ship all of these on their default PHP builds, so on shared hosting the only thing you normally have to touch is the PHP version.
| Requirement | OpenCart 4.x needs | Where to set it on HostGator |
|---|---|---|
| PHP version | 8.0 or later (use 8.1 or newer for current 4.1.x releases) | cPanel > Software > MultiPHP Manager |
| PHP extensions | curl, gd, iconv, mbstring, openssl, zip, zlib | cPanel > Software > Select PHP Version (shared), WHM EasyApache (VPS) |
| Database | MySQL or MariaDB via MySQLi | cPanel > Databases > MySQL Database Wizard |
| PHP limits | memory_limit 256M, upload_max_filesize 64M or more for image imports | MultiPHP INI Editor or a php.ini in public_html |
| HTTPS | Required for checkout and most payment gateways | cPanel > Security > SSL/TLS Status (AutoSSL) |
To set the PHP version, open cPanel, search for MultiPHP Manager, tick your domain, choose PHP 8.1, 8.2 or 8.3 from the dropdown and click Apply. Then open Select PHP Version and confirm that curl, gd, mbstring, zip and iconv are checked. Do this before installing, because the OpenCart installer runs its own compatibility check and will refuse to continue if anything is missing.
Option A: Install OpenCart with Softaculous in cPanel
HostGator includes Softaculous on its cPanel plans, and it is the fastest way to get a store up. The process mirrors the one HostGator documents for its Softaculous auto installer.
- Log in to cPanel and scroll to the Software section, then click Softaculous Apps Installer.
- Search for OpenCart in the left hand box and click Install Now.
- Choose the version (pick the newest 4.x build offered), set the protocol to https://, pick your domain, and leave the In Directory field empty so the store lives at the site root. Type a subfolder such as
shoponly if the domain already hosts something else. - Fill in the store name, admin username, a strong password and your email. Change the default admin username; do not leave it as
admin. - Expand Advanced Options if you want a custom database name and prefix, and enable automated backups.
- Click Install. Softaculous creates the database, uploads the files, runs the installer and emails you the admin URL.
Softaculous creates the database and deletes the install folder, but it does not move the storage folder out of the web root; that manual step is covered below. The cPanel side of the flow is the same one we use in our guide to managing WordPress plugins from cPanel.
Option B: Manual install from the official download
A manual install takes longer but gives you the exact release you want, and it mirrors what you will do later for upgrades.
- Download the latest 4.x zip from the OpenCart GitHub releases page or opencart.com. Upload the zip to
public_htmlwith cPanel File Manager and extract it there. The archive contains anuploadfolder; move its contents intopublic_htmland delete the empty wrapper. - Rename
config-dist.phptoconfig.phpin the site root and again inside theadminfolder. - In cPanel, open MySQL Database Wizard, create a database and a user, and grant the user All Privileges. Note the full prefixed names (HostGator prefixes them with your cPanel username).
- Visit your domain in a browser. The installer walks through the license, the requirements check, and the database and admin details.
- When it finishes, delete the
installdirectory.
Over SSH (enabled from the cPanel SSH Access page), the equivalent steps are:
cd ~/public_html
unzip opencart-4.1.0.3.zip
mv upload/* upload/.htaccess.txt .
rmdir upload
mv config-dist.php config.php
mv admin/config-dist.php admin/config.php
mv .htaccess.txt .htaccess
chmod 660 config.php admin/config.phpPost install hardening: storage folder, admin folder, permissions
OpenCart 4 puts cache, logs, sessions and uploaded files under a system/storage directory. The installer and the admin dashboard both nag you to move it outside the web root so those files cannot be fetched over HTTP. On HostGator the natural home is one level above public_html, in your account’s home directory.
The easiest way is the built in notice: log in to admin, and if the storage warning appears at the top, click the Move button and let OpenCart relocate the folder and rewrite both config files. If you prefer to do it by hand, move the folder and then update the DIR_STORAGE constant in both config.php and admin/config.php:
mv ~/public_html/system/storage ~/storage
# then in config.php and admin/config.php:
define('DIR_STORAGE', '/home/YOURCPANELUSER/storage/');DIR_STORAGE produces a blank white page on both the storefront and admin, and the only way to recover is to correct the constant in File Manager.Two more cheap wins: rename the admin folder to something unguessable (and update HTTP_SERVER in admin/config.php to match), and keep permissions at 644 for files and 755 for directories. Never use 777; HostGator runs PHP as your user, so it gains nothing and exposes files to other tenants.
SSL, store URLs and the cron job
HostGator provisions a free AutoSSL certificate for every domain pointed at the account. Check it under SSL/TLS Status in cPanel; if the domain shows a green check mark, you are covered. Then make the store use it. In OpenCart 4, both config.php and admin/config.php have an HTTP_SERVER constant; set it to the https version of your URL. Add a redirect in .htaccess so any http visit is bounced to https:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]OpenCart 4 also has an internal scheduler (currency updates, subscriptions, some extension tasks) that expects a system cron to call it. In cPanel, open Cron Jobs, pick an interval such as every fifteen minutes, and add a command like this, using the token shown on the admin Maintenance > Cron Jobs page:
*/15 * * * * wget -q -O /dev/null "https://www.example.com/index.php?route=cron/cron&cron_token=YOURTOKEN" >/dev/null 2>&1Performance: shared hosting versus a HostGator VPS
A small OpenCart store with a few hundred products runs acceptably on a HostGator shared plan. What slows it down is database heavy work: large filtered category pages, multi store setups, and extensions that add joins to every product query. Shared plans also cap PHP processes and CPU time per account, so a traffic burst can push you into throttling.
Things you can do on shared hosting before upgrading:
- Enable OpenCart’s image cache (it is on by default) and keep product images sized sensibly; a 4000 pixel photo resized on every request is a CPU sink.
- Turn on Compression in System > Settings > Server (a value of 5 or 6 is plenty) and make sure browser caching headers are present in
.htaccess. - Use a CDN such as Cloudflare in front of the store so static assets do not touch the origin.
Move to a VPS when you see recurring 503 errors, when the cPanel Resource Usage page shows CPU or entry process limits being hit, or when you need PHP FPM tuning, OPcache control, Redis for sessions, or a dedicated MySQL configuration. A HostGator VPS gives you WHM and root for all of that. If you are comparing cPanel hosts for online store platforms, our walkthrough on installing Bagisto on GoDaddy shows how similar the steps are across providers.
Upgrading OpenCart without breaking the store
OpenCart 4 includes an upgrade routine, but treat every upgrade as a small project and read the release notes first. Then:
- Take a full backup: cPanel Backup for files and a phpMyAdmin export (or
mysqldumpover SSH) for the database. - Test on a staging copy. HostGator lets you create a subdomain such as
staging.example.compointed at a separate folder; clone the store there, point a copied database at it, and upgrade the clone first. - Upload the new release files over the existing ones, excluding
config.php,admin/config.php, theimagefolder and your relocated storage folder. - Run
https://www.example.com/install/, choose Upgrade, and follow the prompts. Delete theinstallfolder afterward. - Reinstall any theme or extension that was overwritten, then clear caches from Dashboard > Developer Settings.
Extensions written for OpenCart 3 do not work on 4; check the vendor’s compatibility line before a version jump.
Troubleshooting
Softaculous install fails with “PHP version not supported”
The domain is still on an older PHP version. Change it in MultiPHP Manager, wait a minute for the change to propagate, and restart the Softaculous wizard. Check the PHP version Softaculous reports at the top of the install form before you submit.
Blank white page after install or after moving storage
Almost always a bad DIR_STORAGE path or a missing storage folder. Enable error display temporarily by setting display_errors=On in MultiPHP INI Editor, reload, and the message will name the path. Fix the constant in both config files.
Admin login loops back to the login page
Sessions cannot be written. Confirm the storage/session directory exists and is writable by your user, and that session.save_path in PHP settings is not pointing at a directory outside your account. Also check that HTTP_SERVER in admin/config.php uses the same scheme and hostname you are browsing with.
Product images are broken after enabling https
The image cache was generated with http URLs. Clear the image cache from Dashboard > Developer Settings, then hard refresh. If images still fail, verify HTTP_SERVER in config.php is https and that .htaccess is not double redirecting.
500 error on category pages under load
Shared plan resource limits. Check Resource Usage in cPanel. Reduce the number of products per page, disable filter extensions that scan the whole catalog, add Cloudflare caching, and if the limits keep tripping, move to a VPS.
Frequently asked questions
Which HostGator plan should I pick for OpenCart?
Any cPanel shared plan runs OpenCart, and the Baby or Business plans are a sensible start because they allow multiple domains and include a free SSL certificate. Choose a VPS once you need Redis, custom PHP FPM tuning, or you routinely hit the CPU and entry process limits shown on the cPanel Resource Usage page.
Is OpenCart 4 compatible with PHP 8.3 on HostGator?
The official requirement is PHP 8.0 or later, and the current 4.1.x line runs on PHP 8.1 through 8.3 in practice. The safe move is to install on 8.2 or 8.3, then confirm each extension you add lists support for that version, because third party modules lag the core.
Do I have to move the storage folder?
The store works without moving it, but OpenCart warns you on every admin page until you do, and leaving logs, sessions and cache inside the web root is a real security exposure. Use the Move button in the admin notice or edit the DIR_STORAGE constant by hand. It takes two minutes.
Can I run OpenCart and WordPress on the same HostGator account?
Yes. Install OpenCart at the root of one domain or in a subfolder and WordPress on another domain or subfolder in the same cPanel account. They use separate databases and do not interfere. If you are testing locally first, our guide to installing WordPress on XAMPP uses the same PHP and MySQL stack.
The bottom line
Running OpenCart on HostGator is straightforward: set PHP to 8.1 or newer, install with Softaculous or by hand, move the storage folder, force https, and add the cron job. Those five steps cover almost everything that separates a fragile install from a solid one.
Start on a shared plan, watch the Resource Usage page as the catalog grows, and migrate to a VPS when the numbers tell you to rather than on a guess. Keep backups current and stage every upgrade, and the store will keep running with very little attention.

