Local Development Setup
Setting up and configuring local development environments for Commerce Cloud projects.
Setting up and configuring local development environments for Commerce Cloud projects.
When developing a Magento Commerce Cloud project locally, you have several environment options:
Docker environments can be configured to closely replicate the actual cloud infrastructure where your code will run.
Test your application in production mode locally:
./vendor/bin/ece-tools docker:build --mode="production"
This creates a read-only environment that helps identify:
Docker intelligently replicates configuration from .magento.app.yaml:
The Cloud Composer meta-package includes:
Since the base Commerce application is present, you can use any development system:
Note: While you can use any system, Docker provides the most accurate replication of the cloud environment.
# Build Docker environment
./vendor/bin/ece-tools docker:build
# Build with specific mode
./vendor/bin/ece-tools docker:build --mode="developer"
./vendor/bin/ece-tools docker:build --mode="production"
Use Case: Validate your code works in production before deployment!
Pro plans use a custom auto_increment_increment value of 3 instead of the default 1.
Why? Production environment has three database nodes running in a cluster.
This prevents ID conflicts when multiple nodes write simultaneously.
NEVER SET PRIMARY KEY VALUES MANUALLY!
Setting primary keys manually could cause:
When developing for Pro plans:
The .magento.app.yaml file defines your cloud environment configuration:
# Example .magento.app.yaml
name: mymagento
type: php:8.1
relationships:
database: "mysql:mysql"
redis: "redis:redis"
elasticsearch: "elasticsearch:elasticsearch"
hooks:
build: |
set -e
php ./vendor/bin/ece-tools run scenario/build/generate.xml
php ./vendor/bin/ece-tools run scenario/build/transfer.xml
deploy: |
php ./vendor/bin/ece-tools run scenario/deploy.xml
post_deploy: |
php ./vendor/bin/ece-tools run scenario/post-deploy.xml
crons:
cronrun:
spec: "* * * * *"
cmd: "php bin/magento cron:run"
When using ece-tools docker:build, Docker reads this file and:
./vendor/bin/ece-tools docker:build --mode="production"