What is OpenCart?
OpenCart is a free, open-source eCommerce platform built using PHP and MySQL. It enables users to build and manage fully functional online stores with support for multiple languages, currencies, payment gateways, shipping methods, and custom themes. OpenCart is known for its simplicity, performance, and wide range of extensions.
Running OpenCart on Debian 12 (Bookworm) provides a stable, secure, and efficient environment, ideal for developers, small business owners, and hosting providers who want full control over their eCommerce stack.
Key Features of OpenCart
Web-Based Administration
- Clean and responsive admin panel to manage products, categories, customers, orders, and reports.
- Multi-user and role-based access control.
Multi-Language and Multi-Currency
- Support for global eCommerce with multiple languages and currency options.
- Language packs and currency conversions built in.
Extension Marketplace
- Thousands of modules and themes available via the OpenCart Marketplace.
- Extend functionality for SEO, payments, shipping, marketing, analytics, and more.
Product and Order Management
- Bulk product upload, discounts, coupons, stock status, and custom attributes.
- Order history, invoice printing, and customer communication tools.
Integrated Payment and Shipping
- Supports popular payment gateways like PayPal, Stripe, Square, Authorize.Net, etc.
- Shipping options include flat rate, weight-based, pickup, DHL, FedEx, UPS, and more.
SEO and Marketing Tools
- Friendly URLs, custom meta tags, and Google Sitemap support.
- Built-in tools for discounts, gift vouchers, affiliate programs, and newsletters.
Why Use OpenCart on Debian 12?
Debian 12 offers a reliable platform for running web applications like OpenCart due to:
- Long-term support and stable package base
- High security standards and active maintenance
- Compatibility with Apache, Nginx, PHP 8.2, and MariaDB/MySQL
- Lightweight and efficient performance, suitable for VPS and dedicated servers
Debian’s minimal and predictable environment ensures greater control, better performance, and easier debugging for server administrators.
System Requirements for OpenCart on Debian 12
Component | Requirement |
---|---|
Web Server | Apache or Nginx |
PHP Version | PHP 8.0 or 8.2 (recommended) |
PHP Extensions | curl , zip , gd , mbstring , xml , intl , bz2 , mysqli , openssl |
Database | MySQL 5.7+ or MariaDB 10.4+ |
Disk Space | 300 MB (OpenCart core files), more for media |
Memory | 1 GB minimum (2+ GB recommended) |
Typical OpenCart Stack on Debian 12
- Apache or Nginx as the web server
- PHP 8.2 with required extensions
- MariaDB or MySQL for database
- Let’s Encrypt SSL via Certbot for HTTPS
- Optional caching tools like Redis or Varnish
Use Cases
- Online stores for small to medium businesses
- Localized eCommerce platforms with language/currency support
- B2C or B2B catalog-driven websites
- Custom eCommerce solutions with specific workflows or integrations
Pros of Using OpenCart on Debian 12
- Free and open-source with no vendor lock-in
- Lightweight and fast, even on small VPS servers
- Extensive ecosystem of themes, modules, and payment integrations
- Easy to set up, configure, and maintain
- Flexible API and MVC architecture for custom development
- Debian’s package system ensures consistent, reliable updates
Cons
- Manual setup required (not as beginner-friendly as hosted platforms)
- Some advanced features need paid extensions
- Lacks built-in drag-and-drop page builder (available via third-party modules)
- Performance tuning required for large stores or high-traffic sites
- Limited native support for headless or PWA features
Security Best Practices
- Use HTTPS with Let’s Encrypt for all traffic
- Set strict file and folder permissions (644 for files, 755 for directories)
- Disable unused PHP functions and keep PHP up to date
- Regularly update OpenCart and its extensions
- Use Fail2Ban, UFW, or iptables for brute-force and firewall protection
- Secure the admin directory with
.htaccess
or admin renaming
OpenCart on Debian 12 is a powerful and customizable eCommerce solution for those seeking full control over their online store. Debian’s rock-solid stability and OpenCart’s flexible architecture make them a perfect combination for businesses, developers, and hosting providers who prefer an open-source, self-hosted alternative to SaaS platforms.
Whether you’re launching a small shop or building a scalable eCommerce platform, OpenCart on Debian 12 offers the tools, performance, and control to make it possible.
Step 1: Create a Cloud VPS on Shape.Host
To start, deploy a clean Debian 12 server:
Go to https://shape.host and log in.
Click “Create”.
Choose “Instance”.

