Moodle on AlmaLinux 9 – Scalable E-Learning on a Secure Enterprise Linux Foundation

Moodle (Modular Object-Oriented Dynamic Learning Environment) is a powerful, open-source learning management system (LMS) used by educational institutions, corporations, and training providers worldwide. When deployed on AlmaLinux 9, Moodle benefits from an enterprise-grade operating system that offers long-term support, binary compatibility with RHEL 9, and a hardened server environment suitable for production-grade e-learning platforms.


Why Use AlmaLinux 9 for Moodle?

AlmaLinux 9 is a natural fit for Moodle in enterprise and educational settings due to:

  • Binary compatibility with Red Hat Enterprise Linux (RHEL) 9, ensuring stability and supportability
  • Long-term support (until 2032), ideal for academic or training environments with multi-year plans
  • Linux Kernel 5.14, which supports modern hardware and virtualization
  • SELinux (enforcing) and system hardening tools to enhance LMS security
  • Systemd and DNF package management, streamlining service orchestration and dependency resolution
  • EPEL and Remi repositories, providing up-to-date PHP and database packages required by Moodle

These features make AlmaLinux 9 highly suitable for deploying secure, performant, and scalable Moodle environments.


Moodle Architecture on AlmaLinux 9

Moodle uses a traditional web application stack (LAMP or LEMP), which maps efficiently onto AlmaLinux 9:

  • Web Server: Apache HTTPD or NGINX, both available in AlmaLinux repositories
  • PHP Runtime: Moodle supports PHP 8.0–8.2; Remi repository provides compatible versions with extensions
  • Database Backend: PostgreSQL or MariaDB (recommended); Moodle requires transactional support
  • Moodle Application: PHP-based modular framework with theming, plugins, and API capabilities
  • File Storage: Local disk, NFS, or object storage (e.g., S3-compatible) for course materials and user uploads

Moodle’s modularity allows easy customization and expansion through hundreds of plugins for attendance, grading, analytics, and communication.


Key Features of Moodle on AlmaLinux 9

FeatureDescription
Course ManagementCreation and organization of classes, modules, assignments, quizzes
User Roles & AccessFine-grained control over student, teacher, and admin permissions
Mobile-FriendlyResponsive UI and support for Moodle mobile app
Plugin EcosystemExtendable with over 1,700 community-contributed plugins
Scalable DeploymentSupports clustered deployments and external storage/database separation
Multilingual Support100+ languages with built-in language packs
RESTful APIs & LTIIntegration with external systems like SIS, CRM, CMS, or external LMSs
Reporting and LogsBuilt-in analytics, audit trails, and SCORM/xAPI tracking

Use Cases and Industry Applications

Moodle on AlmaLinux 9 is ideal for:

  • Universities and schools seeking a customizable, open-source LMS
  • Corporate training departments implementing employee upskilling platforms
  • Certification organizations needing secure exam and grading workflows
  • Non-profits and NGOs providing global education access at low cost
  • Government agencies delivering internal training and compliance programs

Moodle’s flexibility and extensive REST/webhook support also make it viable for integration into complex educational technology ecosystems.


Performance and Scalability

Moodle can be scaled vertically or horizontally, and AlmaLinux 9 supports key performance techniques:

Optimization AreaDetails
Opcode CachingUse PHP OPcache for faster script execution
Database TuningOptimize PostgreSQL/MariaDB buffer pool, slow query log, indexes
Object CachingIntegrate Redis or Memcached for session and application caching
Static File OffloadingServe static files via NGINX or CDN
Load BalancingUse HAProxy or NGINX in front of multiple Moodle web nodes

Rocky Linux 9’s predictable performance and compatibility with cloud-native tools allow Moodle to operate efficiently in both on-prem and hybrid deployments.


Security Considerations

AlmaLinux 9 provides a hardened base for Moodle, supporting:

