Moodle on Docker vs Kubernetes vs VMs

Virtual machines fit most single-site Moodle teams, containers fit teams that already run them, and Kubernetes pays off only with cluster skills and a clear need. The database, shared file storage, cron and upgrade routine carry most of the risk in all three models.

On this page

Which Moodle deployment options fit your team: Docker, Kubernetes or VMs

For a team running one Moodle site with limited container or cluster skills and a need for predictable uptime, virtual machines suit most single-site teams. Containers suit teams that already run them in production, and Kubernetes pays off only when the team has cluster skills and a concrete reason to run several environments, such as separate staging and production clusters or multiple sites on shared nodes. For a single site, a cluster adds control plane upkeep, ingress, persistent volume claims and rolling upgrades to operate, and the team may never use what it buys. A VM leaves one host to patch, one web server to configure and one place to look when a plugin breaks during a term.

In all three models, the database, shared moodledata storage, cron and the upgrade routine carry most of the operational risk. Whether Moodle runs on a VM, a container or a pod, every web and cron process must reach one database and read and write the same moodledata store, and the cron job must run on schedule. Back up the database and moodledata together so they restore to the same point, and test a restore before you depend on it. Each upgrade needs a rehearsal on a copy of production. Before you choose a model, ask Moodle HQ or your implementation partner whether an official container image or Helm chart applies to your target release, and what that image or chart covers and does not cover.

Pin the target release before comparing models. Moodle 5.3 is the current LTS release, with general support until 4 October 2027 and security support until 1 October 2029. It requires 64-bit PHP 8.3 or later, and sites must run Moodle 4.4 or later to upgrade to it. From Moodle 5.1 onward, the web server document root must point to the /public directory, so whichever model you choose, check the virtual host or ingress configuration for that path. Ask your partner to write the target release, PHP version, database version and backup scope into the written scope, so any effort or cost estimate rests on named versions rather than assumptions.

How Docker, Kubernetes and VMs compare on the factors that drive effort

This table compares how each hosting model changes the work for Moodle across architecture, scaling, availability, upgrades, backups, skills and cost. Read each row for the condition under which the option holds up, then confirm the open details with Moodle HQ or your implementation partner before you commit. The main takeaway is that containers add operating skills and orchestration cost, so they suit teams that already run them.

FactorDocker on hosts you manageKubernetesVirtual machines
ArchitectureMoodle web, cron and database run as containers on hosts you patch. Confirm the image source and tag policy with your partner.Moodle pods behind a service, with shared storage for moodledata and an external database. Confirm pod roles for web and cron with your partner.Moodle, PHP and web server on each VM, closest to a traditional install. Confirm the public directory document root for 5.1 onward.
Sizing and scalingScale by adding replicas on existing hosts. Fits a fixed set of hosts; confirm session and cache handling with your partner.Pods can scale out, but shared storage and database limits set the ceiling. Confirm the load test plan with your partner.Scale up by resizing the VM or add web VMs behind a load balancer. Confirm session affinity and shared file storage with your partner.
High availabilityRestart policies on one host; a second host needs your own failover design for the database and files. Confirm with your partner.Replicas and self-healing come from the scheduler, but shared moodledata and how cron runs across replicas need design. Confirm with your partner.Pair two VMs with a load balancer and a managed or replicated database. Confirm how moodledata and cron are shared and failed over.
Upgrade pathRepull images and run the upgrade in place; confirm the supported starting version (5.3 needs 4.4 or later) with your partner.Rolling updates suit stateless web pods, but the database schema upgrade still runs once. Confirm the upgrade runbook with your partner.Familiar in-place upgrades on a known server; take a snapshot before each step. Confirm the supported starting version with Moodle HQ.
Backup and restoreBack up the database, moodledata and any volumes; restore tests must cover images and config. Confirm volume ownership with your partner.Snapshot persistent volumes and database backups separately; restore needs matching manifests and secrets. Confirm snapshot consistency with your storage team.Image snapshots or file and database dumps; take both at the same point. Confirm restore tests with your partner.
Operating skillsContainer builds, registries, volumes and host patching. Fits a team that already runs containers in production.Cluster operations, storage classes, ingress and secrets on top of PHP and Moodle. Suits teams with a platform group already in place.Linux, PHP, web server and database administration. Fits a team that already supports Moodle or PHP applications.
Cost driversHost hardware or cloud instances, your staff time, and partner fees set by written scope. Hosts and staff recur.Cluster control plane, nodes, storage and monitoring, plus the staff to run them. Ask for a quote that separates one-time build from recurring operations.Per-VM compute, storage and admin time. Moodle core is GPL-3.0-or-later with no license fee; confirm plugin and hosting costs.

