Multi-tenancy with Moodle course categories and roles

Categories, category-level roles, cohorts and category enrolment can separate departments or client groups in one standard Moodle, but they do not give separate branding or hard data isolation.

On this page

Multi-tenancy with Moodle course categories and roles: when it is enough

If one Moodle site must serve several departments or client groups and you need to limit who sees and manages what, a standard Moodle can often do this without extra software. Course categories, category-level roles, cohorts and category enrolment together separate administration and course access. Moodle's core platform is licensed under GPL-3.0 and can be self-hosted, so these controls live in your own infrastructure. This approach suits organisations whose groups share one identity source, one set of policies and a common look, and whose main need is delegating routine work such as enrolling learners, managing courses and viewing reports within a defined area.

The building blocks work together. A course category groups courses for one department or client group. Category-level role assignments, such as a course creator or manager assigned in a category context, give local staff rights that stop at that category's boundary. Cohorts hold learners as a group that can be enrolled into courses in bulk, and category enrolment lets a user with rights in a category manage its enrolments. Your team should map each group to categories, decide which roles each local manager needs, and test that a manager in one category cannot see or change another. Confirm in your Moodle version how each role and capability is scoped, because capability settings differ across releases.

This approach has hard limits you should decide on before building. Categories do not give per-tenant branding, since the theme, logo and site-wide settings are shared across the whole site. Data separation is also logical rather than strict: site administrators can see all users and courses, and some reports and course listings cross category boundaries. If a client contract requires separate branding, isolated data or independent administration, a single shared site is not enough, and you should compare separate sites or a multi-tenant distribution. The Moodle releases page is the place to check which release you run before you finalise those comparisons.

Configuration options and when each fits

This table compares the core Moodle options for separating departments or client groups inside one site: category structure, category-level roles, cohorts, category enrolment and custom roles. Read each row for what it does well and what it cannot do, since most limits come from data separation and branding rather than from set-up effort. The main takeaway is that these options organize and delegate access within one shared site, so they fit internal separation far better than separate client branding or strict data isolation.

OptionWhen it fitsWhat it cannot do
Category structureGrouping courses by department, faculty or client group so that listings, course search and reports follow the same hierarchyDoes not hide one category's courses or users from users with site-wide roles, and does not give each group its own URL or theme
Category-level role assignmentGiving a department manager or trainer editing or management rights over courses in one category only, for example through a category-scoped role assignmentCannot restrict site-level reports, user profiles or the site administration area, so scoped staff may still see users outside their group in some views
Cohort-based enrolmentEnrolling a group of users in many courses at once from a shared list, such as a client cohort or intake year, and keeping membership in sync from another systemCohorts are site-wide objects, so a cohort is visible to anyone who can manage cohorts, and cohorts do not by themselves separate data between groups
Category enrolment methodsApplying enrolment rules to all courses in a category, such as a default enrolment method or a shared list of participants, to reduce per-course set-upEnrolment settings are applied per course instance, so changes to a category's defaults may not reach courses already created, and the method does not isolate content
Custom rolesCreating a local administrator or trainer role with a narrower capability set than the built-in roles, assigned at category levelOnly permissions defined in core and installed plugins are available, and capabilities that operate site-wide cannot be limited to one category
Plugin-dependent scoping (flag)Needed when scoped reports, per-group branding or per-group user administration are required, for example through a plugin for company managementDepends on a third-party plugin that must match your Moodle version and go through your own security review before use

How category, role and cohort layers fit together

The diagram starts at the Moodle site, which holds one category tree shared by every department or client group. Courses sit under categories, and role assignments made at category level flow down to the courses beneath them. Cohorts feed enrolment into courses, so a category manager can reach only the users and courses within their branch. The shared node marks what stays common across all categories: the site theme, the site-wide branding and the single database. Check that no branding or data separation requirement depends on a category boundary, because the layers above do not provide one.

Category, role and cohort layers over one shared Moodle site and database.

Setting up categories, roles and enrolment for each client group

