Moodle App Docker Images

From MoodleDocs


Moodle HQ provides a couple of Docker images that contain the Moodle App ready for use. You can search all the available versions in Docker Hub.

In order to run them, you should have Docker installed and we recommend that you have some basic understanding on how it works.

Running the images

You can run the latest stable version of the application using the following command:

docker run --rm -p 8100:80 moodlehq/moodleapp

This will launch the container running the application and expose it locally on your port 8100. You should be able to open it on http://localhost:8100.

If you want to use a specific version, you can do it using the tag with the release number:

docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5

You can also use the development version using the next tag:

docker run --rm -p 8100:80 moodlehq/moodleapp:next

Using a specific environment

By default, the application will be launched on a production environment. If you only want to use the application, that will suffice. But if you are trying to debug or run some tests it may not work.

You can use images on different environments by adding their short name as a suffix. The available environments are production (no suffix), development (-dev suffix) and testing (-test suffix):

# Using the latest stable version
docker run --rm -p 8100:80 moodlehq/moodleapp:latest-test
docker run --rm -p 8100:80 moodlehq/moodleapp:latest-dev

# Using a specific version
docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5-test
docker run --rm -p 8100:80 moodlehq/moodleapp:3.9.5-dev

# Using the latest development version
docker run --rm -p 8100:80 moodlehq/moodleapp:next-test
docker run --rm -p 8100:80 moodlehq/moodleapp:next-dev

Using old versions

Before version 3.9.5, images didn't support specifying the environment and they were always run as development. You will also notice that they take a while to launch and they are exposed in port 8100 instead, that's because these images contained the source code and they were run using Angular's development server. This has been improved since and images are easier to work with.

If you want to use an old version, you can run the following command:

docker run --rm -p 8100:8100 moodlehq/moodleapp:3.6.0

Tagged releases are only available from version 3.6.0 onwards.