Writing a Tutor plugin for Open edX

A Tutor plugin keeps Open edX configuration, settings patches and services in versioned, installable code instead of hand-edited files. This page explains when to write one, how the hooks API works and what the build involves.

On this page

When a Tutor plugin is the right home for Open edX customizations

If your team runs Open edX on Tutor and keeps reapplying hand-edited configuration files, patched settings or hand-started services after every upgrade, a Tutor plugin is usually the right place to move those changes. A Tutor plugin packages them as versioned code that Tutor reapplies when it builds and deploys the platform, so the customizations live in a repository you can review, test and roll back instead of in files that someone must remember to edit again. Start by listing every change currently made outside Tutor's own configuration: values in the environment configuration, overrides in settings files, extra containers in the compose or Kubernetes setup, and any cron jobs or sidecars. Each item on that list is a candidate for a plugin.

A plugin covers three kinds of work: configuration values Tutor should set, settings patches applied to the LMS or Studio, and services such as an additional container that runs beside the platform. The plugin uses the hooks API to attach these changes at defined points in Tutor's build and configuration process. It does not change the platform's source code, and it does not replace the other two tools in this group. If a change needs new event handling, filters or Django app behavior inside the LMS, the work belongs in a Django app plugin. If it requires modified edx-platform code, the choice moves toward a fork, with the maintenance cost that comes with it. Confirm the hook names and their supported versions against the Tutor documentation for the release you run, since hooks change between Tutor versions.

Tutor is the official Docker-based Open edX distribution for production and local development, and its plugin and hooks system is licensed under Apache 2.0, so plugin code you write can be kept under your own terms. Read the Tutor documentation before you start, and confirm that the Tutor version in use supports the plugin mechanism you intend to use. The practical test is simple: if a change would be lost or silently overwritten on the next upgrade, or if nobody can say who made it, it belongs in a plugin.

Which plugin pattern fits which customization

Configuration values are the simplest pattern. A plugin sets values that Tutor already exposes, such as domain names, image choices and platform options, and Tutor renders them into the deployed environment on every build. The upgrade risk it removes is the most direct: nobody edits generated files on the server, so the values survive a Tutor version change because the plugin reapplies them.

  • What it changes: Tutor configuration keys that the platform already reads, set through the plugin's configuration definition.
  • What it must not touch: Generated environment files, rendered manifests or the edx-platform source tree.
  • Secrets: Keep sensitive values in generated secrets or an external secrets store, not in plugin defaults committed to a public repository.
  • Key stability: Check each key name against the Tutor version you are moving to, because a renamed key may stop taking effect without an obvious error.
  • Scope of change: A configuration value changes the whole deployment, so record which environments it affects.

Before you start, confirm in the Tutor documentation that every setting you need is exposed as a configuration key in your version. If a setting is missing, the work moves to the settings patch pattern.

How to build and test a Tutor plugin step by step

The sequence below takes a plugin from a pinned Tutor and Open edX release to a tested package that survives an upgrade rehearsal, with a check at every stage. Each step ends with evidence that the next one can rely on.

  1. Confirm the target Tutor and Open edX release

    Before writing code, the platform owner and the plugin developer agree on the Open edX release the site runs and the Tutor version that builds it. Open edX supports only the latest named release, so confirm that release against the Open edX release notes and record the Tutor version in the project's requirements. Check the Tutor documentation for the hooks your plugin needs in that version. The step is done when both versions are written in the project's README and a build can be reproduced from them.

  2. Scaffold the Python package and entry point

    Create a Python package with a pyproject.toml that declares the plugin name, its dependencies and the Tutor entry point that Tutor uses to discover plugins. Keep the package in its own repository so it can be versioned, reviewed and pinned separately from the platform. Install it into the same environment as Tutor using pip. The step is done when tutor plugins list shows the plugin as available, and it does not yet show it as enabled.

  3. Define defaults and user-overridable values

    Write a configuration module that sets defaults for every value the plugin controls, and mark each one as either a plain setting or a value that operators may override in the user configuration file. Use a prefix for every key so the plugin's settings do not collide with core Tutor keys. Decide which values are secrets and generate them through Tutor's own mechanisms rather than committing them to the repository. The step is done when tutor config save with the plugin enabled writes the expected keys to config.yml and the secret values are not stored in plain text in the repository.

  4. Add hook patches for settings and services

    Use the Tutor hooks API to add settings patches to the LMS and CMS, extra services or environment changes, rather than editing generated files. Each patch should do one job and target a named hook, so a reviewer can see exactly which part of the platform it changes. Keep Python settings patches small and move logic that needs testing into importable functions. The step is done when every patch is listed in the plugin's documentation with the hook it uses and the reason for it.

  5. Build a local image with the plugin

    Enable the plugin, then rebuild the Open edX images that Tutor uses so the installed code and patches are included. Build locally first, with the same Tutor version the site will run. Record the image tags the build produces. Check the build log for errors from the plugin's patches, since a patch that fails to render often fails silently at runtime. The step is done when the local stack starts and the LMS and Studio respond to requests.

  6. Render and diff the generated configuration

    Render the configuration with the plugin enabled and again with it disabled, then diff the two outputs. The diff should contain only the changes the plugin is meant to make. Review the rendered settings files and the environment values for unexpected keys, ordering problems or secrets written to places they should not reach. Add the render and diff to the test pipeline so future changes are reviewed the same way. The step is done when the diff matches the plugin's documented changes line for line.

  7. Deploy to staging and check behavior

    Deploy the built images to a staging environment in the infrastructure the client controls, using the same configuration values as production will use. Test the behavior the plugin changes, such as a setting taking effect in the LMS or a service responding, and confirm that secrets and overrides come from the environment's own configuration. Record what was tested and the results in the change record. The step is done when the staging checks pass and the results are signed off by the platform owner.

  8. Run the upgrade rehearsal before release

    Before the plugin goes to production, rehearse the upgrade you expect to run next. Upgrade a copy of the staging data to the next Tutor or Open edX release, reapply the plugin, and rerun the render, diff and behavior checks. Note any hook that no longer exists, any setting that has moved, and any migration that needs attention. The step is done when the rehearsal completes with a written list of required changes, and the plugin version that passes is pinned for production.

