Skip to content

Moodle

The Wodby Moodle catalog stack runs Moodle LMS 5.3 with Nginx, MariaDB, shared NFS storage for Moodle's files, OpenSMTPD for mail, and an optional Valkey service for sessions. A separate worker runs Moodle's cron. The current composition is documented in wodby/stack-moodle.

Start with the Vanilla Moodle boilerplate, which builds Moodle's own repository, or connect a repository with your own Moodle 5.3 code.

Administrator account

Moodle is installed during the app's first deployment, so you never use Moodle's web installer. Set the administrator account in the Moodle service's settings when you create the app:

Setting Default What it sets
Admin password none, required The administrator's password
Admin username admin The administrator's username
Admin email empty The administrator's email address
  • A password that doesn't meet Moodle's password policy works for the first sign-in, and Moodle then asks for a new one.
  • Without an email, Moodle asks for it at the first sign-in.
  • The site's full name and short name start as the app's title and name. Change them in Moodle under Site administration > Site home > Site home settings.

These settings are only used when Moodle is installed. To change the administrator later, use Moodle.

If the first deployment can't install Moodle, for example because the admin password is missing, the deployment's post-deploy step fails with the reason. Fix it and deploy again.

Site address

Moodle uses the app environment's main domain as its address and redirects other domains of the app to it. When you change the main domain, deploy the Moodle service again so Moodle picks up the new address. To use another address, set the MOODLE_WWWROOT environment variable on the Moodle service.

Configuration

When your repository has no config.php next to Moodle's public directory, the build adds one that reads the database, address, data directory and session settings from the app environment. A repository with its own config.php keeps it; read the values from the same environment variables rather than committing credentials.

Moodle's code is part of the build image. Add plugins and themes to the repository and build again: plugins installed from Moodle's web interface would be lost at the next deployment, so that option is turned off. Use a cloned or connected repository when you add plugins or want to choose when Moodle is updated.

Upgrades

Every deployment runs Moodle's upgrade when the new code needs one. Moodle switches to maintenance mode while it upgrades. Back up the app before you move to a new Moodle release.

Cron

The cron service keeps Moodle's cron running all the time, as Moodle requires. You don't need to add a cron schedule. When the cron service stops, it lets the running task finish first.

Mail and sessions

Moodle sends mail through the stack's OpenSMTPD service. For production delivery, attach an SMTP provider integration to OpenSMTPD; see the OpenSMTPD guide.

Sessions are stored as files in Moodle's data directory. Enable the Valkey service to keep them in Valkey instead.

Data and backups

  • The moodledata volume holds uploaded files and Moodle's file caches. The Moodle service and its cron worker share it through the NFS storage service.
  • The MariaDB database holds everything else.

Back up both the database and the moodledata volume; see Application Backups.

Limits

  • Moodle 5.3 runs on PHP 8.3 or 8.4 and needs MariaDB 11.4 or later.
  • Uploads are limited to 256 MB.