Self-host Moodle with Docker
A widely used, highly customizable learning management system for online courses.
This page describes the Levelrail template for Moodle (Applications). It deploys the services below as one Docker Compose app on your own server.
Project site: https://moodle.org.Recommended memory: about 1024 MiB.
Services, ports and volumes
| Service | Image | Container ports | Volumes |
|---|---|---|---|
mariadb | mariadb:11.1 | none | moodle_mariadb_data -> /var/lib/mysql |
moodle | docker.io/bitnamilegacy/moodle:4.3 | 8080 | moodle_data -> /bitnami/moodlemoodledata_data -> /bitnami/moodledata |
Environment variables
| Service | Variable | Value |
|---|---|---|
mariadb | MYSQL_DATABASE | Preset in the template |
mariadb | MYSQL_PASSWORD | Generated at deploy |
mariadb | MYSQL_ROOT_PASSWORD | Generated at deploy |
mariadb | MYSQL_USER | Preset in the template |
moodle | ALLOW_EMPTY_PASSWORD | Preset in the template |
moodle | MOODLE_DATABASE_HOST | Preset in the template |
moodle | MOODLE_DATABASE_NAME | Preset in the template |
moodle | MOODLE_DATABASE_PASSWORD | Generated at deploy |
moodle | MOODLE_DATABASE_PORT_NUMBER | Preset in the template |
moodle | MOODLE_DATABASE_USER | Preset in the template |
moodle | MOODLE_EMAIL | Preset in the template |
moodle | MOODLE_PASSWORD | Generated at deploy |
moodle | MOODLE_SITE_NAME | Preset in the template |
moodle | MOODLE_USERNAME | Preset in the template |
Passwords and keys marked as generated are created for you when the app is deployed and stored as secrets. Values are not shown here.
Deploy Moodle with Levelrail
In the dashboard, open Apps, choose New app, then Browse templates, and select Moodle. Review the Compose body and deploy.
With the CLI:
levelrail-cli templates deploy moodle --name my-moodleSee Service template catalog for how templates work, and Getting started if you have not installed Levelrail yet.
More Applications templates
All templates are listed in the self-host gallery.