# Installing OpenCart on Hosting: Step by Step for 3.0 and 4.1

> Step-by-step guide to installing OpenCart 3.0 and 4.1 on hosting: requirements, uploading files, database, installer and security after launch.

Джерело: https://opencartcode.com/en/wiki/basics/opencart-installation
OpenCart: 3.0, 4.1
Оновлено: 2026-11-24

Installing OpenCart on hosting takes 15–30 minutes: you need to upload the files, create a MySQL database, and complete the web installer. The key is to choose a [PHP version](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#php-version) compatible with the OpenCart branch you're using in advance, and after installation, remove the install folder and move the storage directory outside public access.

Examples are for OpenCart 4.1; in 4.0.x, model triggers and event handling differ.

## What do you need before installing OpenCart?

First, determine the version. The current releases are OpenCart 3.0.5.x and 4.1.0.x. [Version 3.0](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#version-30) has the most ready-made modules and themes, while 4.1 has a newer architecture, but some extensions are not yet adapted. For more on choosing, read the article about the platform's strengths and weaknesses: [Why OpenCart: Strengths and Weaknesses](https://opencartcode.com/en/wiki/start/opencart-pros-and-cons).

Next, check your hosting. Approximate requirements:

| Parameter | OpenCart 3.0 | OpenCart 4.1 |
| --- | --- | --- |
| PHP | 3.0.5.1 — PHP 8.1 or newer; 3.0.4.1 — PHP 7.3 or newer (including 7.4) | 8.1 or newer for 4.1.0.x |
| Database | MySQL 5.7+ or MariaDB | MySQL 5.7+ or MariaDB |
| PHP extensions | curl, gd, mbstring, zip, zlib, mysqli, openssl | curl, gd, mbstring, zip, zlib, mysqli, openssl |
| Web server | Apache with mod_rewrite or Nginx | Apache with mod_rewrite or Nginx |

See the README file and the release page for exact requirements, as they change between minor versions. Also prepare: a domain pointed to your hosting, an SSL certificate (free Let's Encrypt on most hosts), and access to the control panel (cPanel, ISPmanager, DirectAdmin) or via FTP/SSH.

> Plan your budget for hosting, domain, and modules in advance: see the calculation in the article [how much an online store on OpenCart costs](https://opencartcode.com/en/wiki/economics/how-much-does-an-online-store-cost).

## Where to get the distribution and how to upload files to hosting?

Download the archive only from official sources: the opencart.com website or the official repository on GitHub. Builds from third-party sites often contain hidden backdoors — this is the most common way to hack a store before it even launches.

### OpenCart 3.0: what's inside the archive

Unpack the archive on your computer. You need the `upload` folder: its contents are copied to the site's root directory (usually `public_html` or `www/домен`). In both branches (3.0 and 4.1), before running the installer, rename `config-dist.php` to `config.php` and `admin/config-dist.php` to `admin/config.php` and give them write permissions.

### OpenCart 4.1: what's inside the archive

The structure is similar: the contents of `upload` go to the site root, and before running the installer, likewise rename `config-dist.php` to `config.php` and `admin/config-dist.php` to `admin/config.php`. In both branches (3.0 and 4.1), the `system/storage` directory should be moved outside `public_html`, and the `.htaccess.txt` file should be renamed to `.htaccess` for [SEO-friendly URLs](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#seo-friendly-urls).

It's most likely faster to upload the archive as a single file via the hosting file manager and extract it on the server than to transfer thousands of small files over FTP. If you have SSH:

```bash
cd ~/www/example.com
unzip opencart-4.1.0.4.zip -d /tmp/oc
cp -r /tmp/oc/upload/* .
cp /tmp/oc/upload/.htaccess.txt .htaccess
mv config-dist.php config.php
mv admin/config-dist.php admin/config.php
```

For a detailed explanation of the directories' purposes, see the article [file structure of OpenCart 3.0 and 4.1](https://opencartcode.com/en/wiki/dev-architecture/opencart-file-structure).

## How do you create a database for OpenCart?

In your hosting control panel, open the "MySQL Databases" section and create:

1. a new database with `utf8mb4` encoding (collation `utf8mb4_general_ci`);
2. a separate user with a strong password (do not use your hosting account for this);
3. privileges for the user on this database — "All".

Write down four values: the host (most often `localhost`), the database name, the username, and the password. On some hosts, your account prefix is automatically added to the database name, for example `user_shop` — you must enter the full name with the prefix in the installer.

If you create the database via the console, the commands look like this:

```sql
CREATE DATABASE shop CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'shop_user'@'localhost' IDENTIFIED BY 'СкладнийПароль';
GRANT ALL PRIVILEGES ON shop.* TO 'shop_user'@'localhost';
```

Leave the [table prefix](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#table-prefix) (the "Prefix" field in the installer) as `oc_` if the database contains only one store. Change it only when several sites share one database.

## How do you go through the OpenCart web installer?

Open the address `https://ваш-домен/install` in your browser. For 4.1, the address is the same — `/install`.

1. **License.** Accept the terms and click "Continue".
2. **Requirements check.** The installer shows the PHP version, extensions, and write permissions. Red items must be fixed before proceeding.
3. **Database details.** Enter the host, user, password, and database name. In both branches (3.0 and 4.1), the installer offers a choice of DB driver — leave it as `MySQLi`. The port is usually 3306.
4. **Administrator.** Specify a login, password, and email. Do not leave the login as `admin` — it is tried first by attackers. The password should be at least 12 characters long.
5. **Completion.** A message about successful installation will appear with buttons to go to the store and the admin panel.

### Common errors at the requirements stage

- **config.php is not writable.** Set the permissions of the `config.php` and `admin/config.php` files to 644 or temporarily 666, and set the owner to the hosting user. Create empty files manually if they are missing.
- **A required extension is missing.** Enable it in the "PHP Version Selection" section of your hosting control panel.
- **White screen.** Turn on error display during setup or check the PHP error log on your hosting.

For how the file configs are generated, see the article [config.php in OpenCart](https://opencartcode.com/en/wiki/dev-architecture/opencart-config-php).

## What must you do right after installation?

> Delete the `install` folder completely. While it is on the server, OpenCart shows a warning in the admin panel, and an attacker could theoretically try to reinstall the store.

### 1. Move the storage directory

The storage folder contains cache, logs, uploads, and backups. In OpenCart 3.0 and 4.1, it should be moved one level up from the public directory (outside `public_html`). After moving it, change the path in the `DIR_STORAGE` constant in both `config.php` files:

```php
define('DIR_STORAGE', '/home/user/storage/');
```

For 4.1, the admin panel also has a hint about this on the dashboard; clicking it can perform the move almost automatically.

### 2. Enable SEO-friendly URLs

Rename `.htaccess.txt` to `.htaccess`. Then, in System → Settings, on the Server tab, enable "Use SEO URLs". For Nginx, the rules are added manually to the virtual host config.

Server tab: SEO URL toggle and error display mode · OpenCart 4.1.0.4

### 3. Protect the admin panel

- Rename the `admin` folder (for example, to `manage-x7`) and update the paths `HTTP_SERVER`, `DIR_APPLICATION`, etc. in `admin/config.php`.
- Restrict admin access by IP via `.htaccess` if you have a static address.
- Disable error display on the site: "Display Errors" — "No", "Log Errors" — "Yes".

### 4. Set up backups

Enable automatic backups of the database and files on the hosting side. The built-in System → Maintenance → Backup / Restore section (Maintenance → Backup / Restore) is suitable for small databases, but for large directories it is more reliable to make a dump via cron or the hosting control panel.

## What else should you set up to get the store running?

A clean installation is an empty demo store. To accept your first order, go through the minimum set:

1. Basic store details, currency, language, email — described in detail in the article on initial setup.
2. Localization: in 3.0, the language is added as a separate package. If you don't want to assemble the package manually, there is a ready-made OpenCart 3 bundle in Ukrainian.
3. Email: set up SMTP so order emails don't end up in spam — see [email setup in OpenCart](https://opencartcode.com/en/blog/nalastuvannia-posti-v-opencart-smtp-i-tipovi-pomilki).
4. Card payments — [payment modules for Ukraine](https://opencartcode.com/en/blog/oplata-kartkoiu-v-opencart-moduli-dlia-ukrayini); [Nova Poshta](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary#nova-poshta) and Ukrposhta delivery are connected via separate extensions.
5. Legal pages (offer, delivery and payment, returns) — in Catalog → Information.

For the general launch order, see the article [how to launch an online store without rework](https://opencartcode.com/en/wiki/start/how-to-launch-an-online-store). You can clarify new terms in the [e-commerce and OpenCart glossary](https://opencartcode.com/en/wiki/glossary/e-commerce-glossary).

If errors appear after installation that you can't explain, check System → Maintenance → Error Logs (Maintenance → Error Logs).

Error log: the first thing to check after installation · OpenCart 4.1.0.4

## Should you install OpenCart manually or through the hosting auto-installer?

Many hosts offer "one-click installation" (Softaculous and similar). It's fast, but there are nuances: an outdated version is often installed there, and the file structure may differ from the official one. Manual installation gives you control over the version, permissions, and storage location.

A practical rule: an auto-installer is fine for a test site, but for a live store it's better to install manually from the official archive. This way you know for sure that there are no foreign changes in the code and understand where everything is when you need to update or fix the site. If problems arise that you don't want to solve yourself, you can order [further development and bug fixing](https://opencartcode.com/en/marketplace/product/opencart-fixes).

Other materials in this section are collected on the page ["OpenCart: Installation and Administration"](https://opencartcode.com/en/wiki/basics).

## Summary

- Choose a version (3.0 or 4.1) based on your modules and tasks, and check PHP compatibility on your hosting.
- Download the distribution only from official sources; the contents of the `upload` folder go to the site root.
- Database — utf8mb4, a separate user, strong passwords, a non-standard administrator login.
- After the installer: delete `install`, move `storage`, enable SEO URLs, hide the admin panel, set up backups.
- Next — localization, email, payments, delivery, and legal pages.

The next step is the initial store setup: currency, language, images, and checkout.

## FAQ

**How long does it take to install OpenCart?**

The installation itself takes 15–30 minutes. More time goes to setting up security, language, email, payments and shipping.

**Which PHP version should I choose for OpenCart?**

3.0.5.1 requires PHP 8.1 or newer, 3.0.4.1 requires PHP 7.3 or newer (including 7.4), and 4.1 requires PHP 8.1 or newer. Before choosing, check the requirements in the README of your archive.

**Can I install OpenCart in a subfolder instead of the domain root?**

Yes, the files are placed in a subfolder, and the installer is opened at an address like /shop/install. For SEO-friendly URLs, account for the subfolder in .htaccess.

**What should I do if the installer can't write config.php?**

Create empty config.php files in the root and in admin and give them write permissions for the hosting user. After installation, set the permissions back to 644.

**Can I move an installed OpenCart to another host?**

Yes: copy the files, make a database dump, import it on the new server, and fix the connection details and paths in both config.php files.