This sequence turns a category tree drawn on paper into a working Moodle layout where each client group has its own space, local managers who can only administer their own part, and enrolment rules that match the contract. It finishes with proof, tested from non-admin accounts, that the separation holds.

  1. Design the category tree on paper

    Before touching the site, the Moodle administrator and the business owner agree on the top-level categories, the subcategories under each client group, and the rule for where shared courses sit. Record each category with its owner, its expected course types and whether any group needs its own enrolment rules. Confirm with each client how far their staff may see other groups' course names and users. The step is done when a signed-off diagram or table exists and every client group maps to one top-level category.

  2. Create categories and subcategories

    In Site administration, create the top-level categories and their subcategories exactly as the diagram shows, using consistent naming and a stable ID scheme so later reports and role assignments stay readable. Keep shared or template courses in a separate category rather than inside a client's branch. Check the tree in the course management page and confirm that each category has the intended parent and visibility. The step is complete when the tree matches the signed-off design with no orphaned or misnamed categories.

  3. Create cohorts for each group

    Create one cohort per client group or team, using the system context or the relevant category context as the cohort's context so that only the right managers can see and edit it. Populate cohorts from a controlled source, such as a CSV upload or a sync from your directory, and record who owns each cohort. Confirm that a cohort member count matches the source list. The step is done when every group has a cohort with a named owner and a verified membership count.

  4. Assign category-level roles to local managers

    For each client group, assign the local manager account a role at the group's category context, such as the category manager role, and keep site-wide roles unchanged. Where the default roles do not fit, a custom role can be created with fewer capabilities, but confirm each capability against your contract and reporting needs first. Record each assignment in your access register. The step is complete when each local manager holds roles only at their own category, and no local account has been granted a site administrator role.

  5. Configure enrolment methods per category

    Set the enrolment methods that each category needs, such as manual enrolment, cohort sync, or self-enrolment with a key, and disable any method a group should not use. Where a course is shared across groups, decide which enrolment method governs it and document that decision. Check the enrolment plugins page and each category's course defaults to confirm that new courses inherit the intended settings. The step is done when each category's enrolment configuration matches the design and the register shows who can add or remove learners.

  6. Test with non-admin accounts

    Create two or more test accounts with the manager roles, one in each client category, and sign in as each one. Confirm that a test manager can see and manage their own category and cannot see a sibling category, its courses, or its cohorts. Confirm that a test learner can enrol only through the methods allowed and cannot reach the course management pages. Log each result and repeat the checks after any change to roles or categories. The step is complete when every test case passes and the results are filed with the access register.

Security and operational risks of shared-site tenancy

A category-based Moodle site puts every tenant on one database, one set of administrators and one upgrade schedule. The risks below share that root, so each one needs a control that limits what a single mistake or compromise can reach. Check each control against your own role design before you accept the category model.

Over-broad roles at the top of the tree

A role assigned in the top-level category or at site level applies to every subcategory beneath it, unless a child context overrides it. A teacher or manager given a role there can view or change content for every client. Review role assignments by context, starting at the top category, and confirm that tenant managers are assigned only in their own category. Use the top-level assignment check as a recurring audit item, not a one-time setup step.

Cross-category reports and gradebooks

Site-level reports, the course list and some grade and log views can show data from several categories to a user whose role spans them. A report built for one client may include learners from another if permissions are wider than intended. Test each report type with a user from one tenant and confirm that no other tenant's courses, users or grades appear. Restrict report builder and custom report access to a small set of trusted administrators.

Shared site administrators see everything

Anyone with site administrator rights can read every category, user record, log and setting, and can change the configuration that all tenants share. This includes the authentication and enrolment settings that decide who can sign in. Limit site administrator accounts to a named, small group, require separate administrator accounts for daily work, and record who holds the role. Ask your team to define how client contract terms on data access are met when staff with this role change.

Backups and restores that cannot be split

Moodle backs up at course and site level, and a full site backup holds every tenant's data in one archive. Restoring one client's courses after an error can mean restoring the whole site or extracting courses by hand, which risks overwriting other tenants' work. Decide how long backups are kept, who can restore, and how a single-client restore is tested in a non-production copy. Ask your hosting team to confirm how the site database and the file store are backed up together so they stay consistent.

Upgrades that touch every tenant

A Moodle upgrade changes the code, database schema and plugins for all categories at the same moment. A plugin that works for one client's course design may break another client's workflow, and a failed upgrade stops every tenant. Before each upgrade, check the minimum starting version and server requirements in the release notes, then test the upgrade on a copy with representative data from each tenant. Schedule a rollback path for the database and file store, and plan the change window with all tenant contacts.

