Skip to content

Alpine Moodle

A lightweight Moodle Docker image built on Alpine Linux.

Docker Pulls Docker Image Size License MIT

What is this image?

erseco/alpine-moodle packages Moodle into a single, small (~100 MB) container based on erseco/alpine-php-webserver. It runs Nginx + PHP-FPM under a non-privileged user, includes Moosh CLI, and is configured entirely through environment variables.

Highlights:

  • PHP 8.3 FPM with ondemand process manager — low idle footprint
  • Works with PostgreSQL, MariaDB/MySQL, or SQLite (single-container dev mode)
  • Optional Redis session handler for HA deployments
  • Supports Moodle 4.x, 5.0, 5.1 (with /public directory) and main
  • Multi-arch images: amd64, arm64, arm/v7, arm/v6, 386, ppc64le, s390x
  • Internal cron via runit (configurable)
  • Logs go straight to docker logs
  • Extensible via pre/post configuration hooks and POST_CONFIGURE_COMMANDS

Where to start

Minimal example

docker run -d \
  -p 80:8080 \
  -e MOODLE_DATABASE_TYPE=sqlite3 \
  -e MOODLE_PASSWORD=ChangeMe123! \
  -v moodledata:/var/www/moodledata \
  erseco/alpine-moodle

Open http://localhost and log in with moodleuser / ChangeMe123!.

SQLite is for development and demos only

Use PostgreSQL or MariaDB for any real deployment. See Docker Compose for production-grade examples.