How to set up a Docker container with Drupal 8

In the steps that follow, we will look at how to install and set up the content management system on a v7 virtual server.

A few words about Drupal

Drupal is one of the most well-known content management systems () in the world. It is free, easy to install, and has a lot of features for making websites. Two hundred new features have been added to the eighth version.

  • A lot of languages to choose from for the interface;
  • Changes to caching and how it works with CDN;
  • Ability to create dynamic content; Ability to control the display without using program ;
  • Use for both personal and business needs;
  • Adapts to the needs of disabled users.

If you put Drupal in a container, it will be much easier to set up. You won’t have to install or again, prepare empty databases, or load the web language.

How to set up Docker

Docker is a system for making containers. For it to work with Drupal, it needs to be installed on the server ahead of time.

Step 2 is to download the image for the mariadb management system. If the device doesn’t have the latest version, it can be downloaded through the following line:

docker pull mariadb

Additionally, you need to download CMS Drupal:

docker pull drupal

The image will contain everything you need: a web scripting language and Apache.

The latest Dockerfile is at the link .

Please note that if you want to load a certain CMS model, you need to write the model name in the line after the colon. For example, drupal:7.5.5.

When loading the database, you need to specify the main parameters:

docker run -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE= -e MYSQL_USER= -e MYSQL_PASSWORD= -v mariadb:/var/lib/mysql -d --name mariadb

More detailed example:

docker run -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=drupal -e MYSQL_USER=duser -eMYSQL_PASSWORD=drupalpass -v mariadb:/var/lib/mysql -d --name mariadb mariadb

At the end, the user will get a container with a deployed database full of data inside. With the -v option, a mounted server partition is made into which the database is installed.

Starting Drupal and connecting it to the DBMS with the database hostname is done as follows:

docker run --name --link mariadb: -p : -d drupal

For example:

docker run --name drupal8 --link mariadb:mariadb -p 80:80 -d drupal

To be able to work via , you need to open the port:

iptables -A INPUT -p tcp --dport 80 -j ACCEPT

How to set up Drupal

You need to open a browser and follow the link, not forgetting to specify the IP:

In this way:

Language choice is the first step (in this case, it is Russian).

The second one shows the installation profile (standard is selected).

The third is choosing the name, user name, and password for the database.

You can write down the host and use more settings.

As soon as the changes are saved, the Drupal installation will start.

During the process, the system will ask you for personal information, such as your website’s domain name, email address, main user name, and password.

You can use different difficulty levels to write a strong password.

The configuration will then be updated on its own.

After this, a window with the control panel will open. The installation is now done.

To enter the Drupada panel, you will need to re-enter the username and password from the account that was generated earlier.

The whole process of installation is done.


Welcome to the world of DomainRooster, where roosters (and hens) rule the roost! We're a one-stop shop for all your entrepreneurial needs, bringing together domain names and website hosting, and all the tools you need to bring your ideas to life. With our help, you'll soar to new heights and hatch great success. Think of us as your trusty sidekick, always there to lend a wing and help you navigate the sometimes-complex world of domain names and web hosting. Our team of roosters are experts in their fields and are always on hand to answer any questions and provide guidance. So why wait? Sign up today and join the ranks of the world's greatest entrepreneurs. With DomainRooster, the sky's the limit! And remember, as the saying goes, "Successful people do what unsuccessful people are not willing to do." So don't be afraid to take that leap of faith - DomainRooster is here to help you reach for the stars. Caw on!