Moodle Open Source Learning Management System: About and Install Guide

Moodle is a powerful and flexible open-source learning management system (LMS) used by organizations, schools, universities, and businesses worldwide to create and manage online learning experiences. It’s used by over 400 million users around the world¹ making it is one of the most popular platforms for e-learning.

Moodle allows administrators to set up courses, track learners’ progress, create quizzes and assignments, manage communications, and much more. Moodle is customizable, scalable, and free to use, which makes it an ideal choice for educators looking for an open-source alternative to commercial LMS platforms.

Whether you want to create a small class for your students or a full-fledged training program for a corporation, Moodle’s flexibility and rich feature set make it a top choice.

¹ Moodle Stats

Why Choose Moodle?

Open-Source: It’s free to use, and anyone can contribute or modify it to fit their needs.

Highly Customizable: You can tweak themes, install plugins, and extend its functionality.

Scalable: Whether for a small group or a large organization, Moodle can grow with you.

Security and Compliance: Regular updates and security features keep your data safe.

How to Install Moodle

You can install Moodle on a web hosting provider or on Ubuntu server.

If you’re looking to install Moodle on a web hosting provider, the process is fairly straightforward. Hosting providers usually give you an easy-to-use control panel (such as cPanel or DirectAdmin) to handle most of the steps involving files and database management. Self-installation would require an isolated Ubuntu virtual server which would require regular maintenance and security.

Install on Web Host

Check Your Hosting Requirements

Before starting the installation, make sure your hosting environments meets the basic requirements for Moodle. These are typically provided in your hosting control panel or by the host itself. Tehse include:

  • Web Server: Apache, Nginx, or IIS
  • Database: MySQL, MariaDB, or PostgreSQL
  • SSL (HTTPS): It’s recommended to have an SSL certificate for secure communication.
  • PHP: Version 7.3 or higher and extensions (your hosting provider should support or allow you to enable these via control panel or PHP configuration settings):
    mysqli (or pdo_mysql), gd, xml, zip, json, mbstring, curl, intl, bcmath, openssl, soap (optional), fileinfo

Download Moodle

To install Moodle, you can download the latest stable release from the Moodle website or use the one-click installer (such as Softaculous) that some hosting services offer within their dashboard.

Option 1: Manual Download

Go to the Moodle download page.

Download the latest stable version as a ZIP file.

Upload the ZIP file to your server within File Manager or an FTP client.

Extract the file in your public_html (or equivalent) directory.

Option 2: One-Click Installers

Some hosting providers like SiteGround, Bluehost, and HostGator offer a one-click install option for Moodle. If your host provides one-click installers (such as Softaculous), you can simply find it in your hosting control panel and follow the prompts to install Moodle without any manual steps.

Set Up Moodle Data Directory

Moodle requires a directory to store files such as user uploads, course content, and logs. This directory should be placed outside the “public_html” or “htdocs” directory for security reasons.

Make sure the folder is writeable by the web server (check with your hosting provider if you’re unsure about folder permissions). Note the location which you’ll set for Moodle to point to for data storage during the installation.

Create a Database

Moodle requires a database to store all of its data (user information, course content, grades, etc.). Most hosting providers let you create a MySQL or MariaDB database from ther dashboard.

Go to your dashboard and find “Databases.”

Create a new database (e.g., moodle_db).

Create a new database user and assign the user to the newly created database with full privileges. Note the database, user, and new password which you’ll usel ater during the installation.

Configure Moodle Files

Once Moodle is uploaded and your database is ready, you will need to configure the Moodle settings file.

Go to the Moodle directory in your File Manager or via FTP, and find the file named config-dist.php and rename it to config.php.

You’ll need to modify a few key settings:

  • Modify $CFG->wwwroot to use HTTPS
  • $CFG->dbtype: Set this to mysqli for MySQL/MariaDB databases.
  • $CFG->dbhost: This is usually localhost.
  • $CFG->dbname: Enter the name of the database you created (e.g., moodle_db).
  • $CFG->dbuser: Enter the database user you created.
  • $CFG->dbpass: Enter the database user’s password.

Make sure to save your changes and exit the editor.

Run the Moodle Installer

Once your Moodle files are configured, it’s time to run the Moodle installer.