How Moodle deployment options split the web, database and file tiers

Docker, Kubernetes and VM deployments all have to place the same four tiers: the web and PHP runtime, shared file storage, the database and background work. The models differ in who runs each tier and how each one scales. Use these cards to map ownership before you compare the three models.

Web server and PHP runtime

The web server and PHP runtime serve every Moodle page. From Moodle 5.1, the document root must point to the /public directory, and a root set to the main Moodle folder can cause directory listings or errors. On a VM, the web server and PHP sit on the host and the virtual host holds the root. In a container, the root and PHP settings live in the image or mounted config. On Kubernetes, identical pods run behind an ingress, so every pod must ship the same code and the same root. Platform engineering usually owns the runtime, and the Moodle administrator confirms the root after each upgrade.

Moodle 5.1 notes

Shared moodledata file storage

The moodledata directory holds uploaded course files and other site data, and every web and worker node must see the same copy. On a VM, this usually means a network file share or SAN volume mounted on each host. In a container, the same volume is mounted into each container, since a host-local volume leaves files on one node only. On Kubernetes, the storage class must offer shared read-write access across pods, so confirm that with the storage vendor before you choose it. Test uploads and restores from every node. The infrastructure team owns the mount, performance and backups, and the Moodle administrator owns file settings and quotas.

Database at Moodle 5.3 minimums

Moodle 5.3 sets minimum database versions, and the release notes list PostgreSQL 17 and MariaDB 11.4, along with Microsoft SQL Server 2019 or later. Oracle Database is no longer supported from Moodle 5.0. On a VM, the database usually sits on its own host or a managed service, and the DBA controls patches and restores. In a container, it runs as a separate service on persistent storage with its own backup plan. On Kubernetes, most teams keep the database outside the cluster or under a database operator, so cluster upgrades stay separate from data changes. Confirm the MySQL minimum in the release notes before you choose a version. The data team owns the engine and backups, and the Moodle administrator confirms the version before each upgrade.

Moodle 5.3 notes

Cron and background task workers

Moodle runs scheduled tasks and background work outside web requests, so something must call its CLI cron on a fixed schedule. On a VM, a system timer or cron job on one host does this under a dedicated account. In a container, a separate worker container runs the same image with a different command. On Kubernetes, a CronJob or a dedicated worker Deployment runs the task, and you must confirm how scheduled tasks avoid duplicate runs when several web pods exist. Check task logs after every change and after every restart. The platform team owns the scheduler, and the Moodle administrator owns task schedules and failure alerts.

How requests, shared storage and the database connect in each model

The diagram starts at the load balancer or ingress on the public edge, the first trust boundary. Requests enter the web tier, where the web server's document root must point to the /public directory from Moodle 5.1 onward. The web tier hands each request to the PHP runtime, which reads and writes files in moodledata and queries the database. A separate cron worker runs scheduled tasks against the same database and the same storage, so it sits inside the internal network. The layout is generic. The exact topology depends on the chosen model (Docker, Kubernetes or virtual machines), so confirm how each model shares moodledata and where the cron worker runs.

Generic request path with trust boundaries; the cron worker shares the database and storage.

Why upgrade cadence weighs more than the hosting model

Upgrade cadence shapes the cost of running Moodle more than the choice between Docker, Kubernetes and virtual machines, because upgrades recur on every hosting model. Moodle ships major releases in April and October and point releases every two months, so each site goes through the same cycle repeatedly. Moodle 5.1 passed general support on 5 October 2026 and receives security support only until 19 April 2027. Moodle 5.3 is the long-term support release, with security support until 1 October 2029. A team on 5.1 should set its 5.3 upgrade date now and check the Moodle releases page for the current support table before committing to a window.

Each release also moves the floor for the stack underneath it, so minimums change per release. Upgrading to 5.3 requires a site already on Moodle 4.4 or later, and 5.1 requires 4.2.3 or later. A site below those versions must first reach the minimum. The PHP and database floors move too: 5.3 requires 64-bit PHP 8.3 or later (8.4 supported) and PostgreSQL 17 or MariaDB 11.4, while 5.1 requires PHP 8.2 or later and PostgreSQL 15 or MariaDB 10.11. Container images and VM packages pin these versions, so a PHP or database bump is part of the upgrade plan. Confirm the MySQL and SQL Server minimums for your target version in its release notes before you choose database images.

