Install Drupal 8 in a Docker Container

0
(0)

The instructions describe the installation and configuration of CMS Drupal 8 in a Docker container on a virtual server running the Centos 7 operating system.

What it is?
Open source CMS, easy to install, allows you to create sites of any size and easily manage them using backend administration. Compared to previous versions, Drupal 8 includes over 200 new features and improvements:

  • suitable for both small businesses and large companies;
  • dynamic content creation;
  • allows you to make site content more understandable for people with disabilities;
  • improved caching and integration with CDN;
  • display control without programming;
  • wide selection of languages.
    When deploying Drupal in a container, setting up the environment is greatly simplified: you do not need to separately install and configure the Apache or Nginx web server, php scripting language, and database configuration is also simplified.

Configure Docker
A Docker containerization system must be installed on your server.

To work, you need to download the mariadb DBMS image. To download the latest version, use the command:

# docker pull mariadb

An image of the content management system itself is also needed:

# docker pull drupal

This image already contains the necessary dependencies of the php scripting language and the apache web server.

Note: if you need a specific version of the product, then after the name indicate its number, for example, drupal: 8.0.0

Next, run the mariadb image with the parameter values:

# docker run -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=db_name -e MYSQL_USER=db_user -e MYSQL_PASSWORD=password -v mariadb:/var/lib/mysql -d --name container_name mariadb

For example:

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

The v key creates a mounted partition on the server where the database data will be stored. As a result of this command, you will have a container with the mariadb DBMS and the database deployed on it.

In the next step, you need to start drupal, having connected it with the deployed database, on the port, and as an alias specify a convenient name for the host on which the DBMS is located:

docker run --name <container_name> --link mariadb:<alias> -p <port>:<port> -d drupal

For example:

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

For remote access, do not forget to open the corresponding port:

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

Drupal setup
In the address bar of the browser, follow the link, indicating your ip-address:

<ip address>

For example:

111.222.110.12

Check installation instructions here

Similar Posts:

1,367

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

Scroll to Top