Moodle releases

Shared cron and background tasks

Scheduled tasks, cron jobs and enrolment syncs run once for the whole site. A slow or failing task, such as a large bulk user upload or a cohort sync, can delay or affect every tenant's sessions and reports. Monitor task queues and failure logs, set limits on bulk imports per tenant, and confirm which tasks run at which times. Assign one owner to the task schedule so changes are reviewed before they reach all clients.

Questions to answer before using categories for tenancy

How much effort does a category-based tenancy design take?

Effort depends mainly on how many client groups you run, how different their roles and reporting needs are, and how much of the design is settled before the build starts. A design with a few departments that share one set of courses is far lighter than one where each client has its own role rules, enrolment sources and reporting. Plan time for category tree design, a role matrix mapping each group to the capabilities it needs, cohort and enrolment rules, and testing with real accounts from each group. No public figure is given here, so ask any provider to break its quote into those stages.

Can our own team build a category-based tenancy setup without a partner?

Often yes, if your team already administers Moodle, understands its role system and can test permissions carefully. The risk lies in the details: role assignments at category level can grant more access than intended when inherited through parent categories, and cohort or enrolment rules can expose courses to the wrong group. Before deciding, confirm that at least one person can write and review role overrides, maintain a test account for each group, and document the design so it survives staff changes. A partner adds most value when the design needs review against your contract terms or when the team lacks time for testing.

What do we need to provide for the work to go smoothly?

You need to provide a clear list of client groups or departments, the roles each group needs (for example, a course creator, a reporting viewer or a local enrolment manager), and the rules that decide who belongs to each group. Also provide the source systems for those rules, such as an HR export, a directory or a spreadsheet, and a named owner who can approve the role matrix. Access to a non-production Moodle site for testing is essential. Ask whether the design needs to fit existing contract terms, because those terms often decide whether shared courses and shared reports are acceptable.

How long does the work take as the number of groups and roles grows?

Duration rises with the number of groups, the number of distinct roles and the number of enrolment sources, because each combination needs its own permission test. Adding one more group that reuses existing roles is quick. Adding a new role type or a new data feed means new design decisions, new tests and often a review with the group's administrators. No timeline is given here. Ask for a schedule that lists each group and role as a separate line, with testing time for each, and confirm which items are fixed in the written scope.

Which permission checks should we run before going live?

Test each role from a real account in each group, not only as an administrator. Check that users cannot see courses, participants, grades or reports outside their category, that delegated managers cannot assign roles they should not hold, and that cohort membership does not leak into other categories. Confirm that the site's logs show who changed a role and when. Use the Moodle security report and review capabilities on the role definitions. Repeat these checks after every plugin update or new category, because a change in one place can alter inherited access elsewhere.

When should we move from categories to IOMAD or separate Moodle sites?

Move when categories can no longer keep client data and branding apart to the level your contracts require. Typical triggers include a client that needs its own URL and visual identity, a requirement that its users and reports never appear in a shared database view, separate administration by a client's own staff with broad rights, or billing and licence pools per client. Categories suit shared courses and departmental separation inside one organisation. Compare the options on data separation, branding, upgrade effort and hosting cost in the tenancy model guide, and confirm the contract wording before choosing.

How does category tenancy affect upgrades and plugin maintenance?

Category design lives inside one Moodle site, so every upgrade, plugin update and role change affects all groups at once. Plan a single test cycle that repeats the permission checks for each group after each upgrade. Confirm that every plugin you rely on supports your target Moodle version before scheduling the upgrade. Moodle 5.1 requires PHP 8.2 or later and PostgreSQL 15, MySQL 8.4, MariaDB 10.11 or SQL Server 2017 or later, and sites must be on Moodle 4.2.3 or later to upgrade. Check the release notes for your target version before planning the window.

When categories stop being the right answer

Categories stop being the right answer as soon as a client needs something a category cannot give it: its own look and URL, a contractual guarantee that its learners' data is invisible to other clients, its own licence pool or invoicing trail, or its own administrators who never see the rest of the site. Any one of these is a signal to stop and test the design before courses are built. A single category can hold courses and cohorts, but it does not hold a theme, a login page, a data boundary or a billing record.

