Benny's Shopware Notebook
  • Introduction
    • How to Get in Touch
  • ddev for Shopware
    • Less than 5 Minutes Install with ddev and Symfony Flex
    • Storefront and Admin Watchers with ddev
    • Message Queue Setup with ddev
    • Contribute with ddev
    • Performance Tweaks
    • RabbitMQ with ddev
    • phpstan pro with ddev
    • Fetch Media from Production or Staging Server
  • Hosting
    • Setting up a Cloud Server with ddev
    • How to Trouble-shoot and Evaluate Environment Variables
    • Media URLs Out Of Sync between Servers
    • RabbitMQ
    • Running Shopware CE with PaaS
    • SFTP-Users
    • Basic-Auth for Shopware 6 with nginx
    • How to Avoid Failed Systemd Units
    • JWT-Secrets as Environment Variables
  • Deployment
    • Close-to-Zero Downtime Deployment
    • Docker-Images for Deployment with Gitlab-Runners
    • PHP Cache Related Issues
  • Development
    • Patching the Core
    • How to Discover Available Updates?
    • Local Testing of Shopware Commercial Features
  • Administration
  • Database
  • Migration
    • Side Effects
Powered by GitBook
On this page
  • Why use ddev with Symfony Flex template?
  • Scripted Install
  • The Script Explained
  • Use Traditional Install for < 6.5
  • Updating Shopware and Plugins

Was this helpful?

  1. ddev for Shopware

Less than 5 Minutes Install with ddev and Symfony Flex

This page describes how to install Shopware in a local ddev environment, using Shopware's Symfony Flex template.

Previousddev for ShopwareNextStorefront and Admin Watchers with ddev

Last updated 2 months ago

Was this helpful?

Why use ddev with Symfony Flex template?

If you’re used to using ddev to run your local projects, you’ll find it easy and straightforward to use the new Symfony Flex template to develop and contribute to client projects. While the template comes with its own Docker setup, one advantage of using it within ddev is that you do not need a local composer environment. In fact, the only prerequisites on your local machine are Docker and .

Not to mention the benefits of ddev’s ease of use and flexibility.

Scripted Install

The first thing to do is create a project folder, let’s call it my-project, and cd into it. The name of this folder will be the project name used with ddev.

The easiest and quickest way for the install is to copy my installation script file from Github into your project folder. Then run the following command:

chmod +x install.sh && ./install.sh

When the installation script is finished, you will have

  • a current version of Shopware installed in the folder shopware.

  • Use the ddev ssh command to ssh into the project’s web container.

  • Browser-wise, your project storefront can be reached at https://my-project.ddev.site,

  • the project admin can be found at https://my-project.ddev.site/admin

  • or use the command ddev launch /admin to launch it directly in your preferred browser.

  • The admin credentials are admin and shopware.

The Script Explained

The first command – ddev config – creates a configuration file for your ddev project with these settings:

  • --project-type=php – this tells ddev to setup a plain php project. Note that ddev also knows a project type shopware6. With this, ddev will initiate some basic settings (e.g. DATABASE_URL) in a .env.local file, which, at the time of writing, is created in the project root folder instead of the working dir for the web service. I personally prefer less 'magic' thus more control when working on a custom project. The required settings are included in the above command with the option --web-environment-add (see below).

  • --disable-settings-management – leaves you in full control of the .env.local file

  • --docroot=shopware/public – this directive tells the webserver where to find the web root

  • --web-working-dir=/var/www/html/shopware – this defines the working dir for the web service

  • --composer-root - if you want to use the ddev composer command, this tells ddev where to find your composer.json file

  • --database=mysql:8.0 – I recommend to use mySQL as a database, instead of the default MariaDB used by ddev

  • --php-version=8.3 – you may want to adjust the php version to your needs

  • --nodejs-version=22 – you may want to adjust the nodejs version to your needs. 22 is the current LTS of node.js and supported by Shopware 6.6.9 and above. Downgrade it to 18 if your are still on Shopware 6.5.x

  • --webserver-type=apache-fpm – I recommend to Apache here (instead of ddev’s default nginx), as it is kind of Shopware standard

  • --web-environment-add="..." – this command initializes all relevant environment variables for Shopware, thus we do not need a .env.local file

The next command – ddev start – starts your project containers.

Shopware itself then is installed with this command

ddev exec "cd /var/www/html && rm -rf shopware/ && composer create-project shopware/production shopware -n"

We need to play a little trick here and remove the shopware folder created earlier by ddev, because composer create-project requires a non-existent target project folder.

Finally, the command

ddev exec bin/console system:install --basic-setup --shop-locale=de-DE

initializes the Shopware system and database. Carefully chose your shop locale here (as either de-DE or en-GB) as it might be a bit tricky to change it afterwards.

Use Traditional Install for < 6.5

Note that this Symfony Flex based approach is applicable only for Shopware 6.5.0.0 and above. Should you need to install an earlier version, follow the „traditional“ approach, i.e. setup the ddev project and then use the Shopware-provided installation zip file and install it within your ddev project.

Updating Shopware and Plugins

With Symfony Flex, updating is now just a matter of running composer update – you do not even need Shopware’s shopware-installer.phar.php. Just run

bin/console system:update:prepare
composer update
bin/console system:update:finish

You may want to restrict the composer update command to particular versions, components or plugins.

After running composer update, check that you recipes are up-to-date with the command composer recipes. Apply updates as advised.

ddev
install.sh