How to Install Moodle on POP! OS

Moodle is a free, open-source Learning Management System (LMS) designed to help educators create effective online learning experiences. Users can share content, create course material, communicate with students and track their progress. In this tutorial, you will learn to install Moodle on POP! OS Latest.

Requirements

Before proceeding with the installation process, make sure that your system meets the following requirements:

Step 1 – Install Apache Web Server

Moodle runs on the Apache web server, therefore, the first step is to install it on your system. Follow the below command to install it.

sudo apt install apache2 

After installing the Apache server, start it and enable it to start at the system boot.

sudo systemctl enable apache2
sudo systemctl start apache2

After this step, check if the web server is running by accessing the default page using a web browser. Open up the web browser and enter the IP address of the server http://server-ip-address/. You will see the Apache2 default page.

Step 2 – Install PHP and PHP modules

Moodle runs on the PHP script, therefore, the second step is to install PHP and other PHP modules required to run Moodle on your system. Follow below command to install all modules.

sudo apt install php libapache2-mod-php php-mysql php-curl php-gd php-xml php-mbstring php-zip php-soap php-intl

After installation of the PHP module, confirm if the PHP module is installed or not by running the following command.

php --version

This command will give an output of the current PHP version installed on your system.

Step 3 – Install MySQL Database Server

Moodle requires a database server to store its data. Here, in this tutorial, we are using the MySQL server for the installation of Moodle. The below command will install the MySQL database on your system.

sudo apt install mysql-server

After the installation of the MySQL server, start the server and enable to start at the time of boot.

sudo systemctl start mysql
sudo systemctl enable mysql

After the installation of the MySQL server, create a new database and a new user for Moodle. Login to MySQL as a root user using the following command.

sudo mysql -u root -p

Create a new database for Moodle with a name (Here, we give the name to the database as "moodle") using the command below.

CREATE DATABASE moodle;

Create a new MySQL user for Moodle with the name "moodleuser" and password "password" using the below command.

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

Grant all privileges to the "moodleuser" for "moodle" database use the below command.

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

Flush the privileges and exit from the MySQL prompt using the following command.

FLUSH PRIVILEGES;
EXIT;

Step 4 – Download Moodle

Visit the following URL https://download.moodle.org/download.php/stable39/moodle-latest-39.tgz. to download the latest version of Moodle

Use the below command to download Moodle.

wget https://download.moodle.org/download.php/stable39/moodle-latest-39.tgz 

Extract the downloaded file using the command below.

tar -zxvf moodle-latest-39.tgz 

After the extraction of the Moodle package, move it to the Apache server's root directory using the command below.

sudo mv moodle /var/www/html/ 

Step 6 – Complete the installation of Moodle via browser

Now, access the Moodle web interface from a browser using the following URL "http://server-ip-address/moodle". After accessing this URL you will see the Moodle's installation page.

Select the language that you would like to use and Click on the "next" button.

Language page

It will take you to the "Environment check" page. It will ensure that your system has all the prerequisites for Moodle or not. Click on the "continue" button.

Environment Check Page

It will take you to the "Database settings" page. Enter the following details.

Click on the "continue" button.

Database settings page

It will take you to the "Webserver settings" page. Keep default values and Click on the "continue" button.

WebServer Settings Page

Now, it will ask you for configuration of the "Data Dir" the moodle data file. keep default and click on the "Continue" button

Site Data Directory Page

It will take you to the "Administration Options" page. Here, you can create an administrator account. Enter the required details and click on the "Update profile" button.

Administration Options Page

Conclusion

Moodle has been successfully installed on your POP! OS Latest. You can now start creating courses and adding users to the LMS platform.

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!

Alternatively, for the best virtual desktop, try Shells!