| name | shopware-ddev |
| description | Use when running Shopware 6 console commands, building assets, managing plugins/themes, or working with the database in a DDEV environment. Quick reference for all important ddev and Shopware CLI commands. |
Shopware 6 + DDEV Command Reference
Related skills: shopware (plugin architecture, DAL, events) · shopware-utils (sub-bundles, auto-resources) · ddev-development (DDEV config, PHP/Node/DB version changes, port setup, Dockerfile)
All commands run inside the DDEV container. Prefix with ddev exec or use ddev ssh for interactive use.
DDEV Basics
| Task | Command |
|---|
| Start | ddev start |
| Stop | ddev stop |
| Restart | ddev restart |
| SSH into container | ddev ssh |
| Run single command | ddev exec <cmd> |
| Open browser | ddev launch |
| Show URLs / status | ddev describe |
| View logs | ddev logs |
| DB export | ddev export-db --file=dump.sql.gz |
| DB import | ddev import-db --file=dump.sql.gz |
| Snapshot | ddev snapshot --name=before-update |
| Restore snapshot | ddev snapshot restore before-update |
Plugin Management
ddev exec bin/console plugin:refresh
ddev exec bin/console plugin:install --activate PluginName
ddev exec bin/console plugin:update PluginName
ddev exec bin/console plugin:deactivate PluginName
ddev exec bin/console plugin:uninstall PluginName
ddev exec bin/console plugin:list
Theme & Storefront
ddev exec bin/console theme:compile
ddev exec bin/console theme:change --all
ddev exec bin/console theme:dump
ddev exec bin/build-storefront.sh
Administration
ddev exec bin/console bundle:dump
ddev exec bash -c "cd /var/www/html/src/Administration/Resources/app/administration && PROJECT_ROOT=/var/www/html npm run build"
Pitfall: bin/build-administration.sh was removed in newer Shopware versions. Always use the npm run build approach above. Without bundle:dump first, the build fails with a paths[0] must be of type string error because the plugin map is missing.
Asset Watching (HMR / Dev Server)
The Shopware storefront watcher runs a webpack dev server inside the container. DDEV must expose the port so the browser can reach it.
1. Expose ports in .ddev/config.yaml
web_extra_exposed_ports:
- name: storefront-watch
container_port: 9998
http_port: 9997
https_port: 9998
Then apply: ddev restart
2. Start the watcher
ddev exec bin/watch-storefront.sh
The watcher is now reachable at: https://<project>.ddev.site:9998
Shopware automatically injects the hot-reload script when APP_ENV=dev and the webpack dev server responds on port 9998.
Administration watcher
The admin watcher uses port 8080 by default:
- name: admin-watch
container_port: 8080
http_port: 8079
https_port: 8080
ddev exec bin/watch-administration.sh
Admin HMR URL: https://<project>.ddev.site:8080
Notes
- Remove the
#ddev-generated marker from .ddev/config.yaml before adding web_extra_exposed_ports, otherwise DDEV overwrites it on restart.
- Both watchers require
APP_ENV=dev in .env.local.
ddev describe shows all exposed ports after restart.
Cache
ddev exec bin/console cache:clear
ddev exec bin/console cache:warmup
ddev exec bin/console cache:pool:clear cache.http
ddev exec bin/console cache:pool:clear cache.object
Database & Migrations
ddev exec bin/console database:migrate --all
ddev exec bin/console database:create-migration --plugin PluginName --name MigrationName
ddev exec bin/console database:create-migration --bundle BundleName --name MigrationName
ddev exec bin/console database:migrate-destructive --all
Scheduled Tasks
ddev exec bin/console scheduled-task:run
ddev exec bin/console scheduled-task:list
ddev exec bin/console messenger:consume
Search & Indexing
ddev exec bin/console es:index
ddev exec bin/console dal:refresh:index
Import / Export
ddev exec bin/console import:entity products
ddev exec bin/console export:entity products
User & Sales Channel
ddev exec bin/console user:create --admin --firstName="Max" --lastName="Muster" --email="max@example.com" --password="secret" admin
ddev exec bin/console sales-channel:list
ddev exec bin/console sales-channel:update-domain localhost
Composer (inside container)
ddev composer install
ddev composer require vendor/package
ddev composer update vendor/package
ddev composer dump-autoload
Debugging
ddev exec bin/console debug:container
ddev exec bin/console debug:router
ddev exec bin/console debug:event-dispatcher
ddev exec bin/console debug:config PluginName
ddev logs
ddev logs -s db
ddev exec php -i | grep memory_limit
Running PHPUnit Tests
When running unit tests inside DDEV, DATABASE_URL using localhost resolves to a Unix socket (which doesn't exist). Prefix tests with the TCP address:
DATABASE_URL='mysql://db:db@db:3306/db' ddev exec vendor/bin/phpunit tests/unit/...
Full Reset (when things break)
ddev exec bin/console cache:clear
ddev exec bin/console plugin:refresh
ddev exec bin/console plugin:update PluginName
ddev exec bin/console theme:compile
ddev restart