The Docker Devilbox

The Devilbox Project is a complete LAMP stack for Docker. If you use the Docker-Toolbox, this part of the documentation are worth reading.

In order to run the Devilbox you need to have Docker and Docker Compose installed on your system. Read through the Devilbox Prerequisites documentation for more information on that, if you are not running these applications yet on your system.

Install and configure the Devilbox

There is no installation routine. You just have to download the files from the Devilbox GitHub Page into an empty directory. The configuration takes place via a single file. In your directory you will find the file env-example. Copy and rename the file to .env. In the new file you can now make your configurations. The following settings need to be changed:

The individual steps (especially for the entries NEW_UID and NEW_GID) are well described in the Devilbox Documentation. For Contao itself, the other entries should be set to something like this:

  • HTTPD_SERVER=apache-2.4
  • PHP_SERVER=7.3
  • MYSQL_SERVER=mariadb-10.3

After every change in the configuration .env file, the Devilbox must be restarted.

Do not delete entries in the .env file! For example, by default, the entry HTTPD_SERVER=nginx-stable is set and # HTTPD_SERVER=apache-2.4 is disabled (see # at the beginning of the line). To change such entries you only have to enable or disable them by adding or removing the comment symbol. Make sure to enable HTTPD_SERVER=apache-2.4. As a web server nginx could also be used. For Contao, however, further configuration of the web server will then be necessary.

Start the Devilbox

Change to the directory and start the Devilbox with Docker. Initially it can take a while to create and load each Docker image and the containers. Restarts are much faster afterwards.

docker-compose up -d httpd php mysql

Stop the Devilbox

docker-compose stop

The Devilbox Dashboard

Once the Devilbox has started you can access the Devilbox dashboard in your browser under http: // The navigation gives you access to the various functions.

The IP address to use depends on your Docker environment. If you have the Docker-Toolbox installed, your IP address may be different. The IP address can be determined by using the command docker-machine ip.

Navigation Description
Home Status information
Virtual Hosts List of existing vhosts or websites
Emails E-Mail catch service
Databases Database information
Info More information
Tools Access to tools such as phpMyAdmin

Prepare the Contao installation

One or more Contao installations are created in the Devilbox directory data\www. Each Contao installation will reside in its own directory there. The directory name you choose will correspond to the vhost name. For example, a directory named contao4 will correspond to a vhost for contao4.loc.

You have created a directory (e. g. contao4). Change to this directory and create a new subfolder web. Copy the Contao Manager .phar file into this folder and rename the file to contao-manager.phar.php.

The domain suffix .loc is the default. However, this can be changed in the .env file via the entry TLD_SUFFIX. The manual editing of »/etc/hosts« may be neglected. The »Devilbox« offers a “Auto DNS feature.

Installation via the Contao Manager

Start phpMyAdmin in the Devilbox dashboard via Tools\phpMyAdmin and create a new database. Change then in the navigation to the page Virtual Hosts. Here you should see a list of your existing web projects and you can call them right away. You can now initiate the Contao installation via the Contao Manager. For example: contao4.loc/contao-manager.phar.php.

The further procedure is then identical to the normal installation.

Installation via the command line

By default, the PHP memory limit for the Devilbox’s PHP container is too low and therefore must be previously configured for Composer. Change to the directory cfg. Did you configure the devilbox with PHP 7.3 in the .env file, make the following changes accordingly in the directory cfg\php-ini-7-3. Create a file memory_limit.ini with the following entry:

memory_limit = -1

Afterwards you have to restart the Devilbox. The Devilbox main directory contains the files and shell.bat. So you can plug into the running Devilbox PHP container. Here are already numerous tools preinstalled. Also composer. After calling you are in the directory shared\http. To install e. g. Contao 4.8 in a directory contao48 you just have to enter:

composer create-project contao/managed-edition contao48 4.8

Create a new database:

mysql -u root -h mysql -p -e 'CREATE DATABASE db_contao49;'

Afterwards you can leave the container via exit and open the Contao Install Tool.

The Contao Install Tool

The settings for the Contao Install Tool are basically identical. You only have to pay attention to the following entries:

Entry Value
Host mysql
Username root
Password Do not enter a value

The user root with empty password is the Devilbox default setting. This could be changed in the Devilbox configuration. In this case, you must enter your configured credentials in the Contao Install Tool.