Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

To install OpenCart on a VPS, build an Ubuntu web stack with Apache, MySQL or MariaDB, and PHP 8.1 or newer; create a separate empty database and user; upload and unpack the OpenCart release; copy its distribution configuration files; set web-server ownership; configure a virtual host; finish the browser installer; and remove the installation directory. Put HTTPS, strong credentials, and system updates in place before accepting real orders.

What you need before installing OpenCart

This procedure assumes a new Ubuntu VPS with sudo access and a domain name pointed at the server’s public IP address. The commands below use Apache, because it is the web server suggested in OpenCart’s requirements and is the basis of most Ubuntu installation procedures. Nginx can serve OpenCart, but its configuration and PHP-FPM setup are different and are not covered by this Apache walkthrough.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Component Requirement or recommendation Why it matters
Operating system Ubuntu VPS; the available OpenCart material does not establish a definitive supported Ubuntu-version matrix Use a currently maintained Ubuntu release supplied by your VPS provider so security updates remain available.
PHP PHP 8.1 or newer The current official requirements list 8.1+. An older upgrade page still says 7.4+, and the installer check mentions 8.0+, but those older figures should not be used for a new deployment.
PHP extensions Curl, ZIP, Zlib, GD Library, mbstring; also install intl, XML, and MySQL support These extensions handle downloads, archives, images, text processing, internationalization, XML data, and database connectivity.
Database MySQLi is the normal choice; the installation guide also accepts PDO and PostgreSQL A dedicated MySQL or MariaDB database and user keep the store isolated from other applications.
Web server Apache with URL rewriting enabled OpenCart’s friendly URLs depend on rewrite rules. Nginx is possible, but requires an equivalent custom configuration.
Server resources Enough memory for PHP and the catalog; set PHP memory_limit to 512M if the VPS workload needs it Large catalogs, image processing, extensions, and import jobs can exceed a conservative default limit.

Have the following details ready: the store domain, an administrator email address, a long unique database password, and a separate long OpenCart administrator password. Do not reuse the VPS root password for either account.

Install OpenCart on Ubuntu: update the VPS and install the stack

Log in over SSH as a sudo-enabled account. Updating first prevents an old package from being pulled into a new store.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
sudo apt update
sudo apt upgrade -y

Install Apache, the database server, PHP, the Apache PHP module, archive tools, and the extensions commonly required by OpenCart:

sudo apt install -y apache2 mysql-server unzip 
  php php-cli libapache2-mod-php php-mysql php-curl php-zip 
  php-gd php-mbstring php-intl php-xml

The PHP package supplied by Ubuntu includes the zlib functionality OpenCart checks for. Confirm the installed interpreter and loaded modules:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
php -v
php -m | grep -E 'curl|gd|mbstring|mysqli|PDO|xml|zip|zlib'

The version output must be 8.1 or newer. If Ubuntu’s default repository offers an older PHP branch, stop and choose a maintained Ubuntu/PHP combination rather than forcing an unsupported interpreter into production. Apache and MySQL should start automatically after installation; check their state if the browser cannot connect:

sudo systemctl status apache2
sudo systemctl status mysql

OpenCart MySQL database setup

OpenCart should have an empty database and a database account used only by that store. The account needs privileges on its own database, not unrestricted server-wide access.

Open the MySQL shell as an administrator:

sudo mysql

Run SQL with your own database name, username, and long random password. The names below are examples; replace them rather than copying a weak password:

CREATE DATABASE opencart CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'opencart_user'@'localhost' IDENTIFIED BY 'use-a-long-unique-password';
GRANT ALL PRIVILEGES ON opencart.* TO 'opencart_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Record the four values needed by the web installer: database host (localhost for this layout), database name, database user, and database password. Do not put the database account in a public document or commit it to a repository.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Tune PHP for the store

OpenCart’s exact PHP configuration path varies with the installed PHP branch. Find the active configuration file before editing it:

Rank #2
Sale
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
php --ini

Edit the file listed as the loaded configuration, for example:

sudo nano /etc/php/8.1/apache2/php.ini

