Shopware 6 App Server Development with ddev

ddev ( is an extremely easy to use docker environment. Even though it does not provide all the degrees of freedom you will get with a custom docker-compose installation, I find it helpful in particular as a development environment for our client projects. It integrates very well with github/gitlab and the deployment pipelines.

In an earlier post, I have explained how to use ddev for setting up a local development environment for Shopware 6 (‘five minute setup guide’):

Read here how to set up a local development environment for both an app server and a Shopware 6 client.

Shopware 6′ app concept is explained in detail here: A Shopware 6 app consists of two parts: One, that resides with the Shopware installation itself, like an ordinary extension (or plugin, as we used to say). Let me call it the ‘app client’. The other part is an app server, needed to provide additional functionality otherwise not available within Shopware 6. In fact, the app server part is optional, and you will see that many apps in the store just bring an app client.

Now when you develop an app server component for your Shopware 6 app, you basically need a second local, independent development environment that provides the needed containers for the app server. ddev is a perfect tool for this, as all web server set up with ddev expose individual unique ports and thus can run in parallel on your local machine.

For your convenience, I have created an example app server template on github: You may want to check it out before continuing.

For this tutorial I assume that you have installed docker and ddev on your machine as described in the docs:

As a first step, edit .ddev/config.yaml and adjust it to your needs.

# <project-root>/.ddev/config.yaml
name: <name of your project>
type: php
docroot: public
php_version: "8.0"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
mariadb_version: ""
mysql_version: "8.0"
use_dns_when_possible: true
composer_version: ""
  - APP_URL=https://${DDEV_SITENAME}
omit_containers: [dba]

Adjust the environment (webserver_type, php_version, mysql_version) to your needs (typically it should be similar to the expected production server). Note that the name of your project becomes the DDEV_SITENAME to be used in the project url, so you may want to keep it short. It can be different from the name of your app!

Create a .env.local file in your project root and edit it like this:

# .env.local

Then start ddev with ddev start from inside your project folder. SSH into your container with ddev ssh, and then run composer install and bin/console doctrine:migrations:migrate. That’s it, your are set.

You may want to create a unique app secret using the command bin/console regenerate-app-secret. Copy the generated secret as appSecret into the .env.local file. (Obviously this only works after you have run composer install.)

To setup the corresponding app client site, I recommend to install a ddev based Shopware 6 environment as described here:

Now copy the entire folder custom/apps/VanWittlaerExampleApp from your app server into your app client. You may need to edit the registrationUrl and webhook urls in the manifest.xml file to replace the ‘myapp’ part with the name you chose for your project. Also, fill out the secret with the one generated for the app server in the previous step. Install and activate the VanWittlaerExampleApp using the Admin of your app client installation.

Container-to-Container Communication

For two local ddev containers to talk to each other, curl on the client side has to trust the ssl certificate of the server side. This needs some extra ddev configuration between the two web containers.

Add a docker-compose.links.yaml file to your .ddev folder on both the app server and the app client side. On the client side, this file should look like this:

# client (Shopware 6) side: .ddev/docker-compose.links.yaml
version: '3.6'
      - "ddev-router:<name of your project>"

<name of your project> is the name of your app server project.

On the server side, the corresponding client needs to be defined like this:

# app server side: .ddev/docker-compose.links.yaml
version: '3.6'
      - "ddev-router:<name of your Shopware 6 project>"

Questions? Suggestions?

Please share your thoughts using the comment form below!

Leave a Reply

Your email address will not be published.