Would you like to learn how to install Moodle using Docker on Ubuntu Linux? In this tutorial, we are going to show you all the steps required to perform the Moodle installation using Docker on a computer running Ubuntu Linux in 5 minutes or less.

• Ubuntu 20.04
• Ubuntu 18.04
• Ubuntu 19.04
• Moodle 3.9.2
• MariaDB 10.5.5

Tutorial Moodle – Docker Installation

Install the Docker service.

Copy to Clipboard

Create a Docker network.

Copy to Clipboard

Download the MariaDB docker image from the online repository.

Copy to Clipboard

Download the Moodle docker image from the online repository.

Copy to Clipboard

List the Docker images installed on your system.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Create a docker volume to store the MariaDB persistent data.

Copy to Clipboard

Verify the persistent data directory.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Optionally, create a symbolic link to an easier access location.

Copy to Clipboard

Start a MariaDB container with persistent data storage.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, the MariaDB image was used to start a new container.

The new container has persistent data storage.

The container ID is 2df3ce59a3d8e52723554258d2781da37223249848064b0cadb1c80e57d0d1d0.

The database ROOT account password configured was kamisama123.

A database named Moodle was created.

A database account named Moodle was created and the password kamisama123 was configured.

Create a docker volume to store Moodle persistent data.

Copy to Clipboard

Verify the persistent data directory.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

Optionally, create a symbolic link to an easier access location.

Copy to Clipboard

Start a Moodle container with persistent data storage.

Copy to Clipboard

Here is the command output:

Copy to Clipboard

In our example, the Moodle image was used to start a new container.

The new container has persistent data storage.

The container ID is 5db92cf1bf78b7117350a2943fd5002d35073bdbbf3a0175a2ee0223a7156431.

It may take up to 5 minutes for Moodle to finish the installation process.

Tutorial Docker – Moodle 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 Moodle web interface should be presented, click on the Login option.

moogle login

On the prompt screen, enter the following information.

• Username: user
• Password: bitnami

After a successful login, the Moodle dashboard will be displayed.

moodle dashboard

Congratulations! You have finished the Moodle Docker installation.

Tutorial Moodle – Docker container management

Verify the status of all Docker containers using the following command:

Copy to Clipboard

Verify the status of a container.

Copy to Clipboard

To stop a container, use the following command:

Copy to Clipboard

To start a container, use the following command:

Copy to Clipboard

To restart a container, use the following command:

Copy to Clipboard

In case of error, use the following command to verify the container logs.

Copy to Clipboard

In our examples, we demonstrated how to manage Moodle containers.