Deploy Moodle LMS
Moodle LMS sandbox — ideal for development, testing, and evaluation.
Moodle
Just deployed
/var/www/moodledata
Just deployed
/var/lib/postgresql/data
Deploy and Host Moodle LMS on Railway
Moodle is a free, open-source Learning Management System (LMS) trusted by educators and institutions worldwide. It enables the creation and delivery of online courses, supporting assignments, quizzes, forums, grading, and a rich plugin ecosystem — making it one of the most widely deployed e-learning platforms available.
About Hosting Moodle LMS
Moodle requires a web server, a PHP runtime, a relational database (PostgreSQL or MySQL), and persistent storage for uploaded files and course data. Traditional deployments involve provisioning a server, configuring Apache or Nginx, managing TLS certificates, and keeping all components updated — a significant operational overhead. This Railway template removes that burden by running Moodle in a Docker container based on the official moodlehq/moodle-php-apache image, with PostgreSQL provisioned automatically and a persistent volume handling the Moodle data directory. HTTPS is handled by Railway's reverse proxy out of the box.
For full setup instructions, refer to the README.
Common Use Cases
- Development and testing of Moodle plugins and themes
- Demoing Moodle to stakeholders before committing to a production setup
- Learning how Moodle works in a low-risk sandbox environment
Dependencies for Moodle LMS Hosting
- PostgreSQL database
- Persistent volume mounted at
/var/www/moodledata
Deployment Dependencies
- Moodle source code (MOODLE_405_STABLE)
- moodlehq/moodle-php-apache on Docker Hub
- Moodle documentation
Implementation Details
This template uses a custom entrypoint script (railway-entrypoint.sh) to handle two Railway-specific requirements:
# Ensure Railway's reverse proxy HTTPS header is passed to PHP
echo "SetEnvIf X-Forwarded-Proto https HTTPS=on" > /etc/apache2/conf-available/railway-proxy.conf
# Use prefork MPM (required for mod_php)
a2dismod mpm_event mpm_worker
a2enmod mpm_prefork
Why Deploy Moodle LMS on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Moodle LMS on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content