How to set up shopware 5 project using ddev Local system?

What is DDEV-Local?

– DDEV-Local is a Docker-based local development environment.

– It’s aimed at web developers, especially PHP developers.

– Developers run a website on their own local computer with almost no configuration of the computer.

– Developers can run multiple websites at the same time.

– Because Docker does all the heavy lifting, you don’t have to have even PHP or composer on your host computer.

– Has had first-class windows, macOS, and Linux support for ages.

DDEV-Local step-by-step

Step 1. Install Homebrew

Step 2. Install DDEV

Step 3. Install Docker

Step 4. Install Docker Compose

Step 5. Docker Post Installation Steps

Step 6. Set up a Shopware 5 via DDEV

Step 1. Install Homebrew

  • The recommended installation of DDEV is with Homebrew.
  • Homebrew is a package manager that simplifies the whole process. It is also known as Linuxbrew. (The Missing Package Manager for macOS (or Linux))
  • Run command in terminal

sh -c “$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)”

  • The system will finish with the installation of Homebrew. It will also prompt you about adding the script to your $PATH, in other words making it executable by typing the command brew in your terminal.
  • Type these terminal commands one by one:

test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)

test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)

test -r ~/.profile && echo “eval \$($(brew –prefix)/bin/brew shellenv)” >>~/.profile

echo “eval \$($(brew –prefix)/bin/brew shellenv)” >>~/.profile

NOTE : If your system is based on RedHat, CentOS, or Fedora, replace .profile with .bash_profile.

Step 2. Install DDEV

  • Once Homebrew is in the $PATH, you can use it by typing the command brew:

brew tap drud/ddev && brew install ddev

  • This will install DDEV and other required dependencies.
  • Once DDEV is installed, you need to run the installation command for mkcert, a tool that provides valid SSL certificates for your local development environment. A site domain with a valid SSL certificate starts with https:// instead of https://
  • Type: mkcert -install
  • Check the system logs and resolve all missing dependencies if the installation was not successful and try again.

Step 3. Install Docker

  • Remove any old Docker installation on your system if available.
  • Type: sudo apt-get remove docker docker-engine docker.io containerd runc

sudo apt-get remove docker docker-engine docker.io containerd runc

sudo apt-get update

sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

  • Type Y and hit Enter to proceed with the installation
  • The system will install all the needed packages. You can now add the Docker repository key to your system. :
    • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
    • sudo apt-key fingerprint 0EBFCD88 (Check that both fingerprints are equal)
    • sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
    • sudo apt-get update
  • Type: sudo apt-get install docker-ce docker-ce-cli containerd.io

Step 4. Install Docker Compose

  • Compose is a Docker tool which lets you define and execute multiple applications within the software containers.
  • Type:
    • sudo curl -L “https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)” -o /usr/local/bin/docker-compose
    • sudo chmod +x /usr/local/bin/docker-compose (in order to make the script executable)
  • Check the Docker and Docker Compose installed versions with docker-compose –version and docker –version.
  • The system will install all the needed packages. You can now add the Docker repository key to your system. :
    • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
    • sudo apt-key fingerprint 0EBFCD88 (Check that both fingerprints are equal)
    • sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
    • sudo apt-get update
  • Type: sudo apt-get install docker-ce docker-ce-cli containerd.io

Step 5. Docker Post Installation Steps

  • Now it is time to check if Docker is working properly.
  • Type: sudo docker run hello-world
  • As you can notice, you can run Docker only with root privileges. To manage Docker as a non-root user, it is necessary to create a docker group and add users to it.
  • Type:
    • sudo groupadd docker
    • sudo usermod -a -G docker $USER
    • newgrp docker
    • docker run hello-world

Step 6. Set up a Shopware 5 via DDEV

  • You can set up a Shopware 5 many ways, but this shows you one recommended technique
  • Create directory like ‘mkdir -p workspace/’
  • Clone shopware 5 via git repo.
  • Fire
    • ddev start
    • composer install
    • cp .env.ddev .env
  • On first start up import database: ddev import-db –src=.ddev/dump.sql
  • After big database changes renew the db dump (ddev export-db –gzip=false > .ddev/dump.sql)
  • Have fun: https://shopware.ddev.site/

Payal is our Shopware 5 developer with hands on experience with Shopware 5 for more than 4 years now, worked for 35+ Plugins and are published on shopware store successfully. She's leading a team of 7+ people working on more than 10 projects simultaneously. Theme development, Custom Extension Development, Shopware Plugin Development, Migrations and many more, she has been consulting many German client and agencies, helping their Shopware 5 business to grow.