What Moodle 5.3 expects from the operating system
Moodle 5.3 wants PHP 8.3 or 8.4 in a 64-bit build, the sodium extension, max_input_vars of at least 5000, and one of the supported databases at or above its minimum version. Distribution packages decide whether that is easy.
| Piece | Moodle 5.3 minimum | Debian 13 packages | Ubuntu 24.04 packages |
|---|---|---|---|
| PHP | 8.3 (8.4 also supported), 64-bit only | 8.4 | 8.3 |
| PostgreSQL | 17 | 17 | 16, below the minimum |
| MariaDB | 11.4.0 | 11.8 | 10.11, below the minimum |
Debian 13 is the short path: every piece comes from its own repositories at a version Moodle accepts. On Ubuntu 24.04 PHP is fine but the database has to come from the vendor's repository instead. Ubuntu 26.04 ships PHP 8.5, which the Moodle 5.3 release notes do not list as supported, so treat it as untested until they do. MySQL 8.4 is supported too if you already run it.
Moodle's own package file lists the PHP extensions it relies on: iconv, mbstring, curl, openssl, ctype, zip, zlib, gd, simplexml, spl, pcre, dom, xml, xmlreader, intl, json, hash, fileinfo and sodium, plus the driver for your database (pgsql or mysqli).
How much server does a school site need?
Size it from your busiest hour, not your head count: a long enrolment list that rarely logs in together is still a small site. What grows, and what it eats:
| What grows | Driven by | What it uses |
|---|---|---|
| Pages served at the same moment | A class starting a timed quiz, everyone uploading before a deadline | Processor cores and PHP processes |
| The database | Courses, users, quiz attempts, the activity logs | Memory for its cache and a quick disk |
| moodledata | Uploaded files, assignment submissions, video, course backups | Disk space that keeps climbing every term |
| Background tasks | Cron: notifications, cleanup, scheduled backups | A little processor time every minute |
Start with a machine that runs your pilot comfortably and watch load and free disk through the first exam week. When it gets tight, memory, disks and on some lines a second processor can be added to the server you already have, with no migration and no new IP address.
Why a whole machine suits a learning site
- No neighbours on exam day. Nobody else shares the processor, memory, disks or port, so quiz pages load at the speed you measured.
- Video without a meter. Lecture recordings and big course files leave over an unmetered port: there is no transfer allowance and no overage line on the invoice.
- Your settings. With root you set
php.ini, cron and the database yourself. - A way back in. On rack servers, blades and the m510 and m710x cartridges, the out-of-band console gives you the screen and the power button if a firewall rule locks SSH out.
- A clean slate when you need one. Reinstall the operating system from the control panel as often as you like, with no ticket.
- No commitment past the term you are in. Billing is month to month, so a pilot can run for one term and stop when any month ends.
The server that fits
Any class on our dedicated servers page can carry Moodle; what decides it is how many people hit the site at once. Pick the city closest to your learners on the order page, and choose Debian 13 where the line offers it.
- Compact cartridge servers suit one job: a training team or a single department with modest peaks.
- Everyday servers have one processor and plenty of headroom: a sensible start for a whole-school site.
- Two-processor servers carry a busy database and many requests at once: a large school, several campuses on one site, or exams for hundreds of learners in the same hour.
- Lots of video or long backup history? A second machine from our storage servers, with the drives and RAID you choose, keeps copies off the Moodle box.
Only trying Moodle with a handful of colleagues? A Cloud VPS is a Linux virtual machine on a server shared with other customers, and it is sold as exactly that. Move to a whole machine once real classes depend on it.
Up and running in an evening
- Order the server with Debian 13. Ready servers are handed over within 30 minutes of payment approval, with the login details sent by email.
- Set up the firewall: allow SSH first, then 80 and 443, and make sure the rules cover IPv6 as well as IPv4. Keep the database listening on the machine itself and never open its port to the internet.
- Install a web server, PHP 8.4 with the extensions listed above, and PostgreSQL 17 or MariaDB. Create one empty database and a user that owns it.
- Download the Moodle 5.3 package from download.moodle.org, compare it with the published sha256 sum, and unpack it to
/var/www/moodle. - Point the web server's document root at
/var/www/moodle/public. Since Moodle 5.1 only that folder is meant to face the web, and the site address you give Moodle must not end in/public. - Create the data folder outside the web root, for example
/var/moodledata, owned by the web server user (www-dataon Debian) and closed to everyone else. - Set
max_input_vars = 5000in thephp.iniused by the web server and in the one used on the command line. - Run the installer as
www-data, below. It writesconfig.phpinto the Moodle folder, so give that one folder (not its contents) towww-datajust for the install, then hand the folder back to root once it finishes. Leaveconfig.phpitself readable bywww-data.
cd /var/www/moodle && sudo -u www-data /usr/bin/php admin/cli/install.php --chmod=2770
Run interactively, it prompts for the database and admin passwords, so they never sit in your shell history as --dbpass or --adminpass. The --chmod=2770 option keeps new folders in moodledata away from other users; the installer's default is 2777, which you do not want. If you use the browser installer instead, finish it in one sitting: until the admin account exists, whoever reaches the address first can complete it.
Then add the cron job. Moodle wants its cron run every minute, as the web server user: open that user's table with sudo crontab -u www-data -e and add a * * * * * line that runs /usr/bin/php /var/www/moodle/admin/cli/cron.php. Finally put HTTPS in front of the site, and follow Moodle's router page to send unknown paths to r.php before setting $CFG->routerconfigured = true; in config.php. Until then the router still works through r.php in the address.
Check the authentication settings once you are in. Self-registration should stay off unless you really want strangers creating accounts, and the admin account deserves a long, unique password.
Keeping it safe: backups and upgrades
A whole-site backup is three things taken together: the database, the moodledata folder and config.php, plus any add-on plugins you installed. Course backups alone do not bring back a broken site.
- Late at night, switch the site to maintenance mode so nothing changes mid-copy: from
/var/www/moodle, runsudo -u www-data /usr/bin/php admin/cli/maintenance.php --enable. - Dump the database with its own tool (
pg_dumpfor PostgreSQL; the MariaDB server guide covers that side). - Copy moodledata and
config.phpnext to the dump. - Bring the site back with the same script and
--disable. - Move the set to another machine. A copy on the same disks dies with them.
For single courses Moodle has its own command-line backup, run as the web server user, for example sudo -u www-data /usr/bin/php admin/cli/backup.php --courseid=2 --destination=/moodle/backup/. The destination folder must already exist and be writable by www-data, or the script stops.
For upgrades, take that full backup first. Moodle 5.3 upgrades from 4.4 or later. Rename the old code folder rather than deleting it, unpack the new release in its place, copy config.php back, and put add-on plugins inside public where they now belong. Then run admin/cli/upgrade.php as www-data. Keep the renamed folder and the dump until the upgraded site has worked through a normal day: they are your way back.
When this is the wrong place for Moodle
We keep the hardware and the network working; installing, patching and backing up Moodle is your job, because you manage the server. If nobody on the team is comfortable on a Linux command line, a managed Moodle service from a Moodle partner will cost you less grief. And if exams depend on the site, plan the off-machine backups and rehearse a restore before term starts, not after the first bad night.
Questions people ask
- Does Moodle cost anything to run on my own server?
- The software itself is open source under the GPL version 3 or later, so there is no licence fee. What you pay for is the server and the time somebody spends looking after it.
- Which Moodle version should a new site start on?
- Moodle 5.3, released on 5 October 2026, is the current long-term support release, with general support until 4 October 2027 and security fixes until 1 October 2029. The previous long-term release, 4.5, gets security fixes only until 4 October 2027. Starting on 5.3 buys the longest runway.
- Can I bring an existing Moodle site across?
- Yes. Take the full backup described above, install the same Moodle version on the new server, restore the database dump, moodledata and config.php, then change the site address if it moves. Our server migration page covers the move itself, including running both machines side by side; migration help costs nothing.
- Is a virtual server enough, or do I need a dedicated one?
- For a trial with a few teachers, a virtual machine is fine. Once whole classes sit timed quizzes at the same moment, shared processor time becomes the thing that slows the page, and a whole machine removes it. You can start on one and move to the other between terms.
- Can I run live online lessons from Moodle?
- Moodle includes a BigBlueButton activity, but the video conferencing itself runs on a separate BigBlueButton server. Our guide to a BigBlueButton server covers that half.