Official dockerfiles for Aegir.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
releases Issue #2942646 by helmo, colan: [meta] 3.15 release (bugfix/patches) May 2, 2018
.travis.yml Let's add some colors with xterm. Jul 14, 2017
Dockerfile Add version to fix perms scripts. Dec 14, 2018
Dockerfile-ansible Adding a Dockerfile for aegir with ansible installed. Jul 29, 2017
Dockerfile-latest Add ENV AEGIR_HTTP_SERVICE_TYPE apache to all dockerfiles. Nov 15, 2018
Dockerfile-local Default NEW_UID to 1000 Oct 20, 2017
Dockerfile-local-privileged Adding a local privileged container. Aug 1, 2017
Dockerfile-local-xdebug Default NEW_UID to 1000 Oct 20, 2017
Dockerfile-packaging_base Issue #2860834: Add Docker base image for building our Debian packages Mar 31, 2017
Dockerfile-php7 Add curl to all containers. Nov 15, 2018
Dockerfile-php71 Add curl to all containers. Nov 15, 2018
Dockerfile-php72 Add curl to all containers. Nov 15, 2018
Dockerfile-phpAll Add curl to all containers. Nov 15, 2018
Dockerfile-privileged Base privileged image on php7 Oct 28, 2018
Dockerfile-test Base "test" image off "local" image. The only difference in local ima… Aug 22, 2016
Dockerfile-web Make sure aegir user has a shell. Mar 16, 2018
Dockerfile-web-ubuntu16 Make sure aegir user has a shell. Mar 16, 2018
Dockerfile-xdebug Pin xdebug to 2.5.5 so it works with PHP version < 7 Feb 14, 2018
Dockerfile-xdebug-php7 Adding php7 xdebug container. Nov 6, 2018
LICENSE Initial commit Jul 15, 2016 Finish changing hostname from aegir.docker to Apr 1, 2017
docker-compose-tests.yml Fixing image in docker-compose-tests.yml to use aegir/hostmaster:dev … Jul 14, 2017
docker-compose.yml Removing unneeded "links" and "depends_on" Jun 22, 2017 Removing confusing comment. Jul 31, 2016 Add AEGIR_HTTP_SERVICE_TYPE so we can set https on install. Nov 12, 2018
httpd-foreground Put a placeholder docker.conf file so apache doesn't freak out when t… Feb 15, 2017 Attempt to force colors in test output. Feb 14, 2018
sudoers-aegir adding sudoers-aegir file Jul 12, 2016

What is Aegir?

Aegir is a free and open source hosting system for Drupal, CiviCRM, and Wordpress.