How a plugin's hooks flow into the rendered Tutor project

The diagram starts with the plugin package your team keeps in version control, which exposes an entry point that Tutor discovers at runtime. Each hook the plugin registers feeds into Tutor's rendering step, which produces the configuration and Dockerfiles that the image build turns into the running LMS, Studio and worker services. The boundary between your code and upstream Tutor and edx-platform code is the line to check: anything you changed by hand in rendered output sits outside the plugin and will be lost on the next render.

Plugin hooks flow through Tutor rendering and image builds into running services.

Design decisions that determine upgrade cost

Most of the upgrade cost of a Tutor plugin is set before the first line of code is written. The decisions below shape how much of the customization survives a new Open edX release and how much must be re-done by hand. Review them with the people who will own the platform after launch, not only the developers who build it.

Keep settings patches minimal

Every settings patch is a point where a future release can silently change behavior. Patch only the keys the platform needs, and prefer documented settings over overriding internal ones. Before you upgrade, list each patch and ask whether a supported option or hook already does the same job. Fewer patches mean fewer surprises when the upgrade reaches the settings layer.

Pin plugin and Tutor versions

An unpinned plugin or Tutor version can change under you during a rebuild, so an image that worked last month may fail today. Pin both the Tutor release and the plugin version in your build inputs, and upgrade them as a deliberate change with its own test run. Ask your partner or internal team who decides when pins move and how that decision is recorded.

Tutor docs

Avoid edits to rendered files

Hand-editing files inside a generated configuration or build output is lost the next time Tutor renders the project. Express each change as a plugin template, patch or hook so the rendering step reproduces it. If a change cannot be expressed that way, treat it as a maintenance item with a named owner rather than a quiet edit on one server.

Separate secrets from config defaults

Defaults in a plugin are committed to source control and shared across environments, so secrets must never live there. Keep credentials in your secrets store and reference them from configuration at deploy time. Check that the plugin's default values contain no keys, passwords or tokens, and that each environment supplies its own.

Keep plugin code small enough to review

A plugin that grows into a second platform is expensive to read, test and carry across releases. Limit each plugin to one purpose, such as a single settings group or one integration, and keep the code small enough that a reviewer can explain every line. Ask for a review of the diff against each new release before it is merged.

Decide who owns the repository

Upgrade cost rises when nobody is responsible for the plugin repository between releases. Decide in writing who reviews changes, who runs the upgrade test, who approves merges and who answers when a build breaks. Whether that is your team, a partner under a retainer or a mix should be settled before the build starts, with access and handover terms recorded.

Which hook type fits each change

This table matches common Open edX changes to the Tutor plugin mechanism that usually carries them, and names the trade-off for each. Read it as a starting point: confirm exact hook names and patch targets in the Tutor documentation before you write code, because they change between releases.

