---
title: "Deploy Moodle LMS"
description: "Moodle LMS sandbox — ideal for development, testing, and evaluation."
category: "CMS"
url: https://railway.com/deploy/moodle-lms
---

# Deploy Moodle LMS

Moodle LMS sandbox — ideal for development, testing, and evaluation.

**[Deploy Moodle LMS on Railway](https://railway.com/template/moodle-lms)**

- **Creator:** JesseZweers
- **Category:** CMS
- **Total deploys:** 31

## Template content

### Moodle https://upload.wikimedia.org/wikipedia/commons/c/c6/Moodle-logo.svg

- **Source:** JesseZweers/moodle-railway
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

## Documentation

# 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](https://github.com/JesseZweers/moodle-railway/blob/main/README.md).

## 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)](https://github.com/moodle/moodle/tree/MOODLE_405_STABLE)
- [moodlehq/moodle-php-apache on Docker Hub](https://hub.docker.com/r/moodlehq/moodle-php-apache)
- [Moodle documentation](https://docs.moodle.org)

### Implementation Details

This template uses a custom entrypoint script (`railway-entrypoint.sh`) to handle two Railway-specific requirements:

```bash
# Ensure Railway's reverse proxy HTTPS header is passed to PHP
echo "SetEnvIf X-Forwarded-Proto https HTTPS=on" &gt; /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.



## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

Open this page in a browser: https://railway.com/deploy/moodle-lms
