OpenCart is a popular free platform for small and medium online shops. It is light, easy to install and ships with a catalogue, cart, orders and payment modules. But a store is not a brochure site: it stores customer names, phone numbers, addresses and order history. A few security steps need to happen on day one, or a breach will cost you customer trust as well as the site.
Example: a cosmetics shop in Tashkent
A small Tashkent cosmetics shop launches on OpenCart at misol.uz. The developer ships quickly and hands over the store. Months later an unknown user appears in the admin panel and foreign links show up in product descriptions. The investigation finds the install folder still present, the admin URL unchanged and a hidden file inside a free theme downloaded from a forum. Everything below is aimed at preventing exactly that.
First steps after installation
Delete the install directory and make the configuration files, which contain the database password, read-only:
rm -rf install/
chmod 444 config.php admin/config.php
curl -I https://misol.uz/install/
The last command should return 404. When you need to change settings later, switch back to 644 temporarily.
Hide and restrict the admin panel
Bots probe /admin first. OpenCart 4 shows a security notice on first login offering to rename the admin folder; on older versions you rename it manually and update the paths in admin/config.php, after taking a backup. More important still are strong passwords and user groups: give each employee their own account with access only to what they need. If staff work from a fixed IP address, restrict the admin folder by IP at server level.
Move storage out of the web root
The storage directory holds cache, sessions, downloadable product files and error logs. Inside the web root, a server misconfiguration could expose logs or paid downloads. OpenCart 4 offers to move it via the same notice; on version 3 it sits in system/storage and should be moved by hand.
/home/dokon/public_html/ # OpenCart files
/home/dokon/storage/ # storage, not web accessible
// in config.php and admin/config.php
define('DIR_STORAGE', '/home/dokon/storage/');
Then try opening the error log in a browser: you should get 403 or 404, never the file content.
No PHP in the image folder
Product images go into image through the built-in file manager, which makes it the first place an attacker tries to drop a script:
# image/.htaccess
<FilesMatch "\.(php|phtml|phar|php[0-9])$">
Require all denied
</FilesMatch>
Extensions and themes
Extensions are OpenCart's strength and its biggest risk. Use the official marketplace or trusted developers, never install "free" copies of paid modules, back up before every OCMOD change, remove extensions you no longer use and keep the rest updated. A vulnerable old module leaves the store open even on the latest OpenCart.
Hide errors and keep card data off the server
In the Server tab of the settings, turn off displaying errors and keep logging enabled, then review the log regularly. For payments, the safest approach is not to collect card details on your site at all: gateways such as Click or Payme use their own page or form, so card numbers never reach your server. Always run the shop over HTTPS; on sayt.uz hosting the free Let's Encrypt certificate renews automatically.
Backups and routine checks
Back up the database daily and the files before every major change. Once a month review admin users, installed extensions and recently modified files. It takes under an hour and catches problems before customers do. Keep at least one recent backup outside the hosting account, so a compromised server cannot take your only copy with it.