How to Install Moodle on Debian Latest

Moodle is an open-source Learning Management System that helps the educators to create online courses and e-learning sites. In this tutorial, we will guide you through the installation process of Moodle on Debian Latest.

Prerequisites

Before you start installing Moodle on Debian, there are a few prerequisites you need to consider:

  • A Debian 10 server
  • A non-root user with sudo permission
  • LAMP stack installed on your Debian server (Apache, MariaDB, and PHP)

Step 1: Update the system

Open your terminal and login as a non-root user with sudo permission. Then, update the system by running the following command:

sudo apt update && sudo apt upgrade

Step 2: Install Moodle dependencies

In order to install Moodle on your Debian server, you need to install the required dependencies. Run the following command to install them:

sudo apt install apache2 mariadb-server unzip wget curl libapache2-mod-php7.3 php7.3 php7.3-cli php7.3-gd php7.3-intl php7.3-curl php7.3-xml php7.3-mbstring php7.3-zip php7.3-soap php7.3-ldap

Step 3: Configure MariaDB

After installing the dependencies, you need to configure MariaDB for Moodle installation. Run the following command to open MariaDB configuration:

sudo mysql_secure_installation

Follow the on-screen instructions and set up the root password, remove anonymous users, disable root login remotely, remove test databases, and reload privileges.

Step 4: Create a Database and User in MariaDB

Create a new database and user in MariaDB for Moodle installation. Log in to MariaDB server with root user:

sudo mysql -u root -p

Create a new database:

CREATE DATABASE moodle;

Create a new user:

CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'password';

Grant privileges to the newly created user:

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

Flush the privileges:

FLUSH PRIVILEGES;

Exit MariaDB server:

exit

Step 5: Install Moodle

Download the latest Moodle stable version:

cd /tmp/
wget https://download.moodle.org/download.php/direct/stable311/moodle-latest-311.tgz

Unzip the downloaded file:

tar -zxvf moodle-latest-311.tgz

Move the extracted files to the Apache web root directory:

sudo mv moodle/* /var/www/html/

Set the proper permissions:

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

Step 6: Access Moodle Install Wizard

You can access the Moodle Install Wizard via web browser. Open your favorite web browser and type in the URL:

http://<your-server-IP-address>/install.php

The Moodle Install Wizard will appear. Follow the on-screen instructions to configure the database and Moodle site.

Conclusion

You have successfully installed Moodle on Debian Latest. You can now access your Moodle site and start creating courses.