Branding and data separation are the two signals that most often force the decision. A category inherits the site theme, so per-client branding usually means a second site or a plugin layer on top of core. Category roles also do not hide users from each other across the site: a user who can see a course can often see its participants, and site-level reports, the logs and the messaging tools span every category. Ask the client's contract and their security review what isolation they are being promised, then check that answer against the roles and report settings you would actually configure, not the ones you intend to configure.

Licensing, reporting and delegated administration are the signals that appear later. Per-client licence pools, per-client reporting back to each buyer, and local administrators who manage hundreds of users tend to outgrow category roles in operation. Confirm with your team which of these the client needs at launch and which will arrive within the contract term. For the next reads, see the sibling pages on IOMAD, on choosing a tenancy model, and on delegated administration in Moodle, which compare these options in more depth.

Checks to run before a client group goes live

This sequence confirms that a category-based tenant only shows each client group its own courses, users and reports, and that the people holding site-level roles are the ones you intended. It ends with a signed-off record the delivery lead and the client can both read.

  1. Build a test user for each role in each category

    Create one test account per role you plan to give in a client category, such as course creator, teacher, non-editing teacher and student, and enrol each one at the category level only. Your team does this in a staging copy of the production configuration, not on the live site. The step is done when every test account is listed with its role under the correct category in the role assignment report.

  2. Test role inheritance from parent categories

    Sign in as each test account and check what it can see and do in the client category, then in a sibling category and in the parent category. Moodle passes category-level role assignments down to child categories and courses, so confirm that no test account can see or edit a course outside its own branch. Record the result in a matrix of role, category, and allowed or denied action.

  3. Check each enrolment method against category boundaries

    Enrol a test user through manual enrolment, cohort sync, and any other method you plan to use, then confirm that the user lands only in courses inside the intended category. Pay attention to cohorts, which are site-wide by default and can be placed in a category context, and confirm that a cohort used by one client cannot add users to another client's courses. Done when each method has a pass or fail entry in the matrix.

  4. Confirm report scoping for category managers

    Sign in as a category-level manager or delegated administrator and open the reports and user lists they can reach, including course completion, logs and participation views. Check that the results contain only users and courses from their category. Where a report exposes users from another category, stop the go-live and record the gap for a decision on report design or access. Note that the exact report permissions depend on your Moodle version, so confirm them against the release notes for the version you run.

  5. Restore one client category from a backup

    Back up one client category, including its courses and enrolments, then restore it to a separate test environment. Confirm that courses, question banks, users and role assignments come back under the expected category and that no content from other categories is included. The step closes when the restored category matches the source for a sample of courses and users, and the team records the backup and restore steps used.

  6. Review holders of site-level roles

    Export the list of users who hold site administrator or other site-context roles, and compare it with the approved list for the project. Remove any role assigned at site level that a client administrator only needs at category level, and check that no client contact has rights to change site settings, plugins or other categories. Done when the reviewed list is signed by the delivery lead and the client's named administrator.

  7. Record the sign-off and the open risks

    Write a short go-live record that lists the test matrix results, the report scoping outcome, the restore test result and the site-level role review. Include any accepted risk, such as data visible through a shared course or a branding limit that category-based design cannot solve, and name the person who accepted it. The client receives a copy, and the record is stored with the configuration documentation for the next upgrade or review.

Hiring help for category-based tenancy

What does outside help for a category-based Moodle tenancy include?

Outside help usually covers the design and build of the category tree, the category-level role assignments, cohort and category enrolment rules, the course templates each group uses, and the handover documentation your administrators need. It can also include testing that a delegated manager sees only their own users and reports, and a written runbook for adding a new group. Work that is often left out of a first quote includes user acceptance testing with each department, a rehearsed upgrade on a copy of the site, and training for the people who will manage categories after go-live. Ask the provider to list each of these as a separate deliverable so you can see what is in and out.

Who pays for what when a partner runs the Moodle build?

You pay for the infrastructure, the Moodle licence cost if you use a managed host, and any paid plugins or subscriptions your scope requires. The partner is paid for the planning, configuration, custom work, testing, documentation and knowledge transfer defined in the written scope. Your own staff still provide decisions on the department structure, the naming of groups, sign-off on the role model and access to the people who will use the system. Confirm in the quote whether hosting, backups, and third-party licences are billed through the partner or bought directly by you, because that affects who holds the contract and who responds to incidents.

