Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments.
This doc explains how to configure Moodle from source. Alternatively, an already configured repository exists as well on Clever Cloud’s GitHub page.
You can download Moodle from https://download.moodle.org and initialize a Git repository at root with
config-dist.php and rename it
config.php. Update the following variables as follows:
Add the following environment variables to tour PHP application:
If you don’t have an domain for your Moodle application yet, you’ll be able to add a test domain provided by Clever Cloud in step 6.
In this step you enable storage outside of your application, which Moodle requires to run. Use a File System Bucket to store all uploaded files and appearance set ups away from the application server, as recommended by Moodle.
Create an FS Bucket add-on and link it to your PHP application. In your FS Bucket dashboard, find the path variable. It should look like this:
Add this variable to your PHP application and replace
/moodledata. Don’t forget to update changes.
Moodle needs an URL declared in variables to work properly. You can set it up in Domains names, from your PHP application menu. If you don’t have a domain name yet, you can use a
cleverapp.io subdomain provided by Clever Cloud for test purposes.
Don’t forget to update
URL="<your-url" if you haven’t yet.
Get the remote in your application menu > Information > Deployment URL and add it to Git with
git remote add clever <clever-remote-url>. Then, push your code with
git push clever -u master
💡 If you get a reference error when pushing, try this:
git push clever main:master.
Moodle recommends to set up a Cron job that runs every minute. For the Cron to execute as a PHP file, you will need to add a shebang at the very top of
admin/cli/cron.php, like this:
clevercloud/cron.json file with a string to run
"* * * * * $ROOT/admin/cli/cron.php"
You might encounter errors when the Cron tries to access
moodledata in your FS Bucket. For FS Bucket backups, look for a dedicated tool like rclone.
Note: this repository is already configured to run
/admin/cli/cron.php every minute as a cron job.
See Moodle installation documentation for further help and development configuration.
Did this documentation help you ?