image header Moodle Install and Setup Guide Part1

Guides & Research

The Moodle™ Setup and Installation Guide

March 10, 2023 | Moodle™ Setup & Installation Guide [UPDATED AUGUST 2025]

Moodle Install Guide
The complete resource for setting up your Moodle LMS

Free setup guide

How to set up Moodle? Here's the guide to get you started.

Moodle™ Setup & Installation Guide- UPDATED AUGUST 2025

 

Still struggling with your LMS? Let's talk about how we can make your life easier with one of our experts.

Here's an updated and fully rewritten version of Lambda Solutions' Moodle™ Installation & Setup Guide (originally published March 10, 2023) — now refreshed for mid‑2025 with modern best practices and enriched with internal cross‑links to Lambda’s relevant guides.


Moodle™ Setup & Installation Guide (Lambda Solutions — 2025 Edition)

Part 1: Planning & System Requirements

Planning System Capacity
Ensure adequate hardware depending on expected users, data volume, and content. For large installations, consult our Managed Moodle Cloud Hosting services.
(See Lambda’s guide: “Managed Moodle Cloud Hosting”) (Lambda Solutions)


Software Requirements

    • PHP 8.1+ (extensions: intl, mbstring, XML, cURL, zip, soap, gd, ldap)

    • MySQL/MariaDB (utf8mb4), PostgreSQL 14+, or MS SQL Server supported

    • Apache 2.4+ or Nginx recommended for production
      (Moodle docs 2025 requirements) (Moodle Docs)


Part 2: Server & Environment Setup

  • Set up on a supported OS (e.g., Ubuntu 24.04 LTS or AlmaLinux 9). Include firewall, SSL (Let’s Encrypt), and basic OS hardening.

  • Install and configure database, web server, and PHP with tuned parameters.


Part 3: Download Moodle & Prepare Files

  • Download the Moodle 5.x LTS version (e.g., 5.0 or newer) from [moodle.org] or via Git:

    git clone -b MOODLE_500_STABLE git://git.moodle.org/moodle.git

    (Recommended for easier upgrades) (Moodle Docs)

  • Place Moodle code outside webroot and set permissions:

    chown -R root /path/to/moodle
    chmod -R 0755 /path/to/moodle

Part 4: Moodle Data Directory

  • Create a moodledata directory outside webroot and writable by the web server user only.

  • Restrict access (e.g., via .htaccess if necessary).
    (Critical security requirement) (Moodle Docs)


Part 5: Database Setup

  • Create dedicated database and user (no privileged account usage). Take note of hostname, DB name, credentials, and collation settings.

  • Supported: MySQL/MariaDB (utf8mb4), PostgreSQL 14+, or MS SQL. (Moodle Docs)


Part 6: Run the Installer

  • Command-line installer is preferred for production setups:

    cd /path/to/moodle/admin/cli
    sudo -u www-data php install.php

    Then lock code directory again.

  • Web installer is an option; ensure installation pages are not publicly accessible during setup. (Moodle Docs)


Part 7: Cron & Post‑Install Configuration

  • Schedule Moodle cron to run every minute (*/1 * * * * php /path/to/moodle/admin/cli/cron.php) to ensure background tasks complete reliably.

  • Finalize admin account creation, site name, timezone, and default preferences.


Part 8: Configure Email via SMTP

  • Set up SMTP using trusted relay services (e.g. SendGrid, SendLayer) to ensure deliverability for activation and notification emails.

  • Walk through SMTP configuration in Moodle Admin → Server → Email settings.
    (See Lambda’s post: “How To Install and Configure Moodle™”) (Moodle Docs, Scribd, sendlayer.com, Lambda Solutions)


Part 9: Security & Performance Optimization

  • Enforce HTTPS, enable SSL, and disable unnecessary PHP features.

  • Implement caching with Redis or Memcached for sessions and performance, plus PHP OPcache.

  • Regularly apply system and Moodle updates.
    (See MoodleDocs performance recommendations) (Moodle Docs)


Part 10: Backups & Disaster Recovery

  • Automate backups of:

    • moodledata

    • Moodle code directory

    • Database

    • config.php

  • Store backups off‑site and across geographies for redundancy.


Part 11: Post‑Installation — Users, Courses & Plugins

  • Upload users via CSV or connect with authentication methods (LDAP, SSO, email invites).

  • Install and manage plugins/themes via Moodle Plugins Directory.

  • Create and enroll users into courses manually, via self-registration, or bulk import.
    (Detailed in Lambda’s Part 2 & 3 guides) (Lambda Solutions, 452853.fs1.hubspotusercontent-na1.net, Scribd)


