System Requirements
OpenCart 4.x requires:- PHP 8.0+ with extensions:
curl,gd,zip,mysqli,openssl,zlib - MySQL 5.7+ or MariaDB 10.3+ (or compatible database)
- Web Server: Apache 2.4+ or Nginx 1.18+
- Composer for dependency management
Docker Setup (Recommended)
OpenCart includes a Docker development environment using Docker Compose.Initial Setup
Initialize Environment
Copy the example environment configuration:This creates
docker/.env.docker from the example template.Install OpenCart
Visit
http://localhost in your browser and complete the web installer:- Accept the license agreement
- Pre-installation check passes automatically
- Configure database connection (default credentials in
docker/.env.docker) - Set up admin account
- Complete installation
Docker Commands
| Command | Description |
|---|---|
make up | Start all services |
make down | Stop and remove containers |
make php | Open shell in PHP container as www-data |
make logs | Tail all service logs |
make restart | Restart all services |
make build | Rebuild Docker images |
Accessing the PHP Container
To run CLI commands inside the PHP container:www-data user. From here you can:
Native Installation
For custom setups without Docker:Install PHP Dependencies
From the repository root:upload/system/storage/vendor/ as configured in composer.json.
Web Server Configuration
Apache
Point your virtual host to theupload/ directory:
Nginx
Database Setup
Create a MySQL database and user:File Permissions
Ensure the web server can write to required directories:Development Tools
Code Quality Checks
Run these checks before committing (same as CI):- Syntax Lint
- Static Analysis
- Code Style
IDE Configuration
PHPStorm / IntelliJ IDEA
- PHP Language Level: Set to PHP 8.0 or 8.1
- Namespaces: Mark
upload/as source root - Code Style: Import
.php-cs-fixer.phpsettings - Database: Connect to your development database for code completion
VS Code
Install recommended extensions:- PHP Intelephense
- PHP Debug (with Xdebug)
- EditorConfig for VS Code
.vscode/settings.json:
Debugging
Xdebug with Docker
Add todocker/.env.docker:
Xdebug with Native PHP
Install Xdebug extension:php.ini:
Configuration Files
After installation, OpenCart creates two config files:Next Steps
Architecture
Understand OpenCart’s architecture
Coding Standards
Follow coding conventions
MVC Pattern
Learn the MVC pattern
Routing
Understand routing system