Designed for mass Drupal hosting, Aegir can launch new sites with a single form submission or API call (See Hosting Services.

Aegir itself is built on Drupal and Drush, allowing you to tap into the large contributed module community.

For more information, visit

How to use this image

Manual launch:

$ docker run --name database -d -e MYSQL_ROOT_PASSWORD=12345 mariadb 
$ docker run --name hostmaster --hostname -e MYSQL_ROOT_PASSWORD=12345 --link database:mysql -p 80:80 aegir/hostmaster

docker-compose launch:

  1. Create a docker-compose.yml file:
version: '2'

    image: aegir/hostmaster
      - 80:80
      - database
      - database
      MYSQL_ROOT_PASSWORD: strongpassword

    image: mariadb
      MYSQL_ROOT_PASSWORD: strongpassword
  1. run docker-compose up.

Development Environment

We have created a development toolkit located at ([]. The scripts in this folder will prepare your host machine with the source code and containers needed to run and develop Aegir.

Important parts:

  • MYSQL_ROOT_PASSWORD: 12345. This must match for database and hostmaster containers. If launching in production, choose a secure password.
  • --hostname The hostname of the container must be set to a fully qualified domain that resolves to the host machine. * resolves to, so it is useful to use for launching locally.
  • -p 80:80. Since this one container is going to host numerous websites for you, it expects to be assigned to port 80 (unless you are hooking up another container like varnish or a load balancer on the same machine.)

Environment Variables


Default: admin

The username of UID1 and the client node.


Default: aegir@aegir.docker

The email for UID1. The welcome email for user 1 gets sent to this address.


Defalt: /var/aegir/.drush/provision/aegir.make

The makefile to use for building the front-end drupal dashboard. Defaults to hostmaster.

May use to build a devmaster instance.


Default: hostmaster

The install profile to run for the drupal front-end. Defaults to hostmaster.

May use "devmaster" if you used the devmaster makefile.


Default: /var/aegir/hostmaster

The path to install hostmaster.


Aegir on Docker

This project is an experiment to (finally) get Aegir working inside Docker.

This is not a project to get Aegir deploying docker (yet)

An official Aegir docker image will make it really easy to fire up an aegir instance for production or just to try.

This image will also make contributing and testing much, much easier.




  1. Clone this repo:

    git clone

  2. Change directories into the codeabase.

    cd aegir-dockerfile

  3. Edit your /etc/hosts file to add the container's hostname, which is set in docker-compose.yml ( by default). It must point at your docker host. # If running native linux # If running on OSx, or using default docker-machine

  4. Build the image. (Optional)

If you made your own changes to the dockerfile, you can build your own image:

docker build -t aegir/hostmaster -f Dockerfile.ubuntu.14.04 .
  1. Run docker compose up.

    docker-compose up

If this is the first time, it will download the base images and hostmaster will install. If not, the database will be read from the volume as already having installed, so it will just run the drush commands to prepare the server.

You will see the hostmaster install success output:

  hostmaster_1 | ==============================================================================
  hostmaster_1 |
  hostmaster_1 |
  hostmaster_1 | Congratulations, Aegir has now been installed.
  hostmaster_1 |
  hostmaster_1 | You should now log in to the Aegir frontend by opening the following link in your web browser:
  hostmaster_1 |
  hostmaster_1 |
  hostmaster_1 |
  hostmaster_1 |
  hostmaster_1 | ==============================================================================

Visit that link, but change the port if you had to change it in docker-compose.

That's it!

You can access the container via terminal with docker exec:

    docker exec -ti aegirdocker_hostmaster_1 bash

Since the user of the container is already set to aegir, you can just run "bash".

Tech Notes

Developing Dockerfiles

It can be confusing and monotonous to build the image, docker compose up, kill, remove, then rebuild, repeat...

So I use the following command to ensure fully deleted containers and volumes, a rebuilt image, and a quick exit if things fail (--abort-on-container-exit)

docker-compose kill ; docker-compose rm -vf ; docker build -t aegir/hostmaster ../ ; docker-compose up --abort-on-container-exit

You only need to run this full command if you change the Dockerfile or the docker-entrypoint-*.sh files.

If you are only changing the docker-compose.yml file, sometimes you can just run:

docker-compose restart

Or you can kill then up the containers if you need the "CMD" or "command" to run again:

docker-compose kill; docker-compose up


The trickiest part of getting Aegir Hostmaster running in docker was the hostname situation. Aegir installs itself based on the servers hostname. This hostname is used for the server nodes and for the drupal front-end,

I've worked around that for now by using a file that does the hostmaster installation at run time.


A stock hostmaster requires mysql, apache and supervisor in order to have a responsive queue. The "docker way" is to separate services out.

I was able to use an external database container for MySQL.

Apache automatically gets started when Hostmaster is verified, so doesn't have to do it.

Finally, instead of Supervisor, I realized we could use docker itself to run drush @hostmaster hosting-queued, so that is at the end of

Turns out, this results in a REALLY fast Aegir server!

Next Steps

  1. Figure out how to install Hostmaster in the image, then use to change the hostname and root mysql password dynamically. UPDATES:
    • If we keep the database as a second container, then hostmaster must always be installed at runtime, because the DB doesn't even exist until then.
    • If we want to release Aegir as a self-contained product, we should think about figuring out how to include everything in one container. See Rancher Server as an example of this: their container includes a MySQL server:
  2. Publish to DONE:
  3. Create multiple tagged versions for various OSes, PHP versions, and Aegir releases.