DDEV - Simplify local dev environment

What the craftsmen use for their workshops is the local development environment for our development team. And we want it to be nice and simple and cosy. After all, we have enough other things to think and puzzle about.

From MAMP/LAMP and Docker to DDEV

In the past, each of our developers had an own MAMP/LAMP setup on his machine. This was easy to set up, worked rather uncomplicated and was also fast. However, over time, more and more problems arose. Among other things, some projects required newer php versions or special server settings that were difficult to reproduce on the local computers. In addition, it became more and more difficult to switch quickly between projects, because you always had to adjust the local configuration of your system.

For this reason we switched to a Docker-based setup for local development. This made it quite easy for us to reproduce the specifics of the servers on which the websites we were responsible for were located. This way we were better protected against unpleasant surprises after deployments - after all, the local development environment was now almost identical to the live server.

Over time, however, disadvantages of our docker setup became more apparent. It was still quite complicated to set up a new project (you had to copy various files to the right places, overwrite settings, ...). There was also a big weakness compared to the old MAMP/LAMP setup: It was not possible to run multiple projects locally at the same time; at least not without manually overwriting some settings. This finally made us rethink our setup and look for better alternatives. This is how we finally came up with DDEV.

What is DDEV?

DDEV-Local - so the complete name - is an open source based tool for software development. It builds up a local web server with the corresponding software packages, through which code can be easily built, tested and deployed. DDEV is based on Docker, but simplifies the work for the development team enormously and offers additional extensions.

Everything for a simple working environment

With DDEV, the initial setup is easy and done in no time. With only three commands in the command line (git clone, composer install, ddev start) a project is now usually set up locally. Two arguments in particular have convinced us to switch to DDEV:

  1. Setting up a local project is wonderfully simple and fast.
  2. We can easily run multiple instances in parallel in the local environment.

As a Drupal agency we work with various customer sites and not every developer has always set up all projects on his machine. With DDEV we now have a significant time saving especially with the changing sprints and security updates. The actual killer feature for us, however, is the parallel operation. During the weekly update evenings we install the latest updates in all our (SLA) customer projects. If every project were to be processed sequentially, our team would hardly be able to manage the updates in one single evening. Thanks to DDEV, we can now easily work on these projects in parallel and don't have to start complex workarounds with Docker. This saves us an enormous amount of time and hopefully long night shifts in the future.

There are other pre-built things for DDEV that simplify the work. For example the command ddev share, which makes the local instance of the page available via a public URL. This is a great way to test local sites on other devices (like the smartphone, tablet).

At https://github.com/drud/ddev-contrib there are a lot of useful examples and templates to extend DDEV. So you can easily add Solr or Varnish to your project setup to be as close as possible to the production environment.

Our summary

DDEV is already simplifying our daily work enormously now that we are using it in the first projects. The development teams can use Docker functions quickly and easily. And another plus: DDEV is not limited to Drupal. So we can recommend it to anyone who works with php projects and also wants to set up different CMS locally.

Stefan Borchert
  • CEO

Stefan maintains several Drupal contributed modules, has been working on Drupal core since the early days, and is author of Drupal 8 Configuration Management (Packt Publishing).