The latest stable version of Moodle when this tutorial was written is Moodle v4.3.3.
Requirements:
- Ubuntu Server 22.04 with 4GB RAM and 2 CPUs
- Non-root sudo user. Do not run from user root!
Install Apache, MySQL, and PHP
We first check the current installed PHP version.
php -v
If it shows Command 'php' not found
, then follow the next steps. Press enter when asked to confirm add repo.
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install apache2 mysql-client mysql-server php7.4 libapache2-mod-php
sudo apt install graphviz aspell ghostscript clamav php7.4-pspell php7.4-curl php7.4-gd php7.4-intl php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-ldap php7.4-zip php7.4-soap php7.4-mbstring
Download Moodle
cd /opt
sudo git clone git://git.moodle.org/moodle.git
cd moodle
sudo git branch -a
sudo git branch --track MOODLE_403_STABLE origin/MOODLE_403_STABLE
sudo git checkout MOODLE_403_STABLE
Branch 'MOODLE_400_STABLE' set up to track remote branch 'MOODLE_400_STABLE' from 'origin'.
Switched to a new branch 'MOODLE_400_STABLE'