Guide

Docker for Drupal Developers

What will you learn

  • Basic Docker concepts like containers and images
  • How to run Docker containers
  • Creating and managing sets of containers using Docker Compose
  • Creating Docker images from scratch to meet specific requirements
  • Modifying existing Docker images
  • "Dockerizing" an existing project
  • Integrating external services such as databases, caching systems, and search engines
  • Using Docker Hub, and automated builds for Docker images on Docker Hub

Overview

Docker is an efficient way to host Drupal applications that allows for the creation of consistent, isolated development environments that streamline testing, deployment, and collaboration, enhancing efficiency and reducing the "it works on my machine" problem.

In this guide, we introduce Docker, a container runtime that allows you to run pre-packed, sandboxed Linux applications anywhere. We'll start by running a single container on the command line, build up to running Drupal in Docker, cover how to build your own containers, and how to add Docker to your Drupal development workflow.

In these tutorials, we'll assume you're familiar with the basics of using the command line, including how to enter and run commands. (You can review our Command Line Basics course if you need to brush up.) A familiarity with Drupal development practices and Linux is helpful but not required.

The tutorials in this guide were authored by Tess Flynn. Tess, also known as socketwench, is a devops engineer who has worked with Drupal for over a decade. She is the author of the Flag module for Drupal and has given sessions at DrupalCons and DrupalCamps throughout the world on Drupal development, Docker, and DevOps.

Note: If you are just looking for a Docker-based local development environment solution for Drupal, we recommend using DDEV.

More information

Installing Drupal using the instructions in this tutorial will give you a working Drupal site that can be used for learning, or real-world project development.

Before you can work on a Drupal site locally (on your computer), you'll need to set up a local development environment. This includes all the system requirements like PHP and a web server, that Drupal needs in order to run. Our favorite way to accomplish this is using DDEV.

In this tutorial we'll learn:

  • How to install and configure DDEV for use with a Drupal project.
  • How to use DDEV's integrated Composer to download Drupal and Drush.
  • How to install Drupal inside DDEV so you can access the site and start doing development.

By the end of this tutorial, you should be able to set up a local development environment for learning Drupal or working on a new Drupal project.

Courses in this guide

Docker basics

This course covers the basics of Docker, including understanding containers and images, installing Docker, and running containers interactively and in detached mode. Learners will also explore advanced topics such as using Docker Compose to manage sets of containers, configuring bind volumes and environment variables, exposing ports, and importing/exporting databases.

Customize Docker images

This course covers the basics of building custom Docker images, adding files and installing applications within containers, and configuring applications to run optimally. Learners will also explore advanced topics such as setting custom entry points, customizing existing images, and ensuring container security.

Using Docker in a development workflow

This course covers the essentials of using Docker in your daily workflow, including setting up an existing project to use Docker,, creating and configuring Docker-specific settings, and optimizing workflows for multi-client and multisite Drupal installations. Additionally, learners will explore advanced topics such as using external services, sharing containers with teams, automating builds, and managing Docker in production environments.

“Drupalize.Me has trained thousands of Drupalistas. Their video lessons help to address our constant need for more Drupal talent. Drupal needs training like this to support its growth.”
Dries Buytaert
Drupal Founder and Project Lead
Photo of Dries Buytaert
“They’re easy to understand. They’re thorough. They’re funny. They’re always entertaining, and it makes it easy to learn parts of Drupal and how you can integrate it into your workflow and learn more and have a good time doing it.”
Roger Carr
Drupalize.Me Member
Photo of Roger Carr
“The mission of the Drupal Association is to foster and support the Drupal software project, the community, and its growth. Drupal education, like that provided by Drupalize.Me, is important to this mission.”
Megan Sanicki
Former Exec. Director, Drupal Assoc.
Photo of Megan Sanicki

FAQs

Am I required to sign a contract?
No. You can purchase a membership and/or cancel any time. Drupalize.Me is a pay-as-you-go service.

Can I preview tutorials before joining?
Yes! Just navigate to our tutorial library. Our free tutorials are labeled with a green "FREE" tag.

Can I watch videos on my mobile device?
Yes! Drupalize.Me is a responsive site and can be accessed in the browser on any mobile device. More FAQs