Part 12: Upgrading Moodle (Version Path & Plugins)

  • Use Git branch switching (e.g. MOODLE_500_STABLE) or Moodle’s built‑in upgrader.

  • Review plugin compatibility and apply security patches.
    (Moodle upgrading best practices) (Moodle Docs)


Part 13: Advanced: Developer Setup with Docker or Cloud

  • For development/test environments, enable Moodle Developer Mode and use Docker or Moodle Development Kit (MDK).

  • Consider deployment via containers in AWS using ECS/Fargate with shared EFS storage and Redis caching for production scalability.
    (See AWS + Moodle serverless tutorial) (Amazon Web Services, Inc.)

 Internal Lambda Links

  • Managed Moodle Cloud Hosting – auto-handled hosting, backups, scaling (referenced in System Capacity & Backups).

  • How to Install Moodle™ (blog post, Sept 2023) – detailed email & SMTP setup → linked in Email config. (Lambda Solutions)

  • Part 2 & Part 3 Guides in Lambda’s Moodle Setup series (uploading users & creating courses/quizzes) → linked in Post‑installation section. (Lambda Solutions)


2025‑Compliant Summary Table

Phase Key Actions (Updated for 2025)
Planning & Requirements Moodle 5.x LTS, PHP 8.1+, PostgreSQL 14+, Nginx preferred
Server Setup Harden OS, install LEMP/LAMP stack, enforce SSL
Download & File Setup Git-based download, secure permissions
Data Directory moodledata outside webroot, restricted access
DB Setup Dedicated user, proper collation
Installation CLI installer preferred; Web UI option
Cron & Config Cron job every minute; final UI setup
Email Configuration SMTP via trusted providers; ensure deliverability
Security & Performance HTTPS, Redis/Memcached, OPcache
Backups Full automated backups of DB, code, data directory
Post‑Install Management Bulk CSV user import, plugin & theme management, course setup
Upgrades & Plugin Audit Git branches or upgrade wizard; plugin compatibility checks
Advanced Deployment Docker/MDK for dev; AWS container orchestration for large-scale setups

 

Part 14: How to Add and Upload User Accounts to Moodle

Add a Single User

  1. Go to Site Administration > Users > Accounts > Add a new user.

  2. Fill out required fields (username, password, email, etc.).

  3. Click Create user.

Upload Multiple Users via CSV

  1. Go to Site Administration > Users > Accounts > Upload users.

  2. Upload a CSV file formatted like:

    username,password,firstname,lastname,email
    jsmith,Passw0rd1,John,Smith,jsmith@example.com
  3. Configure upload settings (password policy, update existing users, etc.).

  4. Click Upload users and confirm.


Part 15: How to Set Up a Moodle Course

  1. Go to Site Administration > Courses > Add a new course.

  2. Enter course full name, short name, and category.

  3. Set course format (e.g., topics or weekly).

  4. Configure start date, course summary, and appearance.

  5. Click Save and display.


Part 16: How to Enroll Students into a Moodle Course

Manual Enrollment

  1. Go to the course > Participants > Enroll users.

  2. Select users from the list.

  3. Assign role (typically Student).

  4. Click Enroll users.

Bulk Enrollment via CSV

  1. Prepare a CSV with the following format:

    username,course1,role1
    jsmith,course101,student
  2. Go to Site Administration > Users > Upload users.

  3. Upload CSV and set default role.

  4. Process upload and review confirmation.


Part 17: How to Create a Moodle Quiz

  1. Go to the course > Turn editing on.

  2. Click Add an activity or resource and select Quiz.

  3. Enter the quiz name and description.

  4. Set timing, attempt limits, grading, and layout.

  5. Click Save and display.

  6. Click Edit quiz > Add > + a new question.

  7. Choose question type (e.g., multiple choice, true/false).

  8. Enter question content, answers, and feedback.

  9. Click Save changes. Repeat to add more questions.


 

For ongoing support, visit Lambda Learning or explore our Moodle Training & Hosting Services.

Book A LMS DemoOther resources:

If you want to review what is Moodle and its extensive features, you can check out the following Moodle user guides:

See What Your LMS Could Look Like with the Lambda Suite--Integrated eLearning Revenue Solution!

Book A Demo
Stay Current on Everything LMS

Sign Up for Our Newsletter Today!