Websites and applications
Install Moodle 5 from Softaculous
Since version 5.1, Moodle separates what is published on the web from the rest of the code. The public part goes in a public folder, and the code, configuration and libraries stay one level above, where no visitor can reach them. Softaculous handles this by installing the code in the folder above the domain's folder and using the domain's folder as public.
That is why the domain's folder has to be prepared for this before you install. This guide explains how to do it and what to check first.
Requirements
| Moodle 5.1 and 5.2 | Moodle 5.3 | |
|---|---|---|
| PHP | 8.2, 8.3 or 8.4 | 8.3 or 8.4 |
| Database | MySQL 8.4 or MariaDB 10.11 or later | MySQL 8.4 or MariaDB 11.4 or later |
PHP also needs the sodium extension enabled and max_input_vars set to 5000 or more. Moodle 5.3 is an LTS release, with security updates until October 2029. The full requirements are in the Moodle 5.3 release notes.
To find out which database your server has, open your hosting in the client area and go to Technical sheet. The Database and SSL card shows the version:
- 8.0: this is MySQL 8.0, and Moodle 5 does not work with it. See what to do if your server has MySQL 8.0.
- 11.4 or higher: this is MariaDB and supports any version of Moodle 5.
Set PHP 8.3 or 8.4 for the account or just for the folder where Moodle will go. Do not use PHP 8.5: it is not one of the versions Moodle 5.3 supports. On the same PHP screen, enable sodium and raise max_input_vars to 5000 if it is lower.
Prepare the subdomain
The simplest option is to install Moodle on a subdomain, such as aula.tudominio.com, with its own folder ending in /public:
- Log in to cPanel and open Domains.
- Click Create a New Domain and type the subdomain, for example
aula.tudominio.com. - Untick Share document root if it is ticked.
- In Document Root, type
aula.tudominio.com/public. cPanel will create the folder/home/usuario/aula.tudominio.com/public. - Click Submit.
- Wait for the subdomain to get its SSL certificate before installing: Moodle is configured with the
https://address.
Softaculous will install the code in /home/usuario/aula.tudominio.com and the website will be served from public.
If the subdomain already exists, is empty and its root is /home/usuario/aula.tudominio.com, change its root to aula.tudominio.com/public. The same applies to an addon domain with its own folder.
Install Moodle
- In cPanel, open Softaculous Apps Installer.
- Search for
Moodle, open its page and click Install. - The first drop-down is the protocol: choose
https://, withoutwww.. The second is the domain: choose the subdomain you prepared. - Leave the In Directory field empty.
- In Data Directory, Softaculous suggests
/home/usuario/moodledata. If you already have another Moodle on the account, use a different folder for each installation, for example/home/usuario/moodledata-aula: two installations cannot share it. - Enter the site name, the admin username, a unique password and the admin email address.
- Click Install.
When it finishes, Softaculous shows the site address and the admin address. Save those details in a password manager.
«Moodle files are already present» error
If Softaculous responds:
It seems that the Moodle files are already present at /home/usuario location. Hence you can not install Moodle on this domain. Please try to install lower version of Moodle on this domain.
the domain's root is directly inside your home folder, for example /home/usuario/aula.tudominio.com. Softaculous wants to install the code in the folder above, which in that case is /home/usuario, and since it already contains files it refuses. Changing the data directory does not fix it: what you need to change is the domain's root, as explained in prepare the subdomain.
The message suggests installing an earlier version, but if your server supports Moodle 5 there is no need: the site would start on an older version and you would have to upgrade it later.
Moodle on the main domain
The main domain is served from public_html, whose parent folder is also your home folder, and cPanel does not let you change its root. For Moodle 5, use a subdomain such as aula.tudominio.com or an addon domain with its own folder ending in /public. If you need the site to be on the main domain, contact us before installing and we will look into it with you.
If your server has MySQL 8.0
Moodle 5 needs MySQL 8.4 or MariaDB, so it cannot be installed on a server with MySQL 8.0. Contact us before installing and we will work out the right option with you: moving your account to a server with MariaDB 11.4, or installing Moodle 4.5. Moodle 4.5 is the previous LTS release and works with MySQL 8.0, but it only receives security updates until 4 October 2027.
After installing
- Go to the site address and the admin address, and check that the certificate is valid.
- Schedule Moodle's cron every minute with a cron job. In Moodle 5 the script is not in
public: the path is/home/usuario/aula.tudominio.com/admin/cli/cron.php. Use the binary for your Moodle's PHP version, for example/opt/alt/php83/usr/bin/php. - Set up sending email over SMTP so that notifications and password resets get through.
- Schedule backups of the files, the data directory and the database. A Moodle course backup does not replace a backup of the whole installation.
You may also find useful
- Connect TastyIgniter to the marketplace to install plugins Explains how to register a site on TastyIgniter, get its Carté key and link it from the admin panel...
- Set up IMAP and SMTP email in SugarCRM Gathers the IMAP and SMTP settings you need to connect each email account to SugarCRM's built-in web...
- Set up Moodle to send email using SMTP Shows which SMTP values to enter in Moodle for its notifications and how to group forum notification...
- Set up phpList to send emails and newsletters Set up phpList to send over SMTP in batches, stay within hourly limits and look after SPF, DKIM, bou...
Something wrong or out of date? Tell us and we will review it.