Would you like to learn how to install Moodle on a computer running Ubuntu Linux? In this tutorial, we are going to install and configure Moodle using the Nginx server on a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Nginx 1.18.0
• Moodle 3.9.1

Moodle Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Moodle.

Tutorial Nginx – Moodle installation

Install the Nginx web server and a list of required packages.

Copy to Clipboard

Install the MySQL database service.

Copy to Clipboard

Install the PHP package.

Copy to Clipboard

Install other PHP modules.

Copy to Clipboard

Find the location of the PHP configuration file on your system.

Edit the configuration file named: PHP.INI.

Copy to Clipboard

Your PHP version may not be the same as ours.

Your PHP configuration file location may not be the same as ours.

Enable and configure the following items of the PHP configuration file.

Copy to Clipboard

Set the correct timezone to your location.

Edit the configuration file named: WWW.CONF.

Copy to Clipboard

Enable and configure the following item.

Copy to Clipboard

Edit the Nginx configuration file for the default website.

Copy to Clipboard

Enable the PHP support for Nginx.

Here is the original file, before our configuration.

Copy to Clipboard

Here is the new file with our configuration.

Copy to Clipboard

Verify if your Nginx configuration file has no error.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Restart the PHP service.

Copy to Clipboard

Restart the Nginx service.

Copy to Clipboard

Download and install the Moodle application.

Copy to Clipboard

Create a required directory named moodledata.

Copy to Clipboard

You have finished the Nginx service installation with PHP support.

Tutorial Moodle – Database Configuration

Access the MySQL service command-line.

Copy to Clipboard

Create a database named moodle.

Copy to Clipboard

Create a MySQl user named moodle.

Copy to Clipboard

In our example, the password kamisma123 was set to the MySQl user named moodle.

Give the MySQL user named moodle permission over the database named moodle.

Copy to Clipboard

You have finished the moodle database installation.

Tutorial – Moodle Web Installer

Open your browser and enter the IP address of your web server plus /moodle.

In our example, the following URL was entered in the Browser:

• http://192.168.0.10/moodle

The Moodle web installation interface should be presented.

Select the desired language and click on the Next button.

moodle install language

Check the moodle installation URL, directory, data directory and click on the Next button.

moodle installation path

Select the Improved MySQL (native/mysqli) and click on the Next button,

Enter the Database information required to connect to the Moodle database.

• Database host: localhost
• Database name: moodle
• Database password: kamisama123
• Tables prefix: mdl_

moodle installation database configuration

On the next screen, read the license agreement and click on the the Next button.

moodle installation license agreement

Make sure all PHP requirements are met and click on the Continue button.

moodle php requirements

Wait the moodle installation to finish and click on the Continue button.

moodle installation ubuntu

On the next screen, perform the following configuration:

• Username – Enter the administrative user account name desired
• Choose an authentication method – default
• New password – Enter the administrative user password
• First name – The administrator’s Name
• Surname – The administrator’s Surname
• email address – The administrator’s email address
• Select a Country – The administrator’s country
• Timezone – Select the desired timezone

Click on the Update Profile button.

moodle administrator account

Enter a name and a description to your Moodle website.

moodle installation site description

Select the correct timezone, disable the self registration feature and set an outgoing email address.

moodle settings

Click on the Save changes button to access the Moodle dashboard.

moodle dashboard

Congratulations! The Moodle installation was finished successfully.