Linux

Where Does Moodle Store Data and Config?

Moodle config file and data directory paths on Linux for self-hosted learning platforms. Covers defaults.

Last updated

Moodle keeps uploads outside the web root in a dataroot folder. The default path is /var/moodledata with course files, caches, and sessions inside. That folder dominates disk on course heavy sites.

Connection settings live in config.php at the web root with database passwords. Grades and enrolments live in MySQL per that config. Back up config.php, the dataroot, and a database dump together for moves. Quizzes grade automatically. Badges reward completion. Cohorts group learners. Forums host course debates.

Where Moodle stores this, by platform

Linux
/var/moodledata (dataroot)

Course files with cache and session subfolders. Must sit outside the web root. Serve with web user ownership for uploads.

Linux
/var/www/moodle/config.php

Database credentials and dataroot path for the site. Restrict read access to the web user. Keep a copy off the server with dumps.

Frequently asked questions

what do i back up for a Moodle move

Copy config.php with moodledata and a database dump. The config holds database passwords. Course files live in moodledata. All three restore learning. Keep copies safe.

where are Moodle course files stored

Open config.php in the web root to read database host and dataroot lines. Course files default under the dataroot outside the web root. The file rules. Test restores first.

Notice an outdated path? Let us know.