Open your browser and go to your site’s Moodle URL (e.g., http://yourdomain.com/moodle).

The installation wizard should appear. Follow the prompts, confirming the server and database settings, setting up your admin account (username, password, and email), and accepting the Moodle license.

The installer will automatically set up the database tables and complete the installation process.

After the installation is complete, Moodle will prompt you to finalize your setup by:

  • Setting up cron jobs for scheduled tasks
  • Configuring language and timezone settings
  • Installing additional optional plugins

Configure Scheduled Tasks

Use your hosting control panel’s cron job feature to run Moodle’s cron script every minute:

/usr/bin/php /path/to/moodle/admin/cli/cron.php

Once you’ve gone through the steps, you can start building your courses, adding users, and exploring all of Moodle’s features.

Install on Ubuntu

If you’re hosting Moodle on a VPS or dedicated server (running Ubuntu), the installation process will be different and slightly more technical. You will need to set up the LAMP stack (Linux, Apache, MySQL/MariaDB, PHP), configure Moodle manually through the command line, and ensure the proper server settings.

Follow these simplified steps to install Moodle on your Ubuntu server.

Install LAMP Stack

Start by updating your Ubuntu server:

sudo apt update && sudo apt upgrade -y

Moodle requires the LAMP stack (Linux, Apache, MySQL or MariaDB, and PHP) to work. If you already have, you can skip these steps.

Install Apache, PHP, and MariaDB:

sudo apt install apache2 php libapache2-mod-php php-mysql graphviz aspell git clamav php-pspell php-curl php-gd php-intl ghostscript php-xml php-xmlrpc php-ldap php-zip php-soap php-mbstring php-gmp php-bcmath unzip mariadb-server mariadb-client certbot python3-certbot-apache ufw nano

Once Apache and MariaDB are installed, enable them both to start automatically at boot:

sudo systemctl enable apache2
sudo systemctl start apache2

sudo systemctl enable mariadb
sudo systemctl start mariadb

Set Up Database

Log into MariaDB to secure your setup and create the Moodle database and user:

sudo mariadb-secure-installation

sudo mysql -u root -p

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Install Moodle Files

You can download Moodle from its official repository or use Git to pull the latest version. To obtain with Git:

cd /var/www/html
sudo git clone https://github.com/moodle/moodle.git moodle

Next, set the appropriate permissions for the Moodle directory:

sudo chown -R www-data:www-data /var/www/html/moodle
sudo chmod -R 755 /var/www/html/moodle

Create Moodle Data Directory

Moodle requires a separate directory to store data (uploads, course materials, etc.). Create it outside your web server’s document root:

sudo mkdir -p /var/moodledata
sudo chown -R www-data:www-data /var/moodledata

Configure Moodle

You will need to configure Apache and PHP for optimal Moodle performance. Modify the PHP configuration by increasing max_input_vars, post_max_size, and upload_max_filesize to handle larger uploads and course content.

Create configuration file by copy sample config then edit:

cp /var/www/html/moodle/config-dist.php /var/www/html/moodle/config.php

nano /var/www/html/moodle/config.php

Within the new confog file you’ll set your database and site configuration:

$CFG->dbname, $CFG->dbuser, $CFG->dbpass, $CFG->dbhost
$CFG->wwwroot (your domain/IP including https)
$CFG->dataroot (path to /var/moodledata)

Edit the PHP configuration files:

sudo nano /etc/php/7.4/apache2/php.ini

Find and modify these values:

max_input_vars = 5000
post_max_size = 256M
upload_max_filesize = 256M

Repeat the same changes for the CLI version of PHP (for command-line usage):

sudo nano /etc/php/7.4/cli/php.ini

Run Moodle Installation Script

Now, go to your web browser and navigate to the Moodle installation page by entering your server’s IP address or domain name, followed by /moodle. For example: http://your-server-ip/moodle

The Moodle installer will automatically guide you through the setup process, where you’ll enter server and site settings settings, database settings (database name, user, password), etc.

Set Up Cron Job

Moodle needs a cron job to run tasks such as sending notifications and cleaning up old data. Add the following cron job to execute every minute:

sudo crontab -u www-data -e

Then, add the following line to the cron file:

* * * * /usr/bin/php /var/www/html/moodle/admin/cli/cron.php >/dev/null

Once done, save and exit.

After completing these steps, you should be able to access Moodle through your server’s IP or domain. Follow the on-screen installation prompts to finalize the setup and start building your courses.

For any troubleshooting or further configurations, you can review the official Moodle installation documentation here.

Installing Moodle on your web hosting provider is a straightforward process that doesn’t require advanced technical skills. Whether you’re setting up an e-learning platform for your school, business, or personal project, Moodle offers the flexibility and functionality to meet your needs.

Once installed, you can begin creating engaging online courses, adding content, and welcoming students to your new site. If you need further assistance or encounter issues during installation, Moodle’s community forums and documentation are great resources to help you troubleshoot.

Happy learning and teaching!


Comments Section

Leave a Reply

Your email address will not be published. Required fields are marked *


,
Back to Top - Modernizing Tech