How to install Moodle on Ubuntu server?
Introduction
We know that there are many frameworks available on the market to help with the development of different applications. Python-Django is popular these days. Laravel, which is a PHP-based framework, has been known for a long time. All this really helps to reduce development time, ideally. Just like that, Moodle is an open-source software package to help the educational community. Moodle is a totally free and open-source learning management system based on PHP and distributed under the GNU General Public License. Moodle is used for online learning portals in schools, universities, and other areas.
How can we install it?
We can set up Moodle on the Ubuntu server. Here are the basic requirements:.
OS: Linux
Disk space: Min. 5 GB
Processor: Min. 1 Core
Memory: Min. 500MB
Step 1
Update the Ubuntu system packages.
sudo apt update && sudo apt upgrade
Step 2
Install PHP on the server.
apt install php
Ensure it is installed.
php -v
Also, install the necessary packages.
sudo apt install graphviz aspell ghostscript clamav php8.1-pspell php8.1-curl php8.1-gd php8.1-intl php8.1-mysql php8.1-xml php8.1-xmlrpc php8.1-ldap php8.1-zip php8.1-soap php8.1-mbstring git
Step 3
Install apache2
apt install apache2
Step 4
Download Moodle from the source repository. Ensure git is installed.
git clone git://git.moodle.org/moodle.git
Step 5
Copy all content from Moodle to Docroot on the server.
cp -R /opt/moodle /var/www/html/
Correct permission
chmod -R 0777 /var/www/html/moodle
Step 6
Install the MySQL server and start it.
apt install mysql-server
systemctl start mysql
Step 7
Configure MySQL for Moodle.
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'moodle-user'@'localhost' IDENTIFIED BY 'password';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodle-user'@'localhost';
Step 8
Time to install a moodle on the browser by calling server IP/moodle. Just click on continue.
It will be asking for paths, database configuration, etc. Give the necessary and complete installation.
Conclusion
The installation is pretty straight-forward and will be easy.