@@PRODUCT@@

Installing Moodle

Moodle is the learning platform of the catalogue: courses, assignments, grades and a classroom on your own domain. You install it in the same wizard as every other application, and from then on CoreCP looks after it the way it looks after a

Written for: Customer, Reseller, Administrator

Moodle is the learning platform of the catalogue: courses, assignments, grades and a classroom on your own domain. You install it in the same wizard as every other application, and from then on CoreCP looks after it the way it looks after all of them — with a restore point before every update and a way back when something goes wrong. This page is about what is different with Moodle.

Two versions, and which one to pick

Moodle publishes two long-term-support versions at a time. CoreCP carries both:

VersionWhat it needsWho it is for
Moodle 5.3 LTS (default)PHP 8.3 or 8.4, MariaDB 11.4 or newerevery new installation
Moodle 4.5 LTSPHP 8.1 up to 8.3, MariaDB 10.6.7 or newera website still on PHP 8.1 or 8.2, or a server with MariaDB 10.11

You do not have to know this by heart. Before installing, the wizard measures what your website can do: the site's PHP version, the extensions Moodle asks for, the max_input_vars setting and the database version of the server the site lives on. If 5.3 does not fit you see exactly why, with the fitting route beside it: "move this site to PHP 8.4" (which you do yourself, on the website's own page — CoreCP never switches a PHP version unasked) or "install Moodle 4.5 LTS instead". The one thing the install does arrange itself is max_input_vars: Moodle wants it at 5000 and CoreCP sets it to that for your website, within the bounds the administrator has set.

To pick the other version, use More settings → Version in the wizard, or --version 4.5 on the command line.

On the server's command line you see the same measurement, with the route beside it:

$ corectl app requirements moodle lms.example.nl --version 5.3
$ corectl app requirements moodle lms.example.nl --version 4.5
$ corectl app install moodle lms.example.nl --admin-email admin@example.nl --title "Learning platform"
$ corectl app install moodle lms.example.nl --version 4.5 --admin-email admin@example.nl --title "Learning platform"

Where Moodle goes

Moodle belongs on a website of its own — a domain or a subdomain, not a subdirectory of another site. That is not a CoreCP limitation but how Moodle 5 is built:

  • Moodle 5.3 keeps only the files a browser may fetch in a public/ directory. CoreCP therefore places the code outside the web directory, in ~/apps/<site>-moodle/, and points your website's document root at that public/. You see it on the website's page under Document root. The configuration file and the rest of the code sit above it and cannot be reached from the web.
  • Moodle 4.5 sits in the website's document root like any other application.
  • Your data — uploaded files, sessions, cache — lives for both versions in ~/moodledata/<site>/, never in a document root. CoreCP checks that after every change.

Moodle is installed in English. A language pack is something you fetch inside Moodle afterwards, under Site administration → General → Language → Language packs.

Your site's address

Moodle is attached to its own address: every request on another address is redirected there. If your website has no certificate yet when you install, Moodle gets the http:// address. Once the site works over https, change the line $CFG->wwwroot in config.php (beside the code, not in public/) to https://. The application's card reminds you as long as that has not been done.

Moodle's clock

Moodle does a lot of work in the background — sending mail, completing courses, making backups — and for that its own cron.php has to run every minute. CoreCP sets that task up for you at install time, under your account's Scheduled tasks. You can see it there; leave it in place. If you take Moodle out of management, the task goes with it.

Updating

Updates work as they do for every application: a restore point first, then maintenance mode on, the new files in (your config.php and the plugins you added yourself stay), Moodle's own upgrade, and maintenance mode off again. If a step fails, CoreCP puts files and database back and switches maintenance mode off — the card shows what happened.

An update always stays inside its own series: from 4.5.14 to 4.5.15, from 5.3 to 5.3.1. The step from 4.5 to 5.3 is not something CoreCP does for you, not at night either: Moodle 5 has a different layout of the installation, and that move is a decision you take yourself. The usual way is a fresh 5.3 installation beside the old one, with your courses from a Moodle backup.

Moodle's plugins and themes are managed in Moodle itself, under Site administration → Plugins. CoreCP shows on the card which additional plugins are there and does not update them: Moodle offers no safe way to do that outside its own administration screen.