Plugins decide whether an upgrade is possible at all. The SAML2 Single sign on plugin (auth_saml2), which many teams use for SAML 2.0 login, lists support only up to Moodle 5.1 in the plugins directory. A site moving to 5.3 must confirm plugin support for that version with the maintainer or plan a replacement before cutover. Inventory every plugin on each site and compare its listed versions with your target. Whichever hosting model you run needs a tested rollback path. An image rebuild needs the previous image tag and a database restore point that matches it. An in-place VM upgrade needs a snapshot or verified backup taken before the upgrade runs. A rolling Kubernetes update needs the previous deployment revision and a rehearsed database restore, because redeploying old pods does not undo database changes.

What upgrades, backups and monitoring demand from each team

This table sets out what Moodle on Docker, Kubernetes and virtual machines each ask of your team for upgrades, backups, monitoring, patching and skills. Read across a row to compare the work for each model, and use the last row as a go-live checklist. Upgrades and restores often decide the choice, so test both before you commit.

AreaMoodle on DockerMoodle on KubernetesMoodle on VMs
Upgrade procedureBuild a new image for the target release, run the database upgrade step, then replace the container.Build a new image, run the database upgrade once as a job, then roll pods. Pin versions in manifests.Deploy code to a new release directory, run the database upgrade, then repoint the web server to /public from 5.1 onward.
Backup and restore of database and moodledataBack up the database and the moodledata volume separately, and restore both to the same point in time.Snapshot the moodledata volume and dump the database on a schedule, then restore both from one point in time.Dump the database and copy moodledata with host tooling, or snapshot the VM with the database quiesced.
Monitoring and alertingContainer health checks, PHP and web server logs, and database metrics, plus alerts from an agent you add.Pod restarts, resource use and cluster health, plus checks on Moodle's scheduled tasks and the database.Host metrics, service status and logs through the existing monitoring stack, plus Moodle's scheduled tasks.
Base image or host patchingRebuild and redeploy the image whenever the base OS or PHP packages change. Scan images before deploying.Patch worker nodes, cluster version and base images, which adds a cluster upgrade cycle to plan.Patch the OS, PHP and web server on each host, within the host team's maintenance window.
Skills each model needsContainer builds and registry work, plus Linux, PHP and Moodle administration.Cluster operations, storage classes, ingress, secrets, plus Moodle administration. Largest gap if no cluster operators exist.Linux administration, PHP and web server tuning, and database administration, which many IT teams already hold.
What to confirm before go-liveA tested restore of both volumes and an upgrade rehearsed on a copy of production.A tested restore of volumes and database, and an upgrade rehearsed on a copy of production, with the target PHP version confirmed.A tested restore of database and moodledata, and an upgrade rehearsed on a copy of production, with PHP minimums checked.

Which team profile fits each Moodle deployment model

This profile fits a single institution or training team with a small operations group that runs one server or a pair of servers and patches them by hand. A virtual machine keeps the stack close to what Linux administrators already know: a web server, PHP, a database and scheduled tasks. It is usually the lowest-friction option when nobody on the team operates containers.

  • Conditions that favor it: One site, a predictable user count and a maintenance window the team can keep for upgrades and backups.
  • Skills required: Linux administration, PHP and web server tuning, database backup and restore, and a written runbook for Moodle's upgrade and cron steps.
  • Document root: From Moodle 5.1, the web server must point to the /public directory, or the site may show directory listings or errors. Check this in the runbook (Moodle 5.1 release notes).
  • Upgrade path: Moodle 5.3 requires sites to run Moodle 4.4 or later, so an older VM needs an intermediate upgrade before the jump.
  • Warning sign: One administrator holds all the knowledge, or upgrades keep getting postponed because nobody has rehearsed a restore on a spare machine.

Before choosing this model, confirm that the team can restore a backup to a spare machine within a window agreed with stakeholders.

How to choose among Moodle deployment options before you commit

