Self-host Moodle with Levelrail

A widely used, highly customizable learning management system for online courses.

  • Authormoodle
  • LicenceGPL-3.0-or-later
  • Memory1 GiB
  • Archarm64
  • Services2

How to self-host Moodle

  1. Pull the images

    2 images are pulled on your server.

    Show images
    • mariadb:11.1
    • docker.io/bitnamilegacy/moodle:4.3
  2. Create the app

    2 services start in a single Compose app, with 3 named volume mounts for your data, on port 8080.

  3. Fill in the secrets

    4 secrets are generated and stored encrypted, 10 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

Moodle requirements

Memory
About 1 GiB
Architectures
amd64 image published, arm64 image published
Ports
8080
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
GPL-3.0-or-later, copyleft license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
  • Host ports. It publishes port 8080 on the host, so open them in the VPS firewall only if you want that.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Moodle. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the Moodle docs page.

Deploy Moodle your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy Moodle from the CLI

levelrail-cli templates deploy moodle --name my-moodle

Deploy Moodle with the API

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/moodle/deploy

Moodle configuration

Moodle services

ServiceImagePortsVolumes
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

Moodle environment variables

VariableServiceValue
MYSQL_DATABASE mariadb Preset by the template
MYSQL_PASSWORD mariadb Generated at deploy
MYSQL_ROOT_PASSWORD mariadb Generated at deploy
MYSQL_USER mariadb Preset by the template
ALLOW_EMPTY_PASSWORD moodle Preset by the template
MOODLE_DATABASE_HOST moodle Preset by the template
MOODLE_DATABASE_NAME moodle Preset by the template
MOODLE_DATABASE_PASSWORD moodle Generated at deploy
Show all 14 variables
  • MOODLE_DATABASE_PORT_NUMBERmoodlePreset by the template
  • MOODLE_DATABASE_USERmoodlePreset by the template
  • MOODLE_EMAILmoodlePreset by the template
  • MOODLE_PASSWORDmoodleGenerated at deploy
  • MOODLE_SITE_NAMEmoodlePreset by the template
  • MOODLE_USERNAMEmoodlePreset by the template

Ports and volumes

Ports
8080
Volumes
3 named mounts: moodle_mariadb_data -> /var/lib/mysql, moodle_data -> /bitnami/moodle, moodledata_data -> /bitnami/moodledata

Moodle FAQ

How much memory does Moodle need?

The catalog lists about 1 GiB of memory for Moodle across its 2 services.

Does Moodle run on arm64?

For Moodle, an arm64 image is published; amd64 is image published.

What licence is Moodle under?

Moodle is licensed under GPL-3.0-or-later, which is copyleft, so changes you distribute must be shared under the same terms.

Does Moodle need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which database does Moodle bundle?

The template includes MySQL, running as its own service.

Which ports does Moodle use?

Moodle listens on port 8080 inside the stack.

Where does Moodle keep its data?

In named volumes: moodle_mariadb_data mounted at /var/lib/mysql, moodle_data mounted at /bitnami/moodle and moodledata_data mounted at /bitnami/moodledata.

Can I deploy Moodle on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Moodle, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image mariadb:11.1, docker.io/bitnamilegacy/moodle:4.3 is what you deploy there.

levelrail-cli templates deploy moodle --name my-moodle