Set a timezone that matches the business’s operating region and, where the catalog or extensions require more working memory, set:

memory_limit = 512M

Use an IANA timezone name such as UTC or the store’s actual region. Save the file and restart Apache so the web process receives the changes:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo systemctl restart apache2

Do not confuse the command-line PHP configuration with Apache’s PHP configuration. A value shown by php -i is not proof that the browser-facing Apache process uses the same file.

Download and unpack the OpenCart release

Obtain the release ZIP from OpenCart’s official release channel. Check that the archive is the release you intend to run and keep a copy of the version information for future updates. The exact current release number and download address are not fixed here, so do not substitute an unofficial mirror or invent a URL.

Upload the ZIP to the VPS with your normal SCP or SFTP method, or download it directly on the server using the official address. Then create a separate document root and unpack the archive. For a store named opencart:

sudo mkdir -p /var/www/html/opencart
sudo unzip /path/to/the-uploaded-opencart-release.zip -d /tmp/opencart-release

Release archives often contain an upload directory. Copy the application files from that directory into the document root; if the archive has a different top-level layout, copy the directory that contains OpenCart’s admin, catalog, system, and configuration files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
sudo cp -a /tmp/opencart-release/upload/. /var/www/html/opencart/

Verify the expected structure before continuing:

ls -la /var/www/html/opencart
ls -la /var/www/html/opencart/admin

You should see the storefront directories and an administrator directory. If everything was copied one level too deep, the browser installer will usually fail because the virtual host points at the wrong directory.

Prepare OpenCart configuration files and permissions

OpenCart distributes sample configuration files rather than writable production files. Copy each sample to the filename the application loads:

cd /var/www/html/opencart
sudo cp config-dist.php config.php
sudo cp admin/config-dist.php admin/config.php

Set the entire application tree to the Ubuntu Apache account, www-data, so PHP can read the files and write only where the application expects to do so:

sudo chown -R www-data:www-data /var/www/html/opencart
sudo find /var/www/html/opencart -type d -exec chmod 755 {} ;
sudo find /var/www/html/opencart -type f -exec chmod 644 {} ;

Do not make the whole tree world-writable with chmod -R 777. If an extension later reports that a specific cache, image, or storage directory is not writable, grant the narrowest permission required for that directory and keep PHP files non-writable by other users.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Create an Apache virtual host

A dedicated virtual host keeps the store’s domain mapped to its document root and allows Apache to apply rewrite rules. Create a site file:

sudo nano /etc/apache2/sites-available/opencart.conf

Use your real domain in both ServerName and DNS; the example below intentionally uses a documentation domain rather than a live store name:

<VirtualHost *:80>
    ServerName shop.example.invalid
    DocumentRoot /var/www/html/opencart

    <Directory /var/www/html/opencart>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/opencart-error.log
    CustomLog ${APACHE_LOG_DIR}/opencart-access.log combined
</VirtualHost>

Replace shop.example.invalid with the domain that resolves to the VPS. Enable the site and rewrite module, then disable the default site if it would otherwise answer for the same request:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
sudo a2enmod rewrite
sudo a2ensite opencart.conf
sudo a2dissite 000-default.conf
sudo apache2ctl configtest
sudo systemctl reload apache2

apache2ctl configtest must return Syntax OK. A failed test should be corrected before reloading. Confirm that the domain’s A or AAAA record points to this server and that the VPS firewall permits HTTP traffic.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run the OpenCart browser installer

Visit the domain over HTTP for the initial setup. The installer checks the PHP version, extensions, file permissions, and configuration files before displaying the database form.

  1. Accept the license and continue. Read the displayed terms and proceed only when the prerequisite screen shows the required checks as passed.
  2. Enter database details. Choose the MySQLi driver if offered, then enter localhost, the database name, the dedicated username, and its password. Use the values created in the database step; do not use the MySQL root account.
  3. Create the administrator account. Use a unique administrator username, a store-controlled email address, and a long password. Avoid predictable names and passwords.
  4. Complete installation. Let OpenCart write its final settings and redirect you to the storefront and administration URLs.

