How to update Moodle

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

First log into the MoodleBox via SSH, with your admin 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 (3.6.1, 3.6.2, etc.), type the following commands in the terminal:1

cd /var/www/moodle/
sudo -u moodlebox -g www-data 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 (3.7, 3.8, etc.), type the commands above, then the additional following commands:

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

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

Warning

If you have a MoodleBox version 2.5.0 and earlier, use sudo -u www-data git ... instead of sudo -u moodlebox -g www-data git ... in the all the commands above.


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