How to Install Moodle on Rocky Linux: The Ultimate Guide for Scalable eLearning

Looking for a rock-solid, enterprise-ready Learning Management System (LMS) without the enterprise price tag? Meet Moodle, Install Moodle on Rocky Linux—the open-source powerhouse duo that’s trusted by universities, corporations, and online academies worldwide.

In this guide, you’ll get:

  • Install Moodle on Rocky Linu Step-by-step (even if you’re new to Linux)
  • Performance-optimized configurations
  • Pro tips for security and maintenance
  • Real-world advice from Moodle deployment experts

Why Moodle + Rocky Linux = eLearning Perfection

What Makes Moodle Special?

Moodle (Modular Object-Oriented Dynamic Learning Environment) isn’t just another LMS—it’s the most widely used open-source learning platform globally. Here’s why:

  • Course Management: Build structured lessons with multimedia, quizzes, and certificates
  • Customizable: 1,500+ plugins for webinars, gamification, and more
  • Scalable: Supports 10 to 100,000+ students
  • Mobile-Ready: iOS/Android apps included
  • Zero Licensing Costs (Yes, completely free!)

Why Rocky Linux?

When CentOS shifted direction, Rocky Linux emerged as the go-to RHEL-compatible alternative for mission-critical systems. Perfect for Moodle because:

  • 10+ Years of Support: No disruptive upgrades
  • Military-Grade Security: SELinux, firewalls, and automatic updates
  • Optimized Stack: Runs PHP/MariaDB faster than Ubuntu in our benchmarks
  • Cloud-Ready: Works flawlessly on AWS, Azure, and bare metal

Hardware Requirements: Don’t Skip This!

Before installation, ensure your server meets these real-world tested specs:

Use CaseCPURAMStorageNotes
Small Academy2 Cores4 GB50 GB~500 concurrent users
University8 Cores16 GB200 GBSSD required for databases
Enterprise16+ Cores32 GB500 GBRAID-10 recommended

Pro Tip:

“Allocate 2GB RAM per 100 active users for smooth performance during exams.”
— Carlos M., EdTech Infrastructure Architect

Install Moodle on Rocky Linux

Step 1: Prepare Your Rocky Linux Server

bash

# Update everything (security patches matter!)
sudo dnf update -y

# Enable EPEL + Remi for latest PHP
sudo dnf install epel-release -y
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

Step 2: Install the LAMP Stack

bash

# Apache (httpd)
sudo dnf install httpd -y
sudo systemctl enable --now httpd

# MariaDB (MySQL-compatible)
sudo dnf install mariadb-server -y
sudo systemctl enable --now mariadb
sudo mysql_secure_installation  # Say YES to all security prompts!

# PHP 8.1 with Moodle extensions
sudo dnf module enable php:remi-8.1 -y
sudo dnf install php php-mysqlnd php-gd php-intl php-xmlrpc php-ldap php-zip php-mbstring -y

Step 3: Moodle Installation (2 Methods)

Option A: Git (Best for Updates)

bash

cd /var/www/html
sudo git clone git://git.moodle.org/moodle.git
cd moodle
sudo git checkout MOODLE_402_STABLE  # Get latest stable version

Option B: Manual Download

bash

wget https://download.moodle.org/download.php/direct/stable402/moodle-latest-402.tgz
tar -zxvf moodle-latest-402.tgz
sudo mv moodle /var/www/html/

Configuration: The Make-or-Break Steps

1. Database Setup

sql

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'moodleadmin'@'localhost' IDENTIFIED BY 'Str0ngP@ssw0rd!';
GRANT ALL PRIVILEGES ON moodle.* TO 'moodleadmin'@'localhost';
FLUSH PRIVILEGES;

2. File Permissions (Critical!)

bash

sudo mkdir /var/www/moodledata
sudo chown -R apache:apache /var/www/html/moodle /var/www/moodledata
sudo chmod -R 755 /var/www/html/moodle
sudo chmod -R 775 /var/www/moodledata  # Allows file uploads

3. Web Installer Final Touches

Access http://your-server-ip in your browser to:

  1. Select language
  2. Verify paths (/var/www/html/moodle and /var/www/moodledata)
  3. Enter database credentials
  4. Create admin account

Gotcha Alert:

“If the installer hangs at 95%, check SELinux contexts with sudo restorecon -Rv /var/www/
— Troubleshooting tip from Moodle forums

Going Live: Security Must-Dos

1. HTTPS with Let’s Encrypt (Free SSL)

bash

sudo dnf install certbot python3-certbot-apache -y
sudo certbot --apache --agree-tos --redirect --hsts --email your@email.com -d yourdomain.com

2. Firewall Rules

bash

sudo firewall-cmd --permanent --add-service={http,https}
sudo firewall-cmd --reload

3. Automated Backups (Sleep Easy at Night)

bash

# Daily database dump
0 3 * * * mysqldump -u root -pYourPassword moodle > /backups/moodle-$(date +\%Y\%m\%d).sql

# Weekly full backup
0 2 * * 0 tar -czf /backups/moodle-full-$(date +\%Y\%m\%d).tar.gz /var/www/html/moodle /var/www/moodledata

Maintenance Pro Tips

🔸 Updates:

bash

cd /var/www/html/moodle
sudo git pull  # If using Git
sudo php admin/cli/upgrade.php

🔸 Monitoring:

bash

# Check PHP performance
sudo dnf install htop -y
htop

# Moodle cron health
sudo -u apache /usr/bin/php /var/www/html/moodle/admin/cli/cron.php

Conclusion and Final Thoughts

Installing Moodle on Rocky Linux is one of the smartest choices for deploying a secure, fast, and scalable LMS. You get the power and flexibility of Moodle paired with the enterprise-grade reliability of Rocky Linux—a winning combo for educational institutions, businesses, and online academies.

FAQs

1. Is Moodle compatible with Rocky Linux 9?

Yes, Moodle works on Rocky Linux 9, but be sure to check PHP and MariaDB version compatibility with the Moodle version you’re installing.

2. How can I enable HTTPS for my Moodle site?

Use Certbot with Apache:

bash
sudo certbot --apache

It configures SSL automatically and renews certificates.

3. What are the minimum PHP extensions required for Moodle?

At a minimum: intl, mbstring, soap, xml, curl, gd, zip, mysqli. Moodle will notify you of any missing dependencies during setup.

4. How can I upgrade Moodle on Rocky Linux?

If you installed via Git:

bash
cd /var/www/html/moodle
sudo git pull origin MOODLE_xxx_STABLE

Then finish the upgrade in your browser.

5. Is Rocky Linux better than Ubuntu for Moodle?

Rocky Linux offers enterprise-grade stability and longer support cycles—ideal for schools and production environments. Ubuntu is more beginner-friendly but less conservative with updates.