Update Moodle on the MoodleBox

Info

Before updating your version of Moodle, make sure that the server requirements are met on your MoodleBox. To do this, log in to Moodle, visit Site Administration > Server > Environment, click on Update component, then check that no line says Check in red.

Warning site not https is not a problem and can be ignored.

To update Moodle, perform the following operations, using the command line.

First log into the MoodleBox via SSH, with the main password. If you didn’t change it yet, use the default main password Moodlebox4$.

ssh moodlebox@moodlebox.home

Update to a minor version

To update to the next minor version of Moodle (4.3.1, 4.3.2, etc.), type the following commands in the terminal:1

cd /var/www/moodle/
sudo -u www-data -g moodlebox git pull

Visit then in your browser the URL http://moodlebox.home/admin and follow the update instructions, like any Moodle installation (read the documentation).

Update to a major version

To update to the next major version of Moodle (4.42, 4.52, etc.), type the commands above, then the additional following commands, indicating the adequate branch, e.g. MOODLE_404_STABLE, MOODLE_405_STABLE, etc.:

sudo -u www-data -g moodlebox git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
sudo -u www-data -g moodlebox git fetch origin
sudo -u www-data -g moodlebox git checkout MOODLE_404_STABLE

Then visit the URL http://moodlebox.home/admin and follow the update instructions, like any Moodle installation (read the documentation).


  1. In order to allow a simplified update of Moodle, its installation was done using Git. ↩︎

  2. Of course, you’ll have to choose an existing and stable branch, so wait for the official release of the wanted Moodle version to do so. ↩︎ ↩︎