These six checks put the Docker, Kubernetes and virtual machine options in order before anyone picks a platform. Each step names who confirms it, and the sequence ends with a written scope that a partner or internal team can be held to.

  1. Inventory users, courses, plugins and the SSO method

    The site owner and LMS administrators list active users, course volume, expected peaks, every installed plugin, any custom code and the sign-in method in use. For single sign-on, confirm whether the site needs LDAP, LTI, OAuth 2, Shibboleth or SAML 2.0. Moodle core ships authentication plugins for the first four, but SAML 2.0 is commonly provided by the SAML2 Single sign on plugin, whose listed support ends at Moodle 5.1, so confirm support for your target release with its maintainer. The output is a signed-off inventory that the identity team has reviewed.

  2. Check the target release against runtime minimums

    The platform owner and the database administrator check the Moodle 5.3 release notes against the PHP, database and web server stack you plan to run. Moodle 5.3 requires 64-bit PHP 8.3 or later, and its database minimums include PostgreSQL 17, MariaDB 11.4 and SQL Server 2019. Sites must already run Moodle 4.4 or later to upgrade, and from Moodle 5.1 the web server must point at the /public directory. Confirm the MySQL minimum in the same release notes before you choose an image or managed database. The output is a written compatibility note that both owners have signed.

  3. Check every plugin for the target version

    The LMS administrator and each plugin owner check the Moodle plugins directory for a release that declares support for Moodle 5.3, and list any plugin without one. Moodle documents more than 50 plugin types, including activity modules, blocks, themes, authentication, enrolment and admin tool plugins, so the list must cover more than the visible add-ons. Custom local code and theme changes need a developer to test them against the target release. The output is a list where each plugin has a version, a support status, an owner and either a replacement or a planned fix.

  4. Match the hosting model to existing skills

    The platform lead and the infrastructure team compare the skills they already have with what each model asks them to run. Docker needs container image management, Kubernetes adds cluster operations on top, and virtual machines keep patching, PHP runtime, cron and storage work in the team's hands. Ask who owns the database, the persistent storage for uploaded files and the cron schedule under each option, since those duties remain under every model. Confirm with the maintainer of any container image or chart which Moodle versions it supports. The output is a named owner for each duty and a written decision with the reason it fits.

  5. Rehearse a restore and upgrade on a copy

    The platform owner restores a recent backup into an isolated copy built on the same stack as the planned production hosting, then runs the upgrade to Moodle 5.3 there. Test the /public web root, cron, the sign-in flow and each plugin on the list from the earlier step, and confirm that course files and user data come back intact. Record every command and problem, because those notes become the production runbook. The output is a restored copy that boots, passes the checks agreed in the final step, and can be repeated from the notes by someone outside the rehearsal.

  6. Agree scope, deliverables and acceptance in writing

    The buyer and any implementation partner write the scope, deliverables, handover items, test plan and acceptance criteria into one document before work starts, whichever model you choose. Ask the partner to name who handles installation, plugin work, backup, upgrades and support after go-live, and whether ongoing support is a separate agreement. DeployOpen engagements are typically fixed-scope, with scope, deliverables and timelines agreed in writing before work starts, and ongoing support available as a retainer. Ask for any quote to follow that written scope line by line. The output is a signed scope that the rehearsal results can be checked against.

What buyers ask before choosing a Moodle hosting model

Is Docker or Kubernetes an official Moodle install path?

Moodle documents self-hosting on a web stack of PHP, a supported database and a web server, with minimum versions set for each release. Docker and Kubernetes are ways to package and run that stack, so ask whether a given container image is covered by Moodle's own documentation or only by its author. Request in writing who builds and patches the image, how quickly it is rebuilt after a Moodle security release, and which PHP and database versions it pins. Check those pins against the release notes for the version you plan to run. The Moodle releases page lists the support windows for each release.

What drives effort in a VM Moodle install compared with containers?

In a VM, most of the effort sits in the operating system, the PHP runtime, the web server, cron and the database host, and you patch and tune each one on the machine itself. In a container setup, effort shifts toward image builds, persistent volumes and the orchestration layer, and the host operating system stays yours to patch unless a managed platform takes it on. The drivers that move cost either way are the number of environments, how often you upgrade, whether your plugins need custom build steps, and how well your backups restore. Ask each proposer to show which of these tasks they run, which your team runs, and how an upgrade moves through staging before production.

Which skills does an in-house team need to run Moodle on containers?

The team needs working knowledge of Linux, PHP and the web server, administration of the chosen database, and Moodle's own operations: cron, upgrades, plugin installs and the /public document root that applies from Moodle 5.1. On containers, add image building, secrets handling and persistent storage. Kubernetes adds cluster operations, ingress, storage classes and rollout tooling, so plan for on-call coverage in whichever model you choose. Ask the partner or vendor which of these skills they transfer in handover, and which your staff must hold after go-live. Gaps in these areas are easier to see in a skills review before the project starts than during an outage.