Security FeatureRelevance to Moodle
SELinuxEnforces least-privilege access control for web and PHP services
HTTPSMoodle requires TLS for login and API security
FirewallDControl access to HTTP(S), DB, Redis, and SMTP ports
Fail2BanProtect against brute-force login attempts
Auditd / OpenSCAPMonitor file/system changes, validate against compliance profiles
Secure PHP settingsdisable_functions, expose_php, and session.cookie_secure hardening

With strong OS-level defenses, Moodle on AlmaLinux 9 can meet data protection requirements in education and healthcare sectors (e.g., FERPA, GDPR, HIPAA).


Comparison with Other LMS Platforms

FeatureMoodleCanvas LMSBlackboardGoogle Classroom
Open-source✅ YesPartially (core only)❌ Proprietary❌ Proprietary
Self-hostable✅ Full control✅ (Limited via Docker)❌ Hosted only❌ Hosted only
Plugin Ecosystem1,700+LimitedLimitedVery limited
SCORM/xAPI Compliance✅ Full❌ Partial✅ Yes❌ No
Mobile Support✅ Native apps✅✅✅
Enterprise Readiness✅ Proven✅ Growing✅ Legacy dominant❌ Classroom-focused

Moodle provides the greatest flexibility and ownership, especially for institutions that need control over data, features, and deployment models.


Running Moodle on AlmaLinux 9 delivers a secure, stable, and scalable learning management system well-suited for institutional and corporate learning. With RHEL compatibility, extended support, and integration flexibility, this stack enables complete control over content, performance, and privacy—while benefiting from a global open-source community and ecosystem.


Step 1: Set Up a Server Instance on Shape.Host

Before starting, you need a clean AlmaLinux 9 VPS. Shape.Host offers flexible cloud VPS hosting that is ideal for deploying educational platforms like Moodle.

Create a VPS:

Go to https://shape.host and log in.

Click “Create” from the dashboard.

Choose “Instance” as your resource type.

Select a server location (data center) near your audience (e.g., Germany, Netherlands, or USA).

Choose AlmaLinux 9 (64-bit) as the operating system.

Pick a plan with at least 2 CPUs, 4 GB RAM, and 20 GB SSD.

Click “Create Instance” and wait for it to provision.

Copy the IP address from the Resources section.

Connect via SSH

On Linux/macOS:

ssh root@your_server_ip

On Windows (with PuTTY):

  1. Download PuTTY.
  2. Enter your instance’s IP in the Host Name field.
  3. Use port 22, select SSH, then click Open and log in as root.

Step 2: Install Apache, MariaDB, PHP, and Required Extensions

1. Update system packages:

dnf update
Terminal showing dnf update package changes on AlmaLinux 9.

2. Enable EPEL repository:

dnf install epel-release
Terminal showing DNF/YUM package management commands and output.

3. Install required software:

dnf install httpd mariadb-server php php-mysqlnd php-gd php-xml php-mbstring php-intl \
php-soap php-zip php-json php-ctype php-curl php-opcache php-iconv php-fileinfo \
php-exif php-pdo php-tokenizer php-bcmath php-sodium php-pecl-apcu unzip wget git
Terminal showing DNF/YUM package management commands and output.

4. Enable and start Apache and MariaDB:

systemctl enable --now httpd mariadb
Terminal showing systemd service management commands or output.

Step 3: Configure Firewall

1. Start and enable the firewall:

systemctl unmask firewalld
systemctl enable firewalld
systemctl start firewalld
Terminal showing systemd service management commands or output.

2. Open required ports:

firewall-cmd --permanent --add-service=http
firewall-cmd --permanent --add-service=https
firewall-cmd --reload
Terminal showing firewall configuration commands and rules.

Step 4: Configure the Database for Moodle

1. Secure MariaDB:

mysql_secure_installation
Terminal showing mysql commands or output during Secure MariaDB:.

2. Log in to MariaDB:

mysql -u root -p

Inside MariaDB, create the database and user:

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER moodleuser@localhost IDENTIFIED BY 'StrongPassword';
GRANT ALL PRIVILEGES ON moodle.* TO moodleuser@localhost;
FLUSH PRIVILEGES;
EXIT;
Terminal showing SQL database and user configuration commands.

Step 5: Download and Set Up Moodle