Change typePlugin mechanismWhen it fitsMain trade-off
Configuration valuesPlugin config entries (defaults and user-set values) rendered into the platform configurationSettings that differ per environment, such as domains, feature names or third-party keysValues are visible in the configuration tree, so secrets need a separate handling path
LMS and CMS settings patchesSettings patch hooks that add lines to the LMS or CMS settings files at render timeDjango settings the platform does not expose as a configuration valuePatches depend on the settings file layout, so each upgrade needs a check that they still apply
Environment variablesPlugin-defined variables passed into the relevant containersValues read by application code or by the container at startupVariables are easy to miss during an upgrade, and changes require a restart of affected services
Additional containers or servicesPlugin service definitions that add a container to the Compose or Kubernetes stackA helper such as a sidecar job, a connector or a separate worker the platform needs to runEach service adds images to patch, resources to size and logs to monitor
Django app plugin work for events and filtersA Django app plugin using openedx-events and openedx-filters, with no edits to edx-platformReacting to enrollment or certificate events, or changing a platform behavior at a defined filter pointFilter and event names are tied to release versions, so confirm each one against the target release
Code that must change platform filesUsually no plugin hook; a fork or a patch is neededOnly when no supported hook or app plugin point exists for the behaviorEvery upgrade must carry the change, which raises ongoing maintenance cost

Security risks in plugin code and secrets handling

A Tutor plugin runs with the same reach as the platform it extends, so its code, its configuration defaults and its supply chain all carry security risk. The cards below cover the checks a security team will ask for before a plugin reaches a production image.

Plugin code runs in the build and runtime

A plugin's Python hooks execute while Tutor builds the image and again when the LMS and Studio containers start. Anything the plugin imports or patches inherits the platform's privileges, including database and cache access. Review every hook, every patch and every file the plugin writes, and confirm which process runs each one. Ask whether the plugin needs network access at build time at all.

Pin every dependency

Plugins declare Python packages that Tutor installs into the image, and unpinned ranges let a new release change behavior without review. Pin exact versions in the plugin's package metadata and record the resolved versions in the build output. Re-test the plugin whenever a pinned package receives a security fix, and confirm who owns that update cycle.

Keep secrets out of plugin defaults

Plugin defaults are committed to version control, so a password, API key or signing secret placed in a default value becomes a credential that every clone holds. Reference secrets by name, generate them at deploy time and store them in your secrets manager. Check the repository history, not only the current files, before a plugin is shared internally.

Review authentication and admin patches like code

Settings patches that touch third-party authentication, admin access, password policy or permissions change who can sign in and what they can do. Treat these patches with the same review, testing and approval as application code, and record the reason for each change. Confirm that a rollback path exists before the patch reaches production.

Track the image and plugin supply chain

Each built image combines the platform release, Tutor, and every plugin, so a vulnerable component in any layer ships with the whole stack. Record the plugin version, source commit and image digest for each deployment, and scan built images on a schedule. Ask who receives advisories for the plugin's dependencies and how quickly a rebuild is triggered.

Confirm license terms before distribution

The Open edX platform is licensed under AGPL-3.0, and Tutor's plugin and hooks system is licensed under Apache 2.0. Whether a plugin you write must be published, and under which terms, depends on how it is linked, distributed and used, so the question belongs with counsel. Record the license of every plugin dependency alongside its pinned version.

edx-platform license

Questions buyers ask before writing a Tutor plugin

How much effort does a first Tutor plugin take?

Effort depends less on the plugin's line count than on how many Open edX settings, services and templates it touches and how many environments it must run in. A plugin that only adds a few settings patches and one Docker service is a small, bounded job. A plugin that patches several LMS and Studio settings, adds a background worker and needs a staging rehearsal takes considerably longer. The main drivers are the number of hooks used, whether the work crosses into Django app code or only configuration, the number of target environments, and the testing you need before each release. Ask any partner to break the quote into design, build, test on a staging Tutor instance, documentation and handover, so you can see which parts scale with scope.

Can an in-house Python engineer build a Tutor plugin?

Often yes, if that engineer can read Django settings, understands Docker Compose and has some working knowledge of how Open edX is deployed. Tutor plugins are Python packages that register hooks, so the language is not the hard part. The harder skills are knowing which Open edX settings are safe to patch, reading the platform's configuration model, and testing a change against a running stack rather than only in isolation. Check whether your engineer has already run Tutor locally and whether anyone on the team can own the plugin after handover. If not, a partner can build it and train your team to maintain it.

What does the client need to provide for a plugin project?

Three inputs matter most. First, a source repository where the plugin code will live, with access for the people who will review and release it. Second, a staging environment that runs the same Tutor version and plugin set as production, so changes can be tested before they reach learners. Third, access to the release calendar, so the plugin's pinned versions and test window line up with Open edX and Tutor releases. Also prepare a list of the settings or behaviors you want changed, and the people who can approve them. Confirm the exact access model, credentials handling and environment details with your team before work starts.

How does a Tutor plugin affect upgrades?

