To install Moodle, set up a server with a web server (Apache or Nginx), 64-bit PHP 8.3 or 8.4 and a database (MySQL 8.4, MariaDB 11.4 or PostgreSQL 17). Download Moodle from download.moodle.org or Git, create an empty database and a moodledata folder outside the web root, then run the web installer or the CLI installer.
The whole process takes about 30 to 60 minutes on a clean Ubuntu server. On cPanel it takes 10 to 20 minutes if your host meets the requirements.
This guide covers Moodle 5.3 LTS, released on 5 October 2026 and supported with security fixes until October 2029 (see what’s new in our Moodle 5.3 LTS features guide). It walks you through three paths: Ubuntu (best for production), cPanel (best for small sites on shared hosting) and Windows or localhost (best for testing).
About the author: Written by the Moodle team at Dynamic Pixel, a Certified Moodle Partner with 15+ years of experience in LMS implementation, hosting and upgrades for enterprises, universities and government bodies. Reviewed by Udit Khandelwal, CEO & Co-Founder.
How this guide was prepared: Requirements, version numbers, dates and commands are based on the official Moodle 5.3 release notes and Moodle Docs, linked in the Sources section. Last updated: 30 October 2026.
Moodle 5.3 System Requirements (2026)
Moodle 5.3 needs 64-bit PHP 8.3 or 8.4, a supported database and the PHP sodium extension. Check these before you download anything. A wrong PHP or database version is the most common reason an install fails.
|
Component |
Minimum for Moodle 5.3 |
Our recommendation |
|---|---|---|
|
PHP |
8.3.0 (64-bit only); 8.4 also supported |
PHP 8.3 on Ubuntu 24.04 |
|
PHP setting |
max_input_vars ≥ 5000 |
5000 |
|
Required PHP extension |
sodium (plus intl, mbstring, xml, zip, gd, curl, soap, opcache) |
Install all in one command (see Ubuntu steps) |
|
MySQL |
8.4 |
Latest 8.4.x |
|
MariaDB |
11.4.0 |
Latest 11.4.x |
|
PostgreSQL |
17 |
17 or newer |
|
Microsoft SQL Server |
2019 |
Only if you are a Windows shop |
|
Web server |
Apache or Nginx, document root pointed to Moodle’s /public folder |
Apache for beginners, Nginx for scale |
|
RAM |
Not fixed by Moodle |
4 GB for a small pilot, 8 GB+ for a few hundred active users |
Source: Moodle 5.3 release notes. Oracle Database is no longer supported from Moodle 5.0. The RAM numbers are practical starting points, not official minimums.
Two changes that break most “old” tutorials
- The /public folder (since Moodle 5.1). Only the /public folder should be web-accessible. Your web server must point to moodle/public, not moodle. Guides written before late 2025 skip this step, and the site then shows errors or directory listings (Moodle Docs).
- Ubuntu 26.04 ships PHP 8.5. Moodle 5.3 lists PHP 8.3 and 8.4 as supported, so a default apt install php on Ubuntu 26.04 gives you a version outside Moodle’s support list. For a production Moodle server today, use Ubuntu 24.04 LTS, which ships PHP 8.3 by default.
Which Moodle Installation Method Should You Choose?
Pick Ubuntu for any live LMS, cPanel for a small site on shared hosting, and Windows or localhost only for testing and training.
|
Method |
Best for |
Skill level |
Setup time (estimate) |
Production-ready? |
Main limitation |
|---|---|---|---|---|---|
|
Ubuntu server (VPS or cloud) |
Schools, companies, 100+ users |
Intermediate (Linux commands) |
30–60 min |
Yes |
You manage updates and security |
|
cPanel shared hosting |
Small pilots, under ~100 active users |
Beginner |
10–20 min |
Limited |
Host must offer PHP 8.3+, MySQL 8.4/MariaDB 11.4 and a changeable document root |
|
Windows PC / localhost (XAMPP or similar) |
Testing plugins, themes, training admins |
Beginner |
20–40 min |
No |
Not secure or fast enough for real learners |
|
Docker (official moodle-docker) |
Developers, plugin testing |
Advanced |
15–30 min |
No (development only) |
Built for development, not live sites |
If you are unsure, start with localhost to learn the interface. Then move to an Ubuntu server when you are ready for real learners.
If you prefer not to manage a server at all, Moodle HQ offers MoodleCloud, and Certified Moodle Partners such as Dynamic Pixel offer managed Moodle hosting.
How to Install Moodle on Ubuntu 24.04 (Step-by-Step)
Install Apache, PHP 8.3 and MariaDB 11.4, download Moodle 5.3 with Git, point Apache to the /public folder, then run the CLI installer and add a cron job. Below is the full sequence for a fresh Ubuntu 24.04 LTS server.
Important: Ubuntu 24.04’s built-in database packages (MariaDB 10.11, MySQL 8.0, PostgreSQL 16) are older than Moodle 5.3’s minimums. That is why Step 2 adds the official MariaDB 11.4 repository.
Step 1: Update the server and install Apache + PHP 8.3
sudo apt update && sudo apt upgrade -y
sudo apt install -y apache2 git unzip curl \
php8.3 libapache2-mod-php8.3 php8.3-cli php8.3-mysql \
php8.3-xml php8.3-mbstring php8.3-curl php8.3-zip \
php8.3-gd php8.3-intl php8.3-soap php8.3-opcache
php -v
The sodium extension ships inside Ubuntu’s php8.3-common package, so it is enabled by default. Check it with php -m | grep sodium.
Step 2: Install MariaDB 11.4 and create the database
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | \
sudo bash -s — –mariadb-server-version=“mariadb-11.4”
sudo apt update && sudo apt install -y mariadb-server
sudo mariadb-secure-installation
Then open the database shell with sudo mariadb and run:
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER ‘moodleuser’@‘localhost’ IDENTIFIED BY ‘Use-A-Strong-Password’;
GRANT ALL PRIVILEGES ON moodle.* TO ‘moodleuser’@‘localhost’;
FLUSH PRIVILEGES;
EXIT;
Step 3: Download Moodle (Git method)
Git makes future upgrades a one-line job, so it is a better choice than the ZIP from download.moodle.org.
cd /var/www
sudo git clone -b MOODLE_503_STABLE https://github.com/moodle/moodle.git moodle
Step 4: Create the moodledata folder
This folder stores uploads, cache and sessions. It must sit outside the web root and be writable by the web server.
sudo mkdir /var/moodledata
sudo chown -R www-data:www-data /var/moodledata
sudo chmod -R 0770 /var/moodledata
Step 5: Set PHP limits
Edit /etc/php/8.3/apache2/php.ini and /etc/php/8.3/cli/php.ini. Set:
max_input_vars = 5000
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 512M
The 5000 value is a hard requirement. The upload and memory values are sensible starting points; change them to match your course files.
Step 6: Point Apache to Moodle’s /public folder
Create /etc/apache2/sites-available/moodle.conf:
<VirtualHost *:80>
ServerName lms.yourdomain.com
DocumentRoot /var/www/moodle/public
<Directory /var/www/moodle/public>
AllowOverride None
Require all granted
FallbackResource /r.php
</Directory>
</VirtualHost>
sudo a2ensite moodle.conf && sudo a2dissite 000-default.conf
sudo systemctl reload apache2
The FallbackResource /r.php line sends clean URLs to Moodle’s new router (added in 5.1). See Moodle Docs on the code restructure for Nginx and alias examples.
Step 7: Run the installer
Open http://lms.yourdomain.com in a browser and follow the screens. Or use the faster command-line installer:
sudo -u www-data php /var/www/moodle/public/admin/cli/install.php
It asks for the site URL, data folder, database details and admin account, then creates config.php.
Step 8: Lock file permissions and add cron
sudo chown -R root:root /var/www/moodle
sudo crontab -u www-data -e
Add this line so Moodle’s background tasks run every minute:
* * * * * /usr/bin/php /var/www/moodle/public/admin/cli/cron.php >/dev/null
Moodle Docs warns that a site will not work properly without cron. Code folders should not be writable by the web server; only moodledata should be.
Step 9: Add HTTPS
sudo apt install -y certbot python3-certbot-apache
sudo certbot –apache -d lms.yourdomain.com
After HTTPS works, make sure $CFG->wwwroot in config.php starts with https://.
![]()
How to Install Moodle on cPanel (Shared Hosting)
On cPanel, you upload the Moodle ZIP, create a MySQL database in the MySQL Database Wizard, set the domain’s document root to Moodle’s /public folder, then run the web installer. First confirm your host gives you PHP 8.3+ and MySQL 8.4 or MariaDB 11.4. Many budget plans do not yet.
Pre-check (2 minutes)
- In cPanel, open Select PHP Version or MultiPHP Manager and choose PHP 8.3 or 8.4.
- In PHP Options, set max_input_vars to 5000. Confirm the sodium and intl extensions are ticked.
- Ask your host for the exact MySQL or MariaDB version. If it is below Moodle 5.3’s minimum, install Moodle 4.5 LTS instead or move to a VPS.
Steps
- Download Moodle. Get the Moodle 5.3 ZIP from download.moodle.org.
- Create a subdomain. In Domains, click Create a New Domain (for example lms.yourdomain.com). Moodle Docs notes the main domain may not let you change its document root, so a subdomain is easier.
- Upload and extract. In File Manager, upload the ZIP into the subdomain’s folder and extract it. You should see a moodle folder that contains a public subfolder.
- Set the document root. Back in Domains, edit the subdomain and set its document root to …/moodle/public.
- Create moodledata. In File Manager, create a moodledata folder in your home directory, outside public_html.
- Create the database. Use MySQL Database Wizard: create a database and a user, then tick ALL PRIVILEGES. Note the full names; cPanel adds your account prefix (for example acct_moodle).
- Run the installer. Visit your subdomain. Choose the language, enter the moodledata path (for example /home/acct/moodledata), choose MariaDB or MySQL, and enter the database details.
- Finish setup. Pass the server checks, create the admin account and set the site name.
- Add cron. In Cron Jobs, add a job that runs every minute:
/usr/local/bin/php /home/acct/moodle/public/admin/cli/cron.php >/dev/null 2>&1
Your host’s PHP path may differ. Check it in cPanel or ask support.
Our view: cPanel works well for a pilot with a few dozen learners. Once you pass roughly 100 active users or run timed quizzes, shared CPU limits usually cause slow pages. That is the point to move to a VPS or managed Moodle hosting.
How to Install Moodle on Windows PC (Localhost)
To install Moodle on a Windows PC, install a local stack such as XAMPP with PHP 8.3 or 8.4 and a supported database, place the Moodle code in its web folder, point the local site to Moodle’s /public folder, then open localhost and run the installer. Use this only for testing, never for real learners.
Older Moodle versions had an official all-in-one Windows package. For Moodle 5.3, check download.moodle.org first; if no Windows package is listed, use the manual method below.
Localhost Moodle install with XAMPP
- Install a local server. Download XAMPP (or Laragon) with PHP 8.3 or 8.4. Check that its bundled MariaDB meets Moodle 5.3’s minimum of 11.4; if not, install MariaDB 11.4 separately.
- Fix PHP settings. In php.ini, set max_input_vars = 5000 and enable extension=intl, extension=sodium, extension=zip and extension=gd. Restart Apache.
- Add the Moodle code. Extract the Moodle ZIP to C:\xampp\moodle.
- Create moodledata. Make C:\xampp\moodledata, outside htdocs.
- Point Apache to /public. In httpd.conf, set DocumentRoot and <Directory> to C:/xampp/moodle/public, and add FallbackResource /r.php inside the Directory block.
- Create the database. In phpMyAdmin, create a database named moodle with utf8mb4_unicode_ci collation.
- Install. Open http://localhost, follow the installer and create the admin account.
Faster alternatives for developers
- WSL2 (Windows Subsystem for Linux): Run Ubuntu 24.04 inside Windows and follow the Ubuntu steps above. This matches a real server most closely.
- Docker: Moodle HQ maintains moodle-docker for development and plugin testing.
A localhost site is the safest place to test plugins, themes and upgrades before you touch a live LMS.
Common Moodle Installation Errors and Fixes
Most install failures come from five causes: wrong PHP version, low max_input_vars, a missing PHP extension, the web root not pointing to /public, or wrong folder permissions. Use this table to match the symptom to the fix.
|
Error or symptom |
Likely cause |
Fix |
|---|---|---|
|
Directory listing or moodle_exception on the home page |
Web server points to moodle instead of moodle/public |
Change the document root to /public and reload the web server |
|
“max_input_vars must be at least 5000” |
PHP default is 1000 |
Set max_input_vars = 5000 in php.ini (web and CLI) |
|
“PHP extension sodium / intl is not installed” |
Extension missing or disabled |
Install or enable it, then restart Apache or PHP-FPM |
|
“Database version is too old” |
MySQL below 8.4, MariaDB below 11.4, PostgreSQL below 17 |
Upgrade the database, or install Moodle 4.5 LTS if you cannot |
|
“Data directory is not writable” |
Wrong owner on moodledata |
chown -R www-data:www-data /var/moodledata |
|
Clean URLs return 404 |
Router fallback missing |
Add FallbackResource /r.php (Apache) or try_files … /r.php (Nginx) |
|
Installer times out |
Low PHP execution time on shared hosting |
Use the CLI installer, or ask the host to raise max_execution_time |
If your site installs but feels slow, see our guide to Moodle performance optimization.
Post-Install Checklist
- ☐ Cron runs every minute (check Site administration > Server > Tasks)
- ☐ HTTPS works and wwwroot uses https://
- ☐ Outgoing email works (Site administration > Server > Email)
- ☐ Daily backups of the database and moodledata are scheduled
- ☐ Site administration > Notifications shows no warnings
- ☐ Security checks report (Site administration > Reports > Security checks) reviewed
- ☐ Site registered at moodle.org to receive security alerts
Who Runs Moodle, and How Big Do Sites Get?
Moodle is one of the most widely used open-source LMS platforms, with over 161,000 registered sites and 412 million users in 242 countries (moodle.org statistics, checked 30 October 2026). Real numbers are higher, because registration is optional.
The size data helps you choose an install method:
|
Registered site size (users) |
Number of sites |
Share of all registered sites |
Typical install path |
|---|---|---|---|
|
0 – 1,000 |
134,575 |
~84% |
cPanel, small VPS or managed hosting |
|
1,000 – 10,000 |
19,968 |
~12% |
Ubuntu VPS or managed hosting |
|
10,000 – 100,000 |
5,798 |
~4% |
Dedicated or cloud servers, tuned database |
|
100,000+ |
638 |
under 1% |
Clustered cloud setup with expert support |
Shares are our calculation from the moodle.org figures. The takeaway: about 84% of registered Moodle sites have under 1,000 users, so most organisations can start on a simple, well-configured single server.
When to install Moodle yourself vs hire a partner
|
Situation |
DIY install |
Hire a Certified Moodle Partner |
|---|---|---|
|
Testing or learning Moodle |
Yes |
Not needed |
|
Pilot with under 100 users |
Yes, if you know Linux or cPanel |
Optional |
|
1,000+ users, exams or SSO/HRMS integration |
Risky |
Recommended |
|
Upgrade from Moodle 3.x/4.x with custom plugins |
Risky |
Recommended (upgrade service) |
|
Custom theme, plugins or mobile app |
Not suitable |
Recommended (customization) |
Frequently Asked Questions
How do I install Moodle LMS step by step?
Prepare a server with 64-bit PHP 8.3 or 8.4, a supported database and a web server. Download Moodle, create an empty database and a moodledata folder outside the web root, and point the web server to Moodle’s /public folder. Then run the web or CLI installer, create the admin account and set up a cron job that runs every minute.
Where can I get the official Moodle download?
Download Moodle only from download.moodle.org or the official Git repository on GitHub. Moodle Docs advises against unofficial installers, because they may not upgrade cleanly. For new sites in 2026, choose Moodle 5.3 LTS, which receives security fixes until October 2029.
How do I install Moodle on Windows or a PC?
Install a local stack such as XAMPP with PHP 8.3 or 8.4, extract Moodle into its folder, create a moodledata folder and a utf8mb4 database, point Apache to Moodle’s /public folder, and open localhost to run the installer. A Windows PC install is fine for testing, but use a Linux server for real learners.
What is a localhost Moodle install used for?
A localhost Moodle install runs only on your own computer at http://localhost. Teams use it to learn the admin panel, test plugins and themes, and rehearse upgrades without risking a live site. It is not reachable from the internet, so learners cannot use it.
How do I install Moodle on a local server for my office?
Install Ubuntu 24.04 on an office machine, follow the Ubuntu steps in this guide, and use the server’s local IP address (for example http://192.168.1.50) as the site URL. Staff on the same network can then log in. Give the server a fixed IP so the URL never changes.
Which Ubuntu version is best for Moodle 5.3?
Ubuntu 24.04 LTS is the safer choice today. It ships PHP 8.3, which Moodle 5.3 supports. Ubuntu 26.04 ships PHP 8.5 by default, which is outside Moodle 5.3’s listed PHP versions (8.3 and 8.4). On either release, you still need a newer database than Ubuntu’s default packages.
Is Moodle free to install?
Yes. Moodle LMS is open source under the GNU GPL licence, so the software is free to download, install and change. Your real costs are hosting, a domain, an SSL certificate (free with Let’s Encrypt), and the time or partner fees for setup, updates and support.
How long does it take to install Moodle?
On a clean Ubuntu server, an experienced admin usually needs 30 to 60 minutes, including database setup and HTTPS. On cPanel hosting that already meets the requirements, it takes about 10 to 20 minutes. Configuring courses, users, themes and integrations takes much longer than the install itself.
Why does my new Moodle site show a directory listing or an error?
Since Moodle 5.1, only the /public folder should be web-accessible. If your web server still points to the main moodle folder, you will see a directory listing or a moodle_exception. Change the document root to moodle/public, reload the web server, and the installer will load.
Next Step
If you want a production-ready Moodle without managing servers yourself, talk to Dynamic Pixel’s Moodle team about Moodle LMS implementation, hosting and ongoing support.
Sources
- Moodle 5.3 release notes and server requirements – moodledev.io
- Moodle releases and support dates – Moodle Docs
- Upgrade and /public directory restructure – Moodle Docs
- Installation quick guide (cron, CLI installer) – Moodle Docs
- Moodle statistics – moodle.org
- Default PHP versions by Ubuntu release – LinuxCapable
- Official Moodle downloads
- moodle-docker – Moodle HQ on GitHub