How to Install Moodle with Nginx on Ubuntu 18.04

How to Install Moodle with Nginx on Ubuntu 18.04

I have written about how to install Moodle on Ubuntu 18.04 on which web server which is used is the Apache web server. This time Moodle is installed on the Nginx web server.

1.Install Nginx

Update Ubuntu then install Nginx

2.Install MariaDB

Install MariaDB database

Secure the MariaDB installation

Answer the question

Configure MariaDB

Add a configuration under [mysqld]

MariaDB configuration
MariaDB configuration

Restart MariaDB

Log in to MariaDB

Create a database for Moodle

Create database
Create database

3.Install PHP-FPM

Install PHP-FPM and its modules

Configure php.ini

Change the configuration options below

Restart PHP-FPM

4.Download Moodle

Download Moodle v3.8

Create a folder for Moodle

Configure the Nginx server block for moodle.defnex.com

Enter the configuration below

Test and restart Nginx

5.Install SSL Let’s Encrypt

Install the certbot repository

Install certbot for Nginx

SSL request for the subdomain moodle.defnex.com

Enter email address

Agree ToS

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

An SSL certificate is created, modifies and adds virtual host configurations for SSL.

Then select 2 to redirect HTTP to HTTPS.

SSL installation for moodle.defnex.com complete

The SSL certificate is only valid for 90 days, command for renewing the SSL certificate

6.Install Moodle

Browse https://moodle.defnex.com

Language selection, Next

Choose a language
Choose a language

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

Confirm paths
Confirm paths

Database driver, Type select MariaDB (native / mariadb)

Choose database driver
Choose database driver

Enter the database name, database user, and database password

Database settings
Database settings

Confirm 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 🙂

Leave a Reply