Is a partner worth hiring for the first Moodle upgrade?

It is worth it when your team has not run a Moodle major upgrade on this site before, or when the site has custom plugins or a custom theme that must survive the change. Upgrade distance matters: the Moodle 5.3 release notes require sites to run 4.4 or later, so older installs need an intermediate step first. Drivers include the number of plugins and their version compatibility, database engine version changes, the web root change, and the size of the test data set. Request in writing a staging upgrade with a timed record of each step, a plugin compatibility list, a rollback procedure you have rehearsed, and a handover of the runbook. Clarity on who owns post-upgrade defects matters as much as the upgrade itself.

What should a self-hosted Moodle hosting quote include in writing?

A quote should list the deliverables, the environments (production, staging and any test or development copies), and who provisions the infrastructure in your cloud, data center or air-gapped network. It should name the database, the web server, the container or VM layer, backup and restore testing, SSO configuration, monitoring and the upgrade approach. Ask what is excluded, such as plugin development, content migration, training, and any paid plugins or support contracts. Moodle core is licensed under GPL-3.0 or later, so the cost lines are mainly labor, infrastructure and third-party items. Timelines, acceptance criteria and support terms belong in the written scope. DeployOpen agrees scope, deliverables and timelines in writing before work starts, and its quotes follow from that scope, so ask every provider for the same level of detail.

What sets the timeline for a self-hosted Moodle project?

The main drivers are how far your current Moodle version sits from the target, how many plugins and integrations need rework, and how much of your identity setup must change. SSO is a common example: SAML 2.0 is often provided through the auth_saml2 plugin, and its listed Moodle compatibility must match your target version before anything else is scheduled. The SAML2 single sign-on plugin page is the place to confirm that. Other drivers are the data volume for migration, the number of environments to build and test, your change-approval and security review cycle, and when infrastructure access becomes available. Ask for a milestone plan in writing that shows dependencies, the decisions and access each milestone needs, and what triggers a change to the schedule.

Can a small team run self-hosted Moodle without outside help?

Often yes, if the team already runs Linux services, has someone who can own upgrades, and can cover patch windows and restores without waiting on a vendor. Moodle ships major releases every six months and minor releases every two months, so the operating calendar is recurring work, not a one-time project. Check four things before deciding: whether you have a tested backup and restore for both the database and moodledata, whether someone owns the security patch cycle for the PHP and OS layers, who is on call for outages, and whether the team has done a major upgrade before. If any of those is missing, a retainer covering ongoing support, upgrades and continuous testing can fill the gap while staff build skills. Ask any provider to define in writing what the retainer includes and what stays with your team.

How DeployOpen scopes, builds and supports a Moodle deployment

DeployOpen treats Moodle on Docker, Kubernetes or virtual machines as an infrastructure decision that needs a written scope before anyone installs anything. We plan, implement, customize, integrate, harden, back up, upgrade and document the Moodle platform inside your own cloud account, data center or air-gapped network. The hosting model you choose changes the work, so the scope fixes which parts DeployOpen builds and which parts your team operates.

How we scope

  • The written scope names the Moodle version, the hosting model and the database engine before build starts.
  • Each hosting option gets its own scope line for sizing, high availability, upgrades and backup, so costs stay comparable.
  • Fixed-scope engagements agree deliverables and timelines in writing, and a quote follows from that written scope.

How we build

  • From Moodle 5.1, the web server document root must point to /public, or the site may show listings or errors.
  • Authentication and plugin work is listed by name, such as LDAP, LTI, OAuth 2 or a SAML 2.0 plugin.
  • Security testing of the application, APIs and cloud infrastructure can be scoped in the same written agreement.

How we hand over

  • Handover documents the chosen topology, sizing assumptions, backup and restore steps, and the upgrade runbook for your team.
  • Your team receives configuration, access control and evidence for whichever hosting model the written scope selected.
  • Compliance readiness work delivers documented controls and evidence for independent auditors, who issue any audit report.

How we support

  • Moodle upgrades follow the Moodle releases page support windows, where 4.5 LTS security support runs to October 4, 2027.
  • Support scope covers the hosting model you chose, so each upgrade is scoped and tested before it runs.
  • Ongoing support, upgrades and continuous testing are available as retainers after handover.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.