You are currently viewing Introducing DDEV – A Local Development Environment

Introducing DDEV – A Local Development Environment

Having a local development setup, which is easy to setup for many projects, is crucial for developers of web projects nowadays. A few months ago a new project hit the TYPO3 world: DDEV. In this post I will provide some guidance to the setup, pitfalls and some pros and cons.

What is DDEV?

The goal of DDEV by Drud is to provide an easy to use development environment for across many operating systems. DDEV is docker based and provides core components, like web server, php, database and a mail catcher. Furthermore it provides a routing solution in order to run several projects at the same time.

First Steps with DDEV

The prerequisite to run DDEV is to have Docker installed. Docker is a virtualization solution to run services on a machine. How to get docker and installation instructions are available at https://docs.docker.com/install/#supported-platforms.

In a second step DDEV must be installed. Detailed installation instructions are available at https://ddev.readthedocs.io/en/latest/#system-requirements. The installation is quite straight forward and should done in a couple of minutes.

The last step is to go to a current project directory and type ddev config and ddev start. If everything went fine, the project website should be functional. Of course you need to import the database and to provide “fileadmin” and “uploads” at the right places.

Customizing DDEV

It is also possible to add more services to a ddev installation like Apache Solr or Redis. The howtos are already available on Stackoverflow: Apache SolRand Redis. These two answers also serve as some kind of blueprint to add other services. Basically the configurations are classical docker-compose configuration files with some extra information for the ddev routing component.

Pros and Cons

Pro 1: Fast setup

One of the major advantages of ddev is the fast and simple setup: Install Docker, install ddev, run two cli commands … and the development instance is up and running. There was never a dev setup, which I got up and running that fast.

Pro 2: Routing component

Using a “standard” per project docker setup, running several projects at the same time is not easily possible. That normally means to check, whether and which project is currently running, stopping it and starting the other one. DDEV avoids this hassle by providing a routing component. It allows to run several projects in parallel. It takes care to find the right container depending on the “DDEV_SITENAME”.

Pro 3: Sharing of setups

If the project configuration is committed to the vcs, it is easily shared between all involved developers. A simple ddev start ensures, that all are using the same development setup. TBH, this is not a unique ddev advantage, because this can also be achieved by using an individual docker-compose setup. But the track to get there is way faster, than digging into docker and docker-compose itself.

ProCon 1: Tightly Coupled Docker Images

DDEV is based on their own docker images, which may suite for 90 to 95 percent of the instances. The central web component brings the webserver (nginx), the php component and the mailcatcher (mailhog) in one single image. So it is not possible to change the php component to a specific minor version (like I need it in some projects, due to customer constraints).

The current webserver is ngnix, which makes absolutely sense due to performance reasons. But this makes it impossible to test the htaccess setup before committing it the the vcs. There are already some discussion underway, whether to provide also an apache based image.

The advantage is that drud can guarantee that the combination of the images work on all supported platforms with a limited amount of time for the user. The disadvantage is that it costs much of the flexibility, that comes with docker and docker-compose.

Con 1: Performance

This is not a special ddev issue, but hits everyone using a docker based setup. Especially if you are used to the performance of a os native setup, it seems really slow. Docker itself is working continuously on improving the performance on platforms like MacOS or Windows.

Conclusion

DDEV makes it easy to get started with a local development environment. Even on existing projects, it is setup very fast due to the more or less automatic setup. I personally use it on several smaller development projects or, if I want to try out the newest TYPO3 features. For more specific requirements a normal docker-compose setup is more appropriate.

I want to thank the people of ddev for their project making local development much easier than before!

Credits

I want to thank all my supporters, who provide financial feedback to this blog. For this autumn I plan to start audio podcast. This needs some investments in technical stuff like a microphone. If you want to make that happen, you can support it via a one-time donation via paypal or a regular one via patreon.com.

Find out the possiblities here:

I found the blog post image on unsplash . It was published by StudioRepulic under the “Unsplash license“. It was modified by myself using pablo on buffer.