How to Install Moodle on Ubuntu 18.04

How to Install Moodle on Ubuntu 18.04

Moodle is a web-based open source software for e-learning or creating online learning classes. Moodle is widely applied in schools and colleges including in Indonesia.

The Moodle project is led by Moodle HQ which is financially supported by more than 80 Moodle partner companies.

Moodle features include:

  • Modern, easy to use interface
  • Personalised Dashboard
  • Collaborative tools and activities
  • All-in-one calendar
  • Convenient file management
  • Simple and intuitive text editor

For a complete list of Moodle features, read here.

0.Software used

The software used in this tutorial is:

  • OS: Ubuntu 18.04
  • Web server: Apache 2.4
  • PHP Engine: PHP v7.2
  • Database: MariaDB 10.1
  • Moodle: Moodle v3.8
  • Subomain: moodle.defnex.com
  • SSL: Let’s Encrypt

1.Install Apache

Update Ubuntu first

Install Apache web server

2.Install PHP

Install PHP

3.Install MariaDB

Install MariaDB database

Answer the question

Configure MariaDB

Add the configuration under [mysqld]

MariaDB configuration
MariaDB configuration

Restart MariaDB

Create a database for Moodle

Create database
Create database

4.Download Moodle

Download Moodle v3.8

Create a folder for Moodle

Configure the virtual host for moodle.defnex.com

Enter the virtual host configuration

Activate virtual host and restart Apache

5.Install SSL Let’s Encrypt

Download certbot-auto

SSL request for the moodle.defnex.com subdomain

Install packages, Do you want to continue? [Y/n], answer y

Enter email address

Agree Terms of Service

Consent to be sent information about Let’s Encrypt, you can answer Y or N.

An SSL certificate was created, changed and added a virtual host configuration for SSL.

Then enter 2 to redirect HTTP to HTTPS.

The SSL install for moodle.defnex.com is complete

The SSL certificate is only valid for 90 days, run the renew command to renew the SSL certificate

6.Install Moodle

Browse http://moodle.defnex.com

Choose a language, Next

Choose a language
Choose a language

Fill Data directory with /var/www/moodle/data

Confirm paths
Confirm paths

Database driver, for Type choose MariaDB (native/mariadb)

Choose database driver
Choose database driver

Enter the database name, database user, and database password

Database settings
Database settings

Confirm the license, Continue

Confirm license
Confirm license

Check the server if the server is ready to install Moodle

Server checks
Server checks

Installation is running

Installation
Installation

Create an administrator account

Administrator account
Administrator account

Enter Full site name, Short name for site and Front page summary

Front page settings
Front page settings

If successful, go directly to the administrator dashboard

Moodle dashboard
Moodle dashboard

Good luck 🙂

Default image
Musa Amin
I am a Linux System Administrator and also write many tutorials about Linux, Cloud, and Open Source. Hire me via email hai[at]musaamin.web.id.

One comment

  1. Works like a charm, thank you so much. Most moodle tutorials don’t include the domain setup tasks, even the official one for Ubuntu 18.04 doesn’t work that well. Thank you.

Leave a Reply