A plugin keeps your customization in a versioned package instead of in edited files inside Tutor's or the platform's directories, which makes upgrades more predictable. Each Open edX release can still change the settings or services a hook touches, so the plugin must be checked against every target release. Expect the plugin's pinned version and its tests to change at upgrade time. Open edX supports only the latest named release at a time, so plan your plugin work around the release you will actually run. Ask any partner how they test a plugin against the next release before the upgrade window opens.

Can a Tutor plugin replace a fork of edx-platform?

Often, for configuration, settings patches and added services. A plugin lets you change behavior through documented hooks without carrying a copy of edx-platform that must be rebased every release. It cannot change arbitrary platform code. If your requirement needs changes inside core modules that no hook reaches, a plugin will not cover it, and you will need a fork or a different design such as a Django app plugin, a filter or an event handler. Before you decide, list each change and check whether a hook or app-level extension can carry it. Only the changes that remain should justify fork maintenance.

What does recurring plugin maintenance involve?

Recurring work falls into four groups: updating the plugin for each Open edX and Tutor release you adopt, re-running tests on staging, reviewing dependency and security updates, and fixing breakage when an upstream hook or setting changes. Costs recur whenever the release calendar or your platform version changes, and they grow with the number of hooks and environments involved. The cost of an upgrade cycle is usually the largest single item. Ask for a written maintenance scope that names who handles release-day testing, how long fixes are supported and how the plugin is handed back to your team if the engagement ends. Confirm response expectations with the partner rather than assuming them.

Is a Tutor plugin something a security review will check?

Yes. A plugin runs code inside your platform's build and runtime, so reviewers will look at what it changes, which secrets it reads and which dependencies it pulls in. Keep credentials out of the plugin source, pin dependency versions and record each setting the plugin patches so the change can be reviewed. Treat the plugin like any other code that reaches production, with review and a tested rollback path. Confirm your own review requirements with your security team before scoping the work.

What a DeployOpen plugin engagement delivers

A DeployOpen plugin engagement ends with a documented plugin repository that holds every Open edX change you have chosen to make through Tutor: the plugin package, its hooks definitions, settings patches, service additions and the Docker build steps that bring them into your images. The repository is handed over with a configuration reference that lists each setting the plugin sets or overrides, its default, the environment it applies to and the owner who approves changes to it. Alongside those, you receive rendered-output diff evidence: a comparison of the configuration and templates Tutor generates before and after the plugin is enabled, so your platform, security and compliance reviewers can see exactly what changed in the running system rather than trusting a description of it. Before anything reaches production, the plugin is verified in a staging environment you control, and the results are written up with the steps taken and any open items.

The last deliverable is an upgrade runbook. It describes how to rebuild images after a Tutor upgrade, which plugin hooks to re-test, how to review the rendered-output diff against the new release and what to roll back if a hook no longer applies. Ask whether the runbook names the Open edX release it was written against, because the Open edX release notes state that only the latest named release is supported. Scope, deliverables and timelines are agreed in writing before work starts, so confirm in the statement of work how staging access, sign-off and handover are defined. Because each upgrade cycle will repeat some of this work, ask whether ongoing upgrades, retesting and runbook updates should sit under a retainer rather than a separate project each time.

How DeployOpen scopes, builds and supports Tutor plugins

DeployOpen treats a Tutor plugin as a deliverable with a written scope, a tested build and a handover your team can run. We move settings patches, services and Open edX configuration out of hand-edited files and into a plugin your team can version, review and upgrade with the rest of the platform.

How we scope

  • Inventory every hand-edited setting, patch and service the platform depends on today
  • Map each customization to the Tutor hook it needs and flag any that have no hook
  • Agree the plugin scope, deliverables and timeline in writing before work starts
  • Confirm which Open edX release and Tutor version the plugin must support

How we build

  • Package configuration, settings patches and services as a Tutor plugin using the hooks API
  • Build and test the plugin against a local Tutor environment before any shared environment
  • Confirm the plugin renders the expected configuration and that the image rebuilds cleanly
  • Document each hook, setting and dependency so the design stays readable to your team

How we hand over

  • Deliver the plugin source, installation steps and a record of every hook and setting used
  • Walk your engineers through enabling, disabling and upgrading the plugin in your environment
  • Provide upgrade notes that list the plugin's dependencies on specific Tutor and Open edX versions
  • Leave your team with a test checklist to run after each Tutor or platform upgrade

How we support

  • Offer ongoing support, upgrades and testing as a retainer after the initial handover
  • Review the plugin against each new named Open edX release and Tutor version before your upgrade
  • Keep the plugin under your organization's control in your repositories and infrastructure
  • Scope retainer work in writing, with the same deliverables and handover as the original build

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.