Skip to main content

Get started with Moodle

Moodle is a free, open-source learning management system (LMS): software for running online courses. Teachers can publish lessons and files, set assignments and quizzes, grade work and talk with learners, while students follow their courses in one place. It suits schools, trainers and organizations that run courses for staff or customers. This guide covers the parts of installing Moodle that most often trip people up: the data folder and the cron job.

The two parts of a Moodle site​

Moodle stores things in two separate places, besides its database:

  • The Moodle code: the application files, which live in your web folder so the site can load.
  • The data folder, usually called moodledata: uploaded course files, learner submissions, caches and other data. This folder must not be inside the web root (the folder your domain serves files from). If it were, anyone who guessed a file's address could download learners' work directly, bypassing Moodle's access checks.

A typical layout on a hosting account looks like this:

/home/exampleuser/moodledata/ <- data folder, not public
/home/exampleuser/public_html/ <- web root
/home/exampleuser/public_html/moodle/ <- Moodle code (or directly in the web root)

The exact folder names depend on your host.

Install Moodle​

If your host offers a one-click installer for Moodle, use it, and check afterwards that the data folder it created is outside the web root.

To install Moodle yourself with the official web installer:

  1. Download Moodle from the official Moodle download site.
  2. Upload the code to your web folder over SFTP. See Upload files with SFTP.
  3. Create the moodledata folder outside the web root, and make sure the web server can write to it. Never solve permission problems by giving everyone full access.
  4. Create a database and a database user in your hosting control panel.
  5. Open your site's address in a browser. The installer asks for the data folder path and the database details, then checks your server environment.
  6. Fix anything the environment check reports as missing, then continue to create the administrator account and set the site name.

Set up the cron job​

Moodle depends on cron, a scheduler on the server that runs a command at regular intervals. Moodle's scheduled tasks send forum posts and notifications, clean up old data, process course backups and much more. Without cron, parts of Moodle quietly stop working.

The official recommendation is to run Moodle's command-line cron script every minute. A cron job usually looks like this, with the paths changed to match your account:

* * * * * php /home/exampleuser/public_html/moodle/admin/cli/cron.php > /dev/null

Some hosts limit how often cron can run; if yours does, use the shortest interval it allows. See Cron jobs for how to add one. After it runs, the admin notifications page stops warning that cron has not run recently.

First steps after installing​

  • Review the notifications page in Site administration. It reports updates, environment problems and whether cron is running.
  • Run the security checks report in Site administration and work through its warnings.
  • Set up outgoing email so learners receive notifications and password resets, then send a test message.
  • Decide how people get accounts: self-registration, accounts you create, or bulk upload. Turn off self-registration if you do not need it, to avoid spam accounts.
  • Create a test course and enroll a test student to see what learners experience.

Keep Moodle updated and backed up​

A complete Moodle backup has three parts: the code folder, the moodledata folder and the database. Back up all three before every upgrade. See Backups and restores.

To upgrade, follow the upgrade instructions in the Moodle documentation for your version: put the site in maintenance mode, replace the code with the new version while keeping your config.php and any add-on plugins, then visit the admin area to run the database upgrade. Check that your add-ons support the new version first.

At DomainPilot

You can choose Moodle when you order DomainPilot web hosting so it is installed when your account is set up. Backups run weekly on the Starter plan and daily on the other plans.

Where to get help​

  • The official documentation at docs.moodle.org covers installation, cron, administration and upgrades.
  • The community forums on moodle.org have areas for installation and administration questions.

Moodle can grow resource hungry as learners and courses increase, especially during quizzes when many people are active at once. A site with many users may outgrow shared hosting; see Web hosting, VPS or cloud.

Did this article help you?