Websites and applications

Install Moodle 5 from Softaculous

Reviewed on 7 min read moodle softaculous aplicaciones e learning

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:

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:

  1. Log in to cPanel and open Domains.
  2. Click Create a New Domain and type the subdomain, for example aula.tudominio.com.
  3. Untick Share document root if it is ticked.
  4. In Document Root, type aula.tudominio.com/public. cPanel will create the folder /home/usuario/aula.tudominio.com/public.
  5. Click Submit.
  6. 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

  1. In cPanel, open Softaculous Apps Installer.
  2. Search for Moodle, open its page and click Install.
  3. The first drop-down is the protocol: choose https://, without www.. The second is the domain: choose the subdomain you prepared.
  4. Leave the In Directory field empty.
  5. 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.
  6. Enter the site name, the admin username, a unique password and the admin email address.
  7. 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

Something wrong or out of date? Tell us and we will review it.