OpenCart Store
OpenCart ecommerce platform with MySQL.
Overview
OpenCart is a free, open-source PHP-based e-commerce platform that has powered over 350,000 online stores since 2009. Built with simplicity in mind, OpenCart offers a complete shopping cart solution with multi-store management, extensive theme customization, and over 13,000 modules and themes available through its marketplace. The platform supports multiple languages, currencies, and payment gateways, making it ideal for businesses looking to establish an international online presence without the complexity of enterprise-level platforms.
This stack combines OpenCart with MySQL 8.0 to create a robust e-commerce environment where MySQL's InnoDB storage engine handles transactional integrity for orders, inventory, and customer data. MySQL's query cache optimizes performance for product catalogs and search functionality, while OpenCart's PHP architecture leverages MySQL's full-text search capabilities for product filtering and customer searches. The Bitnami OpenCart image includes pre-configured PHP extensions and optimization settings that work efficiently with MySQL's connection pooling and prepared statements.
This configuration serves online retailers, dropshipping businesses, and entrepreneurs who need a complete e-commerce solution with reliable data persistence and scalability. The combination is particularly valuable for businesses expecting moderate to high transaction volumes, as MySQL's ACID compliance ensures order integrity while OpenCart's multi-store capabilities allow management of multiple brands or regional stores from a single installation.
Key Features
- OpenCart's multi-store architecture allowing unlimited stores from single admin panel with shared customer database
- MySQL InnoDB storage engine with ACID compliance for transactional integrity of orders and payments
- OpenCart marketplace integration with 13,000+ extensions and themes accessible from admin interface
- MySQL full-text indexing optimized for OpenCart's product search and category filtering
- OpenCart's built-in SEO URL system with MySQL database-driven URL rewriting
- Bitnami OpenCart image with pre-configured PHP-FPM and MySQL connection optimization
- OpenCart's multi-currency and multi-language support with MySQL UTF-8 character set handling
- MySQL Group Replication compatibility for high-availability e-commerce deployments
Common Use Cases
- 1Small to medium online retailers launching product catalogs with integrated payment processing
- 2Dropshipping businesses managing supplier catalogs and automated order fulfillment workflows
- 3Multi-brand retailers operating separate storefronts with consolidated inventory management
- 4International e-commerce sites requiring multi-currency pricing and localized product descriptions
- 5Digital agencies developing custom e-commerce solutions for clients with OpenCart extensions
- 6B2B wholesale platforms with customer-specific pricing and restricted product access
- 7Marketplace operators hosting multiple vendor stores with centralized order processing
Prerequisites
- Minimum 2GB RAM recommended for OpenCart with moderate product catalogs and concurrent users
- Ports 80 and 443 available for HTTP/HTTPS traffic to OpenCart storefront and admin panel
- Basic understanding of OpenCart admin interface for store configuration and product management
- Familiarity with MySQL backup procedures for protecting customer and order data
- Knowledge of PHP configuration for OpenCart performance tuning and extension installation
- SSL certificate management experience for securing customer checkout and payment processes
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 mysql: 3 image: mysql:8.04 container_name: opencart-mysql5 restart: unless-stopped6 environment: 7 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}8 MYSQL_DATABASE: ${MYSQL_DATABASE:-opencart}9 MYSQL_USER: ${MYSQL_USER:-opencart}10 MYSQL_PASSWORD: ${MYSQL_PASSWORD:-opencart}11 volumes: 12 - mysql_data:/var/lib/mysql13 networks: 14 - opencart-network1516 opencart: 17 image: bitnami/opencart:latest18 container_name: opencart19 restart: unless-stopped20 ports: 21 - "${OPENCART_PORT:-80}:8080"22 - "${OPENCART_HTTPS_PORT:-443}:8443"23 environment: 24 - OPENCART_HOST=localhost25 - OPENCART_DATABASE_HOST=mysql26 - OPENCART_DATABASE_NAME=${MYSQL_DATABASE:-opencart}27 - OPENCART_DATABASE_USER=${MYSQL_USER:-opencart}28 - OPENCART_DATABASE_PASSWORD=${MYSQL_PASSWORD:-opencart}29 - OPENCART_USERNAME=${OPENCART_USER:-admin}30 - OPENCART_PASSWORD=${OPENCART_PASSWORD:-admin123}31 - OPENCART_EMAIL=${OPENCART_EMAIL:-admin@example.com}32 volumes: 33 - opencart_data:/bitnami/opencart34 depends_on: 35 - mysql36 networks: 37 - opencart-network3839volumes: 40 mysql_data: 41 opencart_data: 4243networks: 44 opencart-network: 45 driver: bridge.env Template
.env
1# OpenCart2OPENCART_PORT=803OPENCART_HTTPS_PORT=4434MYSQL_ROOT_PASSWORD=root5MYSQL_DATABASE=opencart6MYSQL_USER=opencart7MYSQL_PASSWORD=opencart8OPENCART_USER=admin9OPENCART_PASSWORD=admin12310OPENCART_EMAIL=admin@example.comUsage Notes
- 1Docs: https://docs.opencart.com/
- 2Storefront at http://localhost, admin at /admin
- 3Login: use OPENCART_USER/OPENCART_PASSWORD from env
- 4Extension marketplace: Extensions > Marketplace in admin
- 5SEO URLs: enable in System > Settings > Server tab
- 6Multi-store support built-in - configure in System > Settings
Individual Services(2 services)
Copy individual services to mix and match with your existing compose files.
mysql
mysql:
image: mysql:8.0
container_name: opencart-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-opencart}
MYSQL_USER: ${MYSQL_USER:-opencart}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-opencart}
volumes:
- mysql_data:/var/lib/mysql
networks:
- opencart-network
opencart
opencart:
image: bitnami/opencart:latest
container_name: opencart
restart: unless-stopped
ports:
- ${OPENCART_PORT:-80}:8080
- ${OPENCART_HTTPS_PORT:-443}:8443
environment:
- OPENCART_HOST=localhost
- OPENCART_DATABASE_HOST=mysql
- OPENCART_DATABASE_NAME=${MYSQL_DATABASE:-opencart}
- OPENCART_DATABASE_USER=${MYSQL_USER:-opencart}
- OPENCART_DATABASE_PASSWORD=${MYSQL_PASSWORD:-opencart}
- OPENCART_USERNAME=${OPENCART_USER:-admin}
- OPENCART_PASSWORD=${OPENCART_PASSWORD:-admin123}
- OPENCART_EMAIL=${OPENCART_EMAIL:-admin@example.com}
volumes:
- opencart_data:/bitnami/opencart
depends_on:
- mysql
networks:
- opencart-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 mysql:5 image: mysql:8.06 container_name: opencart-mysql7 restart: unless-stopped8 environment:9 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}10 MYSQL_DATABASE: ${MYSQL_DATABASE:-opencart}11 MYSQL_USER: ${MYSQL_USER:-opencart}12 MYSQL_PASSWORD: ${MYSQL_PASSWORD:-opencart}13 volumes:14 - mysql_data:/var/lib/mysql15 networks:16 - opencart-network1718 opencart:19 image: bitnami/opencart:latest20 container_name: opencart21 restart: unless-stopped22 ports:23 - "${OPENCART_PORT:-80}:8080"24 - "${OPENCART_HTTPS_PORT:-443}:8443"25 environment:26 - OPENCART_HOST=localhost27 - OPENCART_DATABASE_HOST=mysql28 - OPENCART_DATABASE_NAME=${MYSQL_DATABASE:-opencart}29 - OPENCART_DATABASE_USER=${MYSQL_USER:-opencart}30 - OPENCART_DATABASE_PASSWORD=${MYSQL_PASSWORD:-opencart}31 - OPENCART_USERNAME=${OPENCART_USER:-admin}32 - OPENCART_PASSWORD=${OPENCART_PASSWORD:-admin123}33 - OPENCART_EMAIL=${OPENCART_EMAIL:-admin@example.com}34 volumes:35 - opencart_data:/bitnami/opencart36 depends_on:37 - mysql38 networks:39 - opencart-network4041volumes:42 mysql_data:43 opencart_data:4445networks:46 opencart-network:47 driver: bridge48EOF4950# 2. Create the .env file51cat > .env << 'EOF'52# OpenCart53OPENCART_PORT=8054OPENCART_HTTPS_PORT=44355MYSQL_ROOT_PASSWORD=root56MYSQL_DATABASE=opencart57MYSQL_USER=opencart58MYSQL_PASSWORD=opencart59OPENCART_USER=admin60OPENCART_PASSWORD=admin12361OPENCART_EMAIL=admin@example.com62EOF6364# 3. Start the services65docker compose up -d6667# 4. View logs68docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/opencart-store/run | bashTroubleshooting
- OpenCart installation wizard fails to connect: Verify OPENCART_DATABASE_HOST points to 'mysql' service name and database credentials match
- Product images not displaying after restart: Check opencart_data volume mount and ensure /bitnami/opencart/image directory permissions are correct
- MySQL connection limit errors during high traffic: Increase MySQL max_connections parameter and configure OpenCart database connection pooling
- OpenCart admin login redirects to setup: Delete install directory from opencart_data volume or set OPENCART_SKIP_INSTALL=yes environment variable
- Payment gateway SSL errors: Configure OPENCART_HOST with actual domain name instead of localhost for production deployments
- OpenCart marketplace extensions fail to install: Ensure container has write permissions to /bitnami/opencart and sufficient disk space in volume
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Ad Space
Shortcuts: C CopyF FavoriteD Download