Tutorial: How to Install Moodle on Linux Mint

In this tutorial, we will guide you through the process of installing Moodle on Linux Mint.

Prerequisites

Before we get started, you will need:

If you don't have any of these prerequisites, please follow the official documentation for each of them and install them before proceeding.

Step 1: Download and Extract Moodle

First, download the latest version of Moodle from the official website https://moodle.org/ using the following command:

sudo wget https://download.moodle.org/stable/latest/moodle-latest.tgz

Next, extract the downloaded file into the Apache document root directory /var/www/html/ using the following command:

sudo tar -zxvf moodle-latest.tgz -C /var/www/html/

Step 2: Create a MySQL Database and User for Moodle

Login to MySQL as the root user using the following command:

sudo mysql -u root -p

Next, create a new database for Moodle using the following command:

CREATE DATABASE moodle;

Create a new MySQL user and grant it full privileges over the Moodle database using the following command:

GRANT ALL PRIVILEGES ON moodle.* TO 'moodleuser'@'localhost' IDENTIFIED BY 'password';

Replace moodleuser and password with a username and password of your choice.

Step 3: Configure Moodle

Copy the sample configuration file to create your own configuration file using the following command:

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

Modify the config.php file using a text editor of your choice:

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

At a minimum, you need to set the database details, which can be found with the details you created in Step 2:

$CFG->dbtype    = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'moodleuser';
$CFG->dbpass    = 'password';
$CFG->prefix    = 'mdl_';
$CFG->dboptions = array (
  'dbpersist' => 0,
  'dbport' => '',
  'dbsocket' => '',
  'dbcollation' => 'utf8mb4_unicode_ci',
);

Step 4: Set File Permissions

Change the permissions of the Moodle directory using the following command:

sudo chmod -R 0777 /var/www/html/moodle/

This command will assign full read, write and execute permissions to all users for the Moodle directory and all of its subdirectories and files.

Step 5: Complete the Installation

Once you have followed the above steps, navigate to http:///moodle in your web browser. You should see the Moodle installation page.

Follow the installation wizard to complete the installation of Moodle. You will be prompted to provide details such as the site name, administrator account, and default language.

Once you have completed the installation wizard, you should be able to log in to Moodle and start using it.

Congratulations! You have successfully installed Moodle on Linux Mint.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!