Bobcares

Setting Up Moodle on Ubuntu: A Tutorial

by | May 23, 2024

Learn how to set up Moodle on Ubuntu. Our Moodle Support team is here to help you with your questions and concerns.

Setting Up Moodle on Ubuntu: A Tutorial

Moodle is a popular open-source LMS. It is widely used by educational institutions, training organizations, and individual instructors.

Setting Up Moodle on Ubuntu: A Tutorial

Our experts have put together these steps to help you set up Moodle on a VPS server running Ubuntu.

Pre-requisites for Installing Moodle

  • Make sure you have a VPS server running Ubuntu.
  • Get a fully-qualified domain name pointing to your server’s IP address.

Step-by-step Guide

  1. First, connect to the server via SSH and update system packages:

    sudo apt update && apt upgrade -y

  2. Then, install Apache web server, MySQL client and server, and PHP 7.4 along with the required modules:

    sudo apt install apache2 mysql-client mysql-server php7.4 libapache2-mod-php

  3. After that, install additional software and PHP libraries needed for Moodle:

    sudo apt install graphviz aspell ghostscript clamav php7.4-pspell php7.4-curl php7.4-gd php7.4-intl php7.4-mbstring php7.4-xml php7.4-xmlrpc php7.4-zip

  4. Now, restart Apache to apply the changes:

    sudo service apache2 restart

    We can check the status of Apache with this command:

    sudo systemctl status apache2

  5. Then, go to the /opt directory and clone the Moodle repository:

    cd /opt
    sudo git clone git://git.moodle.org/moodle.git

  6. Next, go to the Moodle directory, list the available branches, and check out the desired branch:

    cd moodle
    sudo git branch -a
    sudo git branch --track MOODLE_39_STABLE origin/MOODLE_39_STABLE
    sudo git checkout MOODLE_39_STABLE

  7. Then, copy the Moodle directory to the Apache document root:

    sudo cp -R /opt/moodle /var/www/html/

  8. After that, create and set permissions for the Moodle data directory:

    sudo mkdir /var/moodledata
    sudo chown -R www-data /var/moodledata
    sudo chmod -R 777 /var/moodledata
    sudo chmod -R 0755 /var/www/html/moodle

  9. Now, open the MySQL configuration file and add these lines:

    default_storage_engine = innodb
    innodb_file_per_table = 1
    innodb_file_format = Barracuda

  10. Next, save the file and restart MySQL.
  11. Now, connect to MySQL and create the Moodle database:

    mysql -u root -p
    CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
    CREATE USER 'moodleuser'@'localhost' IDENTIFIED BY 'yourpassword';
    GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO 'moodleuser'@'localhost';
    quit

  12. Then, set permissions for the Moodle directory:

    sudo chmod -R 777 /var/www/html/moodle

  13. Finally, restart Apache.
  14. Open the web browser and go to the server’s IP address followed by `/moodle/install.php`. For example:

    http://our-server-ip/moodle/install.php

  15. then, complete the setup by following the instructions in the web installer.
  16. After installation, log in to the Moodle admin panel to customize settings, manage courses, and oversee user accounts.

With these steps, we will have Moodle up and running on our Ubuntu server in no time.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In brief, our Support Experts demonstrated how to set up Moodle on Ubuntu.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF