Alpine Moodle¶
A lightweight Moodle Docker image built on Alpine Linux.
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
ondemandprocess 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
/publicdirectory) andmain - 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¶
- Quick Start — get a Moodle instance running in under a minute.
- Docker Compose — practical stacks for dev, production and proxied setups.
- Reverse Proxy — Traefik, Nginx, NPM, Apache, Caddy recipes.
- Environment Variables — every supported knob, with defaults.
- Persistence & Volumes — what to mount and what to back up.
- Upgrading — how to move between Moodle versions safely.
- Troubleshooting — solutions to the most common deployment issues.
- FAQ — short answers to recurring questions.
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.
Project links¶
- Source code: https://github.com/erseco/alpine-moodle
- Docker Hub: https://hub.docker.com/r/erseco/alpine-moodle
- GitHub Container Registry:
ghcr.io/erseco/alpine-moodle - Issue tracker: https://github.com/erseco/alpine-moodle/issues