Would you like to learn how to install Drupal using Docker on Ubuntu Linux? In this tutorial, we are going to show you all the steps required to perform the Drupal installation using Docker on a computer running Ubuntu Linux in 5 minutes or less.
• Ubuntu 20.04
• Ubuntu 18.04
• Ubuntu 19.04
• Drupal 9.0.6
• MySQL 5.7
Tutorial Drupal – Docker Installation
Install the Docker service.
Download the MySQL docker image from the online repository.
Download the Drupal Docker image from the online repository.
List the Docker images installed on your system.
Here is the command output:
Create a docker volume to store the MySQL persistent data.
Verify the persistent data directory.
Here is the command output:
Optionally, create a symbolic link to an easier access location.
Start a MySQL container with persistent data storage.
Here is the command output:
In our example, the MySQL image was used to start a new container.
The new container has persistent data storage.
The container ID is 348b4ab00defe8e3621a61e5899d4eb04dd533046fce4cf2c5b0163f0717bd50.
The database ROOT account password configured was kamisama123.
A database named Drupal was created.
A database account named Drupal was created and the password kamisama123 was configured.
Create Docker volumes to store the Drupal persistent data.
Verify the persistent data directory.
Optionally, create symbolic links to an easier access location.
Start a Drupal container with persistent data storage.
Here is the command output:
In our example, the Drupal image was used to start a new container.
The new container has persistent data storage.
The container ID is b9378d8476ba976a4d09b5035b8cf77fc644efc5cb37639350357c8c0c222c82.
The Drupal container was linked to the MySQL container.
Tutorial Docker – Drupal installation
Open your browser and enter the IP address of your web server.
In our example, the following URL was entered in the Browser:
• http://192.168.100.10
The Drupal web installation interface will be presented.
On the database configuration screen, access the advanced options and enter perform the following configuration.
• Database type – MySQL
• Database name – drupal
• Database password – kamisama123
• Database host – Enter the MySQL container name.
After finishing the installation, the Drupal dashboard should be presented.
Congratulations! You have finished the Drupal Docker installation.
Tutorial Drupal – Docker container management
Verify the status of all Docker containers using the following command:
Verify the status of a container.
To stop a container, use the following command:
To start a container, use the following command:
To restart a container, use the following command:
In case of error, use the following command to verify the container logs.
In our examples, we demonstrated how to manage Drupal containers.