1. Navigate to web root:

cd /var/www/

2. Clone the Moodle stable branch:

git clone -b MOODLE_403_STABLE git://git.moodle.org/moodle.git
Terminal showing Git repository cloning output.

3. Set permissions:

chown -R apache:apache moodle
chmod -R 755 moodle

4. Create Moodle data directory:

mkdir /var/www/moodledata
chown -R apache:apache /var/www/moodledata
chmod -R 755 /var/www/moodledata
Terminal showing file ownership or permission commands.

Step 6: Create Apache Virtual Host

Create a config file for Moodle:

nano /etc/httpd/conf.d/moodle.conf

Paste the following:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/moodle
    ServerName your-domain.com

    <Directory /var/www/moodle>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/moodle_error.log
    CustomLog /var/log/httpd/moodle_access.log combined
</VirtualHost>
Terminal showing web server configuration text.

Step 7: Adjust PHP Settings

Edit the PHP configuration:

nano /etc/php.ini

Update these values as needed for Moodle (minimum requirement):

max_input_vars = 5000

Step 8: Restart Apache

systemctl restart httpd
Terminal showing systemd service management commands or output.

Step 9: Complete Moodle Installation via Web Interface

Visit:

http://your-server-ip/

Then follow the web installer:

Sure! Here’s a complete and concise guide based on all your uploaded Moodle web installation screenshots:


Moodle Web Installation Guide

This guide walks you through the full Moodle web installer, from language selection to admin dashboard access.


1. Choose Installation Language

Select the default language for the installation and site interface.
➡️ Click Next

Moodle setup interface.

2. Confirm Paths

  • Web address: Auto-filled (can be adjusted if needed)
  • Moodle directory: Location of Moodle core files (e.g. /var/www/moodle)
  • Data directory: Must be writable and not web-accessible (e.g. /var/www/moodledata)
    ➡️ Click Next
Moodle setup interface.

3. Select Database Driver

Choose your database type. For MariaDB or MySQL, use:

  • MariaDB (native/mariadb)
    ➡️ Click Next
Moodle setup interface.

4. Database Settings

Fill in database connection details:

  • Host: localhost
  • Name: moodle
  • User: moodleuser
  • Password: your password
  • Optional: table prefix (mdl_)
    ➡️ Click Next
Moodle database connection settings.

5. Accept License

Review the GNU GPL v3 license terms.
➡️ Click Continue

Moodle setup interface.

6. Server Environment Check

Moodle checks PHP version, extensions, and database.

  • ✅ All requirements should be OK
  • ⚠️ https warning is optional (you can fix later)
    ➡️ Click Continue
Moodle setup interface.

7. Install Plugins

Moodle installs core plugins, including authentication factors.

  • All should complete with Success
    ➡️ Click Continue
Moodle setup interface.

8. Create Admin Account

Set up the main administrator account:

  • Username, password, name, email, timezone, etc.
  • Password must be strong (uppercase, lowercase, digit, special character)
    ➡️ Click Update profile
Moodle administrator account setup form.

9. Site Configuration

Fill in initial site details:

  • Site name & short name
  • Time zone & registration options
  • Support contact email
    ➡️ Click Save changes
Moodle site configuration form.

10. Site Registration (Optional)

Choose whether to register with moodle.org:

  • Fill out name, language, email, and country
  • Agree to the privacy terms
    ➡️ Click Register your site or Skip
Moodle site registration form.

11. Registration Confirmation

You’ll see a message:

“Site registration confirmed.”
➡️ Click Continue

Moodle site registration confirmation.

12. Admin Dashboard

Welcome to your Moodle dashboard!

  • View your calendar, timeline, and site navigation
  • Ready to create courses, manage users, and configure your platform
Moodle dashboard with a calendar and course area.

You’ve successfully installed Moodle on AlmaLinux 9, with Apache, MariaDB, and PHP. This setup provides a robust and scalable learning platform.

Deploy your e-learning solution confidently with Shape.Host Cloud VPS—performance-driven hosting built for education and enterprise.

Start now at https://shape.host.