Moodle Installation Print

  • 0

Installing Moodle on a Linux VPS

Moodle is a popular open-source Learning Management System (LMS) that allows you to create online courses, deliver learning materials, and manage student interactions. This guide will walk you through installing Moodle on a Linux VPS.

Prerequisites:

  • A Linux VPS with a recent Ubuntu or Debian distribution (other distributions may require adjustments)
  • Root or sudo privileges
  • Web server (Apache or Nginx recommended)
  • MySQL database server
  • PHP and required extensions

Installation Steps:

1. Update System Packages:

Bash
sudo apt update  # For Ubuntu/Debian based systems

Choose and install your preferred web server:

  • Apache:
Bash
sudo apt install apache2
  • Nginx:
Bash
sudo apt install nginx
Bash
sudo apt install mysql-server

After installation, a security script will prompt you to set a root password for the MySQL database. Choose a strong and secure password. It's also recommended to run the following command to further secure your MySQL installation:

Bash
sudo mysql_secure_installation
Bash
sudo apt install php libapache2-mod-php php-mysql php-xml php-mbstring php-gd php-curl

6. Create a Database for Moodle:

Log in to your MySQL server using the following command (replace [password] with your actual root password):

Bash
sudo mysql -u root -p
SQL
CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER moodle_user@[localhost] IDENTIFIED BY '[strong_password]';
GRANT ALL PRIVILEGES ON moodle.* TO moodle_user@[localhost];
FLUSH PRIVILEGES;

7. Download Moodle Package:

Download the latest stable version of Moodle from the official website: https://download.moodle.org/

8. Extract Downloaded Package:

Use the tar command to extract the downloaded archive:

Bash
tar -xvf moodle-latest.tar.gz

Copy the extracted Moodle files to your web server's document root directory. The location may vary depending on your web server configuration:

  • Apache: /var/www/html
  • Nginx: (refer to your Nginx configuration for the document root location)

10. Configure Apache Virtual Host (Optional):

If you plan to host Moodle on a subdomain or a specific directory, create a virtual host configuration file within Apache's configuration directory (usually /etc/apache2/sites-available). Enable the configuration and restart Apache for changes to take effect.

11. Set File Permissions:

Set ownership and permissions for the Moodle directory and files to ensure proper functionality:

Bash
sudo chown -R www-data:www-data /var/www/html/moodle  # Adjust path if needed
sudo chmod -R 755 /var/www/html/moodle

Open a web browser and navigate to http://your_domain_or_IP/moodle (or use the appropriate URL based on your virtual host configuration). You should see the Moodle installation wizard.

13. Complete Moodle Installation:

Follow the on-screen instructions in the Moodle installation wizard. Provide details like database connection information, site name, administrator account credentials, and other configuration options.

14. Congratulations!

 

You have successfully installed Moodle on your Linux VPS.

 

Was this answer helpful?
« Back