Pick your preferred server location.

Select Debian 12 (64-bit) as the operating system.
Choose a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

Click “Create Instance”.

Find your instance IP address in the Resources section.

Step 2: Connect to Your VPS
Once your instance is created, you’ll receive the IP address, username (root
), and password from Shape.Host.
On Linux or macOS:
Open a terminal and connect via SSH:
ssh root@your_server_ip
Press Enter
, then type your password when prompted.
On Windows:
- Download and install PuTTY (a free SSH client).
- Open PuTTY.
- In the Host Name field, type:
root@your_server_ip
(or type just the IP address and it will ask for the username later). - Make sure the Port is set to
22
and Connection type is set toSSH
. - Click Open.
- When prompted, log in as
root
, then enter the password provided by Shape.Host.
Step 3: Update Your System
apt update
Refreshes the list of available packages.

Step 4: Install Apache
apt install apache2
Installs the Apache web server.

Step 5: Start and Enable Apache
systemctl start apache2
systemctl enable apache2
systemctl status apache2
Starts Apache and enables it to launch on boot.

Step 6: Install MariaDB
apt install mariadb-server
This installs the MariaDB database engine used by OpenCart.

Step 7: Start and Enable MariaDB
systemctl start mariadb
systemctl enable mariadb
systemctl status mariadb
Ensures the database service is running and enabled.

Step 8: Create the OpenCart Database
mariadb
Inside the MariaDB shell, run:
CREATE DATABASE opencartdb CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER opencartdbuser@localhost IDENTIFIED BY 'your-password';
GRANT ALL ON opencartdb.* TO opencartdbuser@localhost WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
This creates the database and user for OpenCart.

Step 9: Install PHP and Required Extensions
apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-json php-sqlite3 php-soap php-zip
These PHP modules are essential for OpenCart to function correctly.

Step 10: Download and Extract OpenCart
cd /tmp
wget https://github.com/opencart/opencart/releases/download/4.0.2.3/opencart-4.0.2.3.zip
apt install unzip
unzip opencart-4.0.2.3.zip
Gets the latest OpenCart release and extracts the files.

Step 11: Move Files to the Web Directory
mv opencart-*/upload/ /var/www/opencart
Moves OpenCart files to Apache’s web root.
Step 12: Set Up Configuration Files
cp /var/www/opencart/config-dist.php /var/www/opencart/config.php
cp /var/www/opencart/admin/config-dist.php /var/www/opencart/admin/config.php
These are required for OpenCart to operate.
Step 13: Fix File Permissions
chown -R www-data:www-data /var/www/opencart
Ensures Apache can read and write to the OpenCart folder.

Step 14: Create Apache Virtual Host
nano /etc/apache2/sites-available/opencart.conf
Paste this config and replace you-domain.com
with your actual domain or IP:
<VirtualHost *:80>
ServerName you-domain.com
ServerAdmin contact@shape.host
DocumentRoot /var/www/opencart
<Directory /var/www/opencart/>
Options FollowSymlinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Step 15: Enable the Site and Rewrite Module
a2ensite opencart.conf
a2enmod rewrite
Activates your new virtual host and the mod_rewrite module, which OpenCart needs.
Step 16: Restart Apache
systemctl restart apache2
Reloads the Apache server to apply changes.

Step 17: Remove Installer Directory (after setup is complete)
rm -rf /var/www/opencart/install/
This is required for security once the web installer finishes.
Step 18: Access Your OpenCart Site
Visit:
http://your_domain.com
Follow the on-screen installer to finish configuration.

An OpenCart installation wizard page should appear. Ensure all requirements are met and continue.

Next, enter the database name, create an account and password, and continue.

Your OpenCart site should be set up and ready to use.

You’ve successfully installed OpenCart 4.0.2.3 on Debian 12 with Apache, PHP, and MariaDB — all steps based exactly on your real history and explained clearly.
This guide was designed for Shape.Host users. Shape.Host gives you:
- Instant instance deployment
- Full root access
- Excellent performance for OpenCart and other PHP apps
Try it today at https://shape.host