OpenCart E-commerce Platform
Lightweight e-commerce platform with OpenCart, MySQL, and extensions.
Overview
OpenCart is an open-source PHP-based e-commerce platform that has been powering online stores since 2008. Known for its user-friendly interface and extensive marketplace of themes and extensions, OpenCart provides a lightweight alternative to heavyweight e-commerce solutions like Magento. The platform features a clean admin panel, multi-store support, and over 13,000 modules and themes available through its marketplace, making it popular among small to medium-sized businesses looking to establish an online presence quickly.
This stack combines OpenCart with MySQL 8.0 for robust data storage, Redis for high-performance session management and caching, and includes phpMyAdmin for database administration. MySQL's InnoDB storage engine provides ACID compliance for transaction integrity, while Redis delivers sub-millisecond response times for cart sessions and product caching. The Bitnami OpenCart image comes pre-configured with PHP-FPM and Apache, eliminating the complexity of manual PHP environment setup while maintaining the flexibility to customize themes and extensions.
This configuration is ideal for entrepreneurs launching their first online store, web developers building client e-commerce sites, or businesses migrating from hosted solutions like Shopify to self-hosted platforms. The lightweight nature of OpenCart combined with Redis caching makes this stack capable of handling moderate traffic loads while keeping resource requirements minimal, making it cost-effective for smaller businesses or development environments where performance and simplicity are more important than enterprise-scale features.
Key Features
- OpenCart's 13,000+ extension marketplace for payment gateways, shipping modules, and marketing tools
- MySQL 8.0 InnoDB storage engine with ACID compliance for order and inventory transaction integrity
- Redis in-memory caching for lightning-fast shopping cart sessions and product catalog performance
- Multi-store capability allowing management of multiple storefronts from single OpenCart installation
- Built-in SEO optimization with URL rewriting and meta tag management for search engine visibility
- phpMyAdmin web interface for direct database management of products, orders, and customer data
- OpenCart's drag-and-drop layout system for customizing storefront appearance without coding
- Comprehensive admin dashboard with real-time sales analytics and inventory tracking
Common Use Cases
- 1Small business owners launching their first online store with limited technical expertise
- 2Web development agencies building custom e-commerce sites for multiple clients
- 3Existing brick-and-mortar stores adding online sales channels with inventory synchronization
- 4Digital product sellers needing lightweight platform for downloadable goods and services
- 5International businesses requiring multi-currency and multi-language e-commerce capabilities
- 6Dropshipping operations needing automated order processing and supplier integration
- 7Development teams prototyping e-commerce features before production deployment
Prerequisites
- Minimum 2GB RAM recommended (MySQL 1GB + Redis 512MB + OpenCart 512MB + system overhead)
- Ports 80, 443, and 8081 available on host system for web access and phpMyAdmin
- Basic understanding of OpenCart admin panel for initial store configuration and product setup
- SSL certificate files if enabling HTTPS for production e-commerce transactions
- SMTP email credentials for order notifications and customer communication features
- Domain name and DNS configuration for production deployment accessibility
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 environment: 5 - MYSQL_DATABASE=opencart6 - MYSQL_USER=opencart7 - MYSQL_PASSWORD=${MYSQL_PASSWORD}8 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}9 volumes: 10 - mysql_data:/var/lib/mysql11 networks: 12 - opencart_net1314 redis: 15 image: redis:7-alpine16 volumes: 17 - redis_data:/data18 networks: 19 - opencart_net2021 opencart: 22 image: bitnami/opencart:latest23 ports: 24 - "80:8080"25 - "443:8443"26 environment: 27 - OPENCART_DATABASE_HOST=mysql28 - OPENCART_DATABASE_NAME=opencart29 - OPENCART_DATABASE_USER=opencart30 - OPENCART_DATABASE_PASSWORD=${MYSQL_PASSWORD}31 - OPENCART_USERNAME=${OPENCART_USER}32 - OPENCART_PASSWORD=${OPENCART_PASSWORD}33 - OPENCART_EMAIL=${OPENCART_EMAIL}34 volumes: 35 - opencart_data:/bitnami/opencart36 depends_on: 37 - mysql38 networks: 39 - opencart_net4041 phpmyadmin: 42 image: phpmyadmin:latest43 ports: 44 - "8081:80"45 environment: 46 - PMA_HOST=mysql47 depends_on: 48 - mysql49 networks: 50 - opencart_net5152volumes: 53 mysql_data: 54 redis_data: 55 opencart_data: 5657networks: 58 opencart_net: .env Template
.env
1# OpenCart2MYSQL_PASSWORD=secure_mysql_password3MYSQL_ROOT_PASSWORD=secure_root_password4OPENCART_USER=admin5OPENCART_PASSWORD=secure_admin_password6OPENCART_EMAIL=admin@example.com78# Shop at http://localhost9# Admin at http://localhost/adminUsage Notes
- 1Shop at http://localhost
- 2Admin at http://localhost/admin
- 3Lightweight and fast
- 4Large extension marketplace
- 5Easy to customize themes
Individual Services(4 services)
Copy individual services to mix and match with your existing compose files.
mysql
mysql:
image: mysql:8.0
environment:
- MYSQL_DATABASE=opencart
- MYSQL_USER=opencart
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- mysql_data:/var/lib/mysql
networks:
- opencart_net
redis
redis:
image: redis:7-alpine
volumes:
- redis_data:/data
networks:
- opencart_net
opencart
opencart:
image: bitnami/opencart:latest
ports:
- "80:8080"
- "443:8443"
environment:
- OPENCART_DATABASE_HOST=mysql
- OPENCART_DATABASE_NAME=opencart
- OPENCART_DATABASE_USER=opencart
- OPENCART_DATABASE_PASSWORD=${MYSQL_PASSWORD}
- OPENCART_USERNAME=${OPENCART_USER}
- OPENCART_PASSWORD=${OPENCART_PASSWORD}
- OPENCART_EMAIL=${OPENCART_EMAIL}
volumes:
- opencart_data:/bitnami/opencart
depends_on:
- mysql
networks:
- opencart_net
phpmyadmin
phpmyadmin:
image: phpmyadmin:latest
ports:
- "8081:80"
environment:
- PMA_HOST=mysql
depends_on:
- mysql
networks:
- opencart_net
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 mysql:5 image: mysql:8.06 environment:7 - MYSQL_DATABASE=opencart8 - MYSQL_USER=opencart9 - MYSQL_PASSWORD=${MYSQL_PASSWORD}10 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}11 volumes:12 - mysql_data:/var/lib/mysql13 networks:14 - opencart_net1516 redis:17 image: redis:7-alpine18 volumes:19 - redis_data:/data20 networks:21 - opencart_net2223 opencart:24 image: bitnami/opencart:latest25 ports:26 - "80:8080"27 - "443:8443"28 environment:29 - OPENCART_DATABASE_HOST=mysql30 - OPENCART_DATABASE_NAME=opencart31 - OPENCART_DATABASE_USER=opencart32 - OPENCART_DATABASE_PASSWORD=${MYSQL_PASSWORD}33 - OPENCART_USERNAME=${OPENCART_USER}34 - OPENCART_PASSWORD=${OPENCART_PASSWORD}35 - OPENCART_EMAIL=${OPENCART_EMAIL}36 volumes:37 - opencart_data:/bitnami/opencart38 depends_on:39 - mysql40 networks:41 - opencart_net4243 phpmyadmin:44 image: phpmyadmin:latest45 ports:46 - "8081:80"47 environment:48 - PMA_HOST=mysql49 depends_on:50 - mysql51 networks:52 - opencart_net5354volumes:55 mysql_data:56 redis_data:57 opencart_data:5859networks:60 opencart_net:61EOF6263# 2. Create the .env file64cat > .env << 'EOF'65# OpenCart66MYSQL_PASSWORD=secure_mysql_password67MYSQL_ROOT_PASSWORD=secure_root_password68OPENCART_USER=admin69OPENCART_PASSWORD=secure_admin_password70OPENCART_EMAIL=admin@example.com7172# Shop at http://localhost73# Admin at http://localhost/admin74EOF7576# 3. Start the services77docker compose up -d7879# 4. View logs80docker 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-complete/run | bashTroubleshooting
- OpenCart installation wizard loops endlessly: Ensure OPENCART_DATABASE_PASSWORD matches MYSQL_PASSWORD in environment variables
- Shopping cart sessions not persisting: Verify Redis container is running and accessible on opencart_net network
- Database connection failed error: Wait 30-60 seconds after startup for MySQL to fully initialize before OpenCart connects
- phpMyAdmin shows 'Connection refused': Check that MySQL container is healthy and PMA_HOST points to 'mysql' service name
- OpenCart admin panel returns 404 errors: Ensure /bitnami/opencart volume has proper write permissions for web server
- Product images not displaying: Verify opencart_data volume mount and check image directory permissions in container logs
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
Components
opencartmysqlredisnginx
Tags
#opencart#ecommerce#php#lightweight#extensions
Category
E-Commerce & BusinessAd Space
Shortcuts: C CopyF FavoriteD Download