How to Connect ONLYOFFICE Docs with Moodle 4.0

Updated on September 16, 2022
How to Connect ONLYOFFICE Docs with Moodle 4.0 header image


ONLYOFFICE Docs is an open-source office suite that comprises online viewers and collaborative editors for text documents, spreadsheets, presentations, fillable forms, and PDF files. The core format is OOXML, and the editors are compatible with DOCX, XLSX, and PPTX. The suite is intended for integration with various cloud services such as CMS frameworks (WordPress, Strapi, Drupal), e-learning solutions (Moodle, Chamilo, HumHub), collaboration platforms (ONLYOFFICE Workspace, Nextcloud, Seafile, Confluence, Alfresco), issue trackers (Jira, Redmine), and others.

Moodle is one of the most widely-used open-source platforms for e-learning which allows educators to build custom secure teaching environments on their network.

ONLYOFFICE Docs integration into Moodle allows users to add document activities to courses and enables editing and collaboration for students and teachers. Using the integration app, you can manage document activities added to the courses, define access permissions, view and edit attached files, protect docs, and customize the editor interface.


  • ONLYOFFICE Docs (Document Server) v.4.2.7 and higher (it's recommended to install the latest version 7.1)
  • Moodle v.4.0
  • ONLYOFFICE integration plugin v.3.0.0 for Moodle

Step 1: Install Moodle and ONLYOFFICE Docs

To install Moodle, follow the instructions given in this tutorial.

ONLYOFFICE Docs is available on the Vultr Marketplace as One-Click App. Follow the regular installation steps and choose the appropriate options, including server type, location, size, auto backups, etc. Once ready, you can find the server IP address and root password on the Server information page.

To finalize the configuration for ONLYOFFICE Docs, use an SSH client like OpenSSH. Enter ssh root@your_instance_ip in the terminal and type yes. If you haven't generated SSH keys, you are required to enter the root password. If you have multiple SSH keys, specify the path to your private key:

$ ssh -i /path/to/private/key root@your_instance_ip

The onlyoffice-document-server Docker container will be started automatically.

To switch ONLYOFFICE Docs to HTTPS, get Let's Encrypt SSL Certificates using certbot.

Install certbot:

$ sudo snap install --classic certbot
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot`

Get and install SSL certificate:

$ docker stop <CONTAINER ID>
$ certbot certonly --standalone --agree-tos --no-eff-email --email -d
$ mkdir -p /app/onlyoffice/DocumentServer/data/certs
$ cp /etc/letsencrypt/live/<>/fullchain.pem onlyoffice.crt
$ cp /etc/letsencrypt/live/<>/privkey.pem onlyoffice.key
$ chmod 400 /app/onlyoffice/DocumentServer/data/certs/onlyoffice.key
$ docker start <CONTAINER ID>

Once done, ONLYOFFICE Docs will be available under https://<your instance domain name>/.

Step 2: Install ONLYOFFICE integration plugin v.3.0.0 for Moodle

ONLYOFFICE plugin is an activity module available in the Moodle plugins library.

Follow the usual Moodle plugin installation steps to install the plugin into your mod/onlyofficeeditor directory.

  • Log in as an admin and go to Site administration -> Plugins -> Install plugins.
  • Click the Install plugins from Moodle plugins directory button and select Moodle version 4.0. Search for the ONLYOFFICE plugin, click the Install button, and then click Continue.
  • Confirm the installation request and check the plugin validation report.

Step 3: Configure ONLYOFFICE instance in Moodle

  1. Find the uploaded plugin on the Plugins overview page and click Settings.
  2. Enter the name of the server with ONLYOFFICE Docs installed in the Document Editing Service Address field.
  3. If needed, enable the Force Save option to save document versions and revisions manually at any time directly to the server. It can be useful in case you have an unstable internet connection and want to keep the contents of your documents under control.
  4. Enter the Document Server Secret to protect documents from unauthorized access. JSON Web Token helps verify users who enter the editing sessions in the editors and attempt to perform certain actions in documents. Specify the same secret key in the ONLYOFFICE Document Server config file to enable the validation.

ONLYOFFICE settings in Moodle

Step 4: Customize the editor interface

If necessary, customize the interface elements of ONLYOFFICE Docs in Moodle in the plugin configuration settings:

  • Display or hide Chat, Help, and Feedback and Support menu buttons.
  • Choose default or compact toolbar header.
  • Choose colored or monochrome toolbar header.

ONLYOFFICE interface in Moodle with applied customization settings

Save the plugin settings after entering the required credentials and interface customization.

Step 5: Manage document activities in courses

Create an ONLYOFFICE activity in the course to add text documents, spreadsheets, presentations, and forms and enable viewing and editing in the Moodle interface. Either upload any existing document from your computer or create a new blank file.

Creating an ONLYOFFICE activity

In addition to the new activity's name and description, adjust the following settings:

  • permissions for downloading and printing;
  • hiding Protection tab from other users;
  • module availability and ID;
  • restricting access to the activity;
  • parameters for completion tracking;
  • tags;
  • course competencies.

Once the activity is set, decide which types of users have access to it and other types of activity permissions. For example, you can allow editing permission for teachers and allow only document viewing for students.

Managing activity permissions

Step 6: View and edit attached files

In the ONLYOFFICE document activity:

  • Edit text docs, sheets, and slides attached to the courses.
  • Create digital forms, fill them out, and save them as PDF.
  • Co-author files using real-time and paragraph-locking co-editing modes, Track Changes, comments, and built-in chat.
  • Use plugins to insert YouTube videos and diagrams, translate texts with DeepL, Apertium, or Google, create bibliographies with Mendeley and Zotero, make audio and video calls with Jitsi, convert docs to HTML, correct grammar and spelling mistakes, search for synonyms and antonyms, etc.

DOCX, XLSX, PPTX, DOCXF, OFORM, TXT, and CSV formats are available for viewing and editing. PDF is available for viewing. ODT, ODS, ODP, DOC, XLS, PPT, PPS, EPUB, RTF, HTML, and HTM are available for editing through conversion to OOXML.

Filling out forms

Use a compact editor on the course page to easily access the activity information and blocks such as comments, recent activity, tags, etc., or enter a full-screen mode to edit the files in the extended interface.


You have connected ONLYOFFICE Docs and Moodle, and now you can work with office files directly in the course structure with no need to get distracted by other applications.