If the installer reports a missing requirement, fix the server-side issue and reload the check rather than bypassing it. A PHP extension installed for the command line may still be absent from Apache; restart Apache after changing packages or php.ini.

Remove the install directory and enable HTTPS

After the installer succeeds, remove the installation directory. Leaving it available can expose the setup workflow to another visitor:

sudo rm -rf /var/www/html/opencart/install

Before the store handles customer credentials or payments, configure a trusted TLS certificate for the domain and redirect HTTP to HTTPS. The exact certificate tool depends on your hosting and certificate provider, but the important checks are that the certificate covers the store hostname, renewal is automatic, and the OpenCart URLs use HTTPS.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Change any default or temporary credentials, restrict SSH access, and keep Ubuntu, Apache, PHP, the database server, OpenCart, and installed extensions updated. Take tested backups of both the database and the OpenCart files before upgrades.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common OpenCart VPS installation failures

The installer says PHP is too old

Check the PHP version used by Apache, not only the shell:

Best Value
Sale
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
php -v
apache2ctl -M | grep -i php

Use PHP 8.1 or newer for a new installation. If several PHP branches are installed, remove the obsolete Apache module or enable the intended one, then restart Apache. The older 7.4 and 8.0 figures found in legacy OpenCart pages should not override the current 8.1-or-newer recommendation.

An extension is missing

Install the corresponding Ubuntu package, restart Apache, and revisit the prerequisite page. The usual checks are Curl, ZIP, GD, mbstring, XML, intl, and MySQL support. Confirm loaded modules with php -m; a package name alone does not prove that Apache loaded it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Database connection fails

  • Check spelling and capitalization of the database name and username.
  • Use the database host that matches the account’s host restriction; localhost is appropriate for the local MySQL layout shown above.
  • Confirm that the user was granted privileges on the intended database and that the password contains no accidental copied spaces.
  • Do not test with the root account as a workaround; fix the dedicated account instead.

Apache shows a 403, 404, or the wrong site

Confirm that DocumentRoot points directly to the directory containing OpenCart’s files, that the virtual host is enabled, and that AllowOverride All is present. Check ownership and directory permissions, then inspect the per-site error log:

sudo tail -f /var/log/apache2/opencart-error.log

A 404 on friendly URLs commonly means mod_rewrite is disabled or Apache is not allowed to read the directory’s .htaccess rules.

The site loads but cannot write images or cache files

Check that the application tree is owned by www-data and that the affected runtime directory is writable by that account. Correct only the required directory; broad world-writable permissions create an unnecessary security risk.

The browser displays a blank page or a 500 error

Read the Apache error log, verify the PHP version and extensions, and check the PHP memory limit. A 500 error after editing php.ini can also indicate a syntax mistake; restore the last valid setting, run sudo apache2ctl configtest, and restart Apache.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Apache or Nginx for an OpenCart VPS?

Choice Best fit Important setup point
Apache First-time Ubuntu installations and readers following OpenCart’s suggested web-server path Enable mod_rewrite, permit .htaccess with AllowOverride All, and use a virtual host.
Nginx Administrators who already manage Nginx and PHP-FPM Translate OpenCart’s rewrite behavior into the Nginx server block; Apache instructions cannot be copied unchanged.

The database, PHP version, extension requirements, configuration-file preparation, ownership, installer, and post-install security steps remain essential with either web server.

Post-install checklist

  • The store domain resolves to the VPS and the Apache virtual host passes apache2ctl configtest.
  • PHP 8.1 or newer is the version served by Apache.
  • Curl, ZIP, Zlib, GD, mbstring, intl, XML, and MySQL support pass the installer checks.
  • The store uses a dedicated database and non-root database account.
  • config.php exists in the storefront root and admin/config.php exists in the administrator directory.
  • The OpenCart tree is owned by www-data without blanket 777 permissions.
  • The install directory has been deleted.
  • HTTPS is enabled and HTTP redirects to it.
  • Administrator and database passwords are unique and stored securely.
  • Backups, package updates, and OpenCart updates are scheduled and periodically tested.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.