Deploy Moodle | Open-Source Learning Management System (LMS) on Railway
Self-host Moodle. Most Popular LMS with courses, grading, 2k+ plugins.
Just deployed
/bitnami/moodledata
MariaDB
Just deployed
/bitnami/mariadb
![]()
Deploy and Host Moodle on Railway
Deploy Moodle, the world's most popular open-source learning management system, on Railway with a single click. Self-host Moodle on Railway to run your own LMS with full control over data, customization, and privacy — no vendor lock-in, no per-user fees.
This Railway template pre-configures Moodle with a MariaDB database, persistent storage for uploaded files and course content, HTTPS via Railway's TLS proxy, and production-ready environment variables so you can start creating courses immediately after deployment.

Getting Started with Moodle on Railway
After deploying, open your Railway-provided URL to see the Moodle homepage. Click Log in in the top right and enter the admin credentials you configured in MOODLE_USERNAME and MOODLE_PASSWORD. Navigate to Site administration from the left sidebar to configure your instance — set site policies, enable authentication plugins, and adjust the theme. Create your first course from Site home → Add a new course, add activities like quizzes, assignments, and forums, then enroll students via manual enrollment or self-enrollment keys.

About Hosting Moodle LMS
Moodle (Modular Object-Oriented Dynamic Learning Environment) is a free, open-source LMS used by over 400 million users across 240+ countries. Built with PHP and backed by MariaDB or PostgreSQL, it powers e-learning for universities (MIT, Open University), corporations (Shell, Vodafone), and K-12 schools worldwide.
Key features of self-hosted Moodle include:
- Course management — create structured courses with modules, activities, quizzes, assignments, SCORM packages, and H5P interactive content
- Grading and assessment — rubrics, marking guides, competency frameworks, and a full gradebook with weighted categories
- Plugin ecosystem — 2,000+ plugins for video conferencing (BigBlueButton), plagiarism detection (Turnitin), analytics, and more
- Multi-tenancy — serve multiple departments or organizations from a single instance using category-based permissions
- Mobile ready — official Moodle mobile app connects to any self-hosted instance
- SCORM and LTI compliance — integrate with external tools and import standardized courseware
This template deploys two services: the Moodle application server (Bitnami legacy Docker image) and a MariaDB database for persistent storage of courses, users, grades, and configuration.
Why Deploy Moodle on Railway
- Zero-config database provisioning with MariaDB included
- Persistent volumes for course files and Moodle data
- HTTPS out of the box via Railway's TLS proxy
- Scale vertically as your user base grows
- No per-user licensing fees — unlimited students and instructors
Common Use Cases for Self-Hosted Moodle
- University e-learning — deliver blended or fully online degree programs with assignments, discussion forums, and video lectures
- Corporate training and compliance — onboard employees, track mandatory compliance certifications, and generate completion reports
- K-12 classroom management — distribute homework, run quizzes, and communicate with parents through the built-in messaging system
- Professional certification — create exam-based courses with timed quizzes, certificate generation, and badge awards
Dependencies for Moodle on Railway
This template deploys two services:
- Moodle —
bitnamilegacy/moodle:5.0.2-debian-12-r2— the LMS application server (PHP + Apache) - MariaDB —
bitnami/mariadb:latest— relational database for all Moodle data
Environment Variables Reference for Moodle on Railway
| Variable | Service | Description |
|---|---|---|
MOODLE_DATABASE_HOST | Moodle | MariaDB private domain (Railway reference) |
MOODLE_DATABASE_NAME | Moodle | Target database name |
MOODLE_USERNAME | Moodle | Admin account username |
MOODLE_PASSWORD | Moodle | Admin account password |
MOODLE_SSLPROXY | Moodle | Enable HTTPS URL generation behind proxy |
MOODLE_SKIP_BOOTSTRAP | Moodle | Skip installer on container restarts |
MARIADB_ROOT_PASSWORD | MariaDB | Database root password |
MARIADB_DATABASE | MariaDB | Database name for Moodle |
MARIADB_USER | MariaDB | Database user for Moodle |
Deployment Dependencies
- Runtime: PHP 8.x, Apache 2.4 (bundled in Bitnami image)
- Docker Hub: bitnamilegacy/moodle, bitnami/mariadb
- Official docs: docs.moodle.org, download.moodle.org
- GitHub: github.com/moodle/moodle
Hardware Requirements for Self-Hosting Moodle
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2+ vCPU |
| RAM | 1 GB | 2–4 GB |
| Storage | 1 GB (app) + 1 GB (DB) | 5+ GB (scales with course content) |
| Runtime | PHP 8.0+, MariaDB 10.6+ | PHP 8.2+, MariaDB 11.x |
Moodle's resource needs scale with concurrent users. For 50–100 concurrent users, 2 vCPU and 2 GB RAM is sufficient. Heavy use of video, SCORM packages, or large file uploads requires more storage.
Self-Hosting Moodle with Docker
Clone the Bitnami Docker Compose setup for a quick local deployment:
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/moodle/docker-compose.yml > docker-compose.yml
docker compose up -d
Or run Moodle directly with Docker:
docker network create moodle-network
docker run -d --name mariadb \
--network moodle-network \
-e MARIADB_ROOT_PASSWORD=rootpass \
-e MARIADB_DATABASE=bitnami_moodle \
-e MARIADB_USER=bn_moodle \
-e MARIADB_PASSWORD=moodlepass \
-v mariadb_data:/bitnami/mariadb \
bitnami/mariadb:latest
docker run -d --name moodle \
--network moodle-network \
-p 8080:8080 \
-e MOODLE_DATABASE_HOST=mariadb \
-e MOODLE_DATABASE_NAME=bitnami_moodle \
-e MOODLE_DATABASE_USER=bn_moodle \
-e MOODLE_DATABASE_PASSWORD=moodlepass \
-e MOODLE_USERNAME=admin \
-e MOODLE_PASSWORD=changeme123 \
-v moodle_data:/bitnami/moodledata \
bitnamilegacy/moodle:5.0.2-debian-12-r2
Access Moodle at http://localhost:8080 after the initial installation completes (2–5 minutes).
Is Moodle Free to Self-Host?
Moodle LMS is 100% free and open-source under the GPL v3 license. There are no per-user fees, no feature gates, and no premium tiers for the core platform. Self-hosting costs are infrastructure only — on Railway, this means you pay only for the compute and storage your instance uses. Moodle also offers Moodle Workplace (a commercial product with multi-tenancy and advanced reporting) and MoodleCloud (managed hosting starting at ~$250/year), but the self-hosted open-source version includes all core LMS features.
Moodle vs Canvas LMS vs Open edX
| Feature | Moodle | Canvas LMS | Open edX |
|---|---|---|---|
| License | GPL v3 (free) | AGPL v3 (free) | AGPL v3 (free) |
| Primary audience | K-12, higher ed, corporate | K-12, higher ed | MOOCs, higher ed |
| Plugin ecosystem | 2,000+ plugins | Limited extensions | XBlocks |
| Self-host complexity | Moderate (PHP + DB) | Complex (Ruby + Canvas ecosystem) | High (Django + multiple services) |
| Mobile app | Official app (free) | Official app (free) | Official app (free) |
| SCORM support | Full | Full | Via XBlock |
| Active users | 400M+ | 30M+ | 40M+ |
Moodle offers the deepest customization through its plugin ecosystem and is the easiest of the three to self-host. Canvas excels at collaboration with native Google Docs integration. Open edX is purpose-built for large-scale MOOCs.
FAQ
What is Moodle and why self-host it on Railway? Moodle is an open-source learning management system for creating online courses, managing enrollments, grading assignments, and tracking learner progress. Self-hosting on Railway gives you full data ownership, unlimited users with no per-seat fees, and the ability to install any of Moodle's 2,000+ plugins.
What does this Railway template deploy for Moodle?
This template deploys two services: the Moodle application server using the Bitnami legacy Docker image (bitnamilegacy/moodle:5.0.2-debian-12-r2) and a MariaDB database (bitnami/mariadb). Both services have persistent volumes for data durability across redeployments.
Why does Moodle need MariaDB on Railway? Moodle stores all course content, user accounts, grades, quiz questions, forum posts, and configuration in a relational database. MariaDB is the recommended database for Moodle and is included in this template with automatic connection configuration via Railway service references.
How do I install Moodle plugins on Railway? Navigate to Site administration → Plugins → Install plugins in the Moodle web interface. You can upload plugin ZIP files directly through the browser or install from the Moodle plugins directory. The persistent volume ensures plugins survive redeployments.
How do I enable HTTPS for self-hosted Moodle on Railway?
Railway automatically provides HTTPS via its TLS-terminating proxy. The template sets MOODLE_SSLPROXY=yes so Moodle generates https:// URLs correctly. No additional SSL certificate configuration is needed.
Can I migrate an existing Moodle instance to Railway?
Yes. Export your existing database using mysqldump, import it into the Railway MariaDB service, and upload your moodledata directory contents to the Moodle service volume. Update the database connection variables to point to the Railway MariaDB instance.
Template Content
MOODLE_PASSWORD
Admin account password
MOODLE_USERNAME
Admin account username
MariaDB
bitnami/mariadb:latest