Docker4Drupal is a set of docker containers optimized for Drupal. Use docker-compose.yml file from docker4drupal repository to spin up local environment on Linux, Mac OS X and Windows.

Docker4Drupal is designed to be used for local development, if you're looking for a dev/staging/production solution consistent with Docker4Drupal check out Wodby.


The Drupal bundle consist of the following containers:

Container Versions Service name Image Enabled by default
Nginx 1.10 nginx wodby/drupal-nginx
PHP 5.3, 5.6, 7.0, 7.1 php wodby/drupal-php
MariaDB 10.1 mariadb wodby/mariadb
Redis 3.2 redis wodby/redis
Varnish 4.1 varnish wodby/drupal-varnish
Solr 5.5, 6.3, 6.4 solr wodby/drupal-solr
Memcached latest memcached _/memcached
Mailhog latest mailhog mailhog/mailhog
phpMyAdmin latest pma phpmyadmin/phpmyadmin
Node.js 7 node _/node
Traefik latest traefik _/traefik

Supported Drupal versions: 6, 7, 8.


Must know before you start

  1. To make sure you don't lose your MariaDB data DO NOT use docker-compose down (Docker will destroy volumes), instead use docker-compose stop. Alternatively, you can specify manual volume for /var/lib/mysql (see compose file), this way your data will always persist
  2. To avoid potential problems with permissions between your host and containers please follow this instructions
  3. For macOS users: Out of box Docker for Mac has poor performance on macOS. However there's a workaround based on docker-sync project, read instructions here


Feel free to adjust volumes and ports in the compose file for your convenience.

  1. Download docker-compose.yml file from docker4drupal repository and put it to your Drupal project codebase directory. This directory will be mounted to PHP and Nginx containers
  2. Depending on your Drupal version make sure you're using correct tags (versions) of Nginx and PHP images
  3. Make sure you have the same database credentials in your settings.php file and MariaDB service definition in the compose file
  4. Optional: import existing database
  5. Optional: add additional services (Varnish, Apache Solr, Memcached, Node.js) by uncommenting the corresponding lines in the compose file
  6. Optional: configure domains
  7. Run containers: docker-compose up -d
  8. That's it! You drupal website should be up and running at http://drupal.docker.localhost:8000

You can stop containers by executing:

docker-compose stop

Also, read how to access containers and how to get logs


We're actively working on this instructions and containers. More options will be added soon. If you have a feature request or found a bug please submit an issue on GitHub or Wodby Slack join us on Slack

We update containers from time to time by releasing new images tags.


This project is licensed under the MIT open source license.