Which costs are one-time and which recur after go-live?

One-time costs cover the design of the category model, the initial configuration, migration of existing courses or users, testing and training. Recurring costs cover hosting, storage, backups, monitoring, Moodle minor point releases, plugin updates and the staff time spent on course requests and user changes. Major Moodle releases also recur on a planning cycle because each one needs its own test and upgrade window. A written scope should separate these groups, so the first-year and ongoing figures can be compared with the cost of running the work in-house.

How long does a category-based Moodle setup take to deliver?

Duration depends on the number of groups, the complexity of the role model, how many existing courses need migration, and how quickly your teams confirm decisions. A small pilot with a few departments is much shorter than a rollout across many client groups with different enrolment sources. Timelines should be agreed in writing with each phase, the dates for your sign-off points, and the conditions that would move a date. DeployOpen agrees scope, deliverables and timelines in writing before work starts, so ask for the phase plan and the assumptions behind it.

Does DeployOpen work on fixed-scope agreements or time and materials?

DeployOpen works on fixed-scope engagements in most cases, with the scope, deliverables and timelines agreed in writing before work starts. A written scope makes it clear what is included, what your team must provide, and what changes would need a new agreement. Ongoing support, upgrades and continuous testing are available as retainers, which suit the recurring work after go-live. Ask any provider to state how changes to scope are priced and approved, since category models often grow as new departments or client groups are added.

What should we request in a written scope for category-based tenancy?

Ask for a named list of deliverables, including the category tree, role matrix, cohort and enrolment rules, course templates, and the test cases used to prove that category managers cannot see other groups. Request the upgrade and rollback approach for the Moodle version you will run, the backup and restore test, and the handover documents. The scope should also state the environment where the work happens, who holds administrator access, what your staff must provide and by which date, and how acceptance is signed off. Confirm which Moodle version and database engine are in scope, because these set the supported upgrade path.

Can our own team run a category-based Moodle without outside help?

A team with Moodle administration experience can build a category-based tenancy, especially for a small number of departments with a simple role model. The work is less about the Moodle menus and more about deciding who manages what, how enrolments flow in, and how you prove that data stays separated. Internal teams often underestimate testing, documentation and the upgrade cycle. A useful test is whether your staff can rehearse a Moodle upgrade on a copy of the site and restore a backup within a window you agree in advance. If neither is routine today, outside help for the design and testing stages is worth pricing against your own staff time.

What risks should the scope address before we agree to build?

The main risks are that category managers gain more access than intended, that user data from one group becomes visible to another, and that the category model becomes hard to change once many courses depend on it. The scope should name who signs off on the role matrix, how access reviews happen after go-live, and how you test that a delegated administrator cannot see other groups. For separation that must hold against client contract terms or regulatory requirements, the scope should say whether a separate site is the better answer. Ask the provider to explain where category-level separation stops and what would require a different tenancy model.

How DeployOpen scopes and delivers category-based Moodle tenancy

DeployOpen plans, builds, documents and supports category-based tenancy on a self-hosted Moodle in infrastructure you control. We start with the written scope of your departments or client groups, the roles each local administrator needs, and the branding and data separation limits you must accept. The result is a configured site your compliance and administration teams can review.

How we scope

  • Map each department or client group to a category tree, with the courses, cohorts and enrolment sources it owns.
  • Define which category-level roles each local manager receives and which permissions stay with site administrators.
  • Record branding expectations and confirm in writing where a single theme cannot meet them, so the limit is agreed up front.

How we build

  • Configure categories, custom roles, cohort sync and category enrolment methods to match the agreed tenant design.
  • Test role permissions with named test accounts for each group, including attempts to reach another group's courses and reports.
  • Confirm the Moodle version and server requirements against the release notes before installation, and set the document root to the public directory where the release requires it.

How we hand over

  • Deliver a written configuration record covering categories, roles, cohorts, enrolment sources and the permission test results.
  • Provide an administrator runbook for creating categories, assigning category managers and reviewing their activity.
  • Walk through the handover with the teams who will run the site and record any open items with owners.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after handover, scoped in writing.
  • Retest role boundaries after each Moodle upgrade or plugin change, since permissions can shift between releases.
  • Ask for a quote built from the written scope, and confirm with your hosting team which costs recur, such as hosting and support.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.