Integrating ONLY OFFICE Docs and Nextcloud to Create a Collaborative Environment in Ubuntu

In this article, you will learn how to install the ONLYOFFICE Docs in your Ubuntu machine and connect the ONLYOFFICE Document Server to the Nextcloud via the official connector. This integration allows you to build a collaborative environment where you will be able to co-edit the documents in real time with other users.

Benefits of ONLYOFFICE Docs

ONLYOFFICE Docs is a self-hosted office package that allows you to create a secure collaborative environment on a local server. It’s 100% open-source, so its source code is publicly available in GitHub (ONLYOFFICE Document Server) under the terms and conditions of the AGPL v3 license.

Here is what the ONLYOFFICE Docs has in its arsenal:

    • Complete office package with a text processor, a spreadsheet program, a form creator and a presentation tool.
    • Built-in viewer for PDF, PDF/A, DjVu and XPS files.
    • PDF to DOCX conversion.
    • Perfect compatibility with the OOXML formats and, hence, with Word documents, Excel sheets and PowerPoint slides.
    • Multiple formatting features and styling tools.
    • Various document access permissions and public sharing.
    • Fast and Strict co-editing modes.
    • Real-time document collaboration with Track Changes, Version History, comments and communication.
    • Document comparison.
    • Digital signatures and watermarks.
    • Dark mode and up to 500% scaling options.
    • Free desktop editors for Windows, Linux and macOS.
    • Mobile apps for Android and iOS that are available at no cost.

All the editing and collaborative features of the ONLYOFFICE Docs are available in its free version called Community Edition. However, there are also scalable commercial editions with access to the ONLYOFFICE web editors, technical support and regular updates for enterprises and software developers.

System Configuration

    • CPU: 2 GHz dual-core processor
    • RAM: 2 GB or more
    • HDD: at least 40 GB
    • Swap: 4 GB or more
    • OS: Ubuntu 18.04 or 20.04

Miscellaneous Requirements

Additionally, you need to have the latest version of the Docker installed in your Ubuntu machine because this is the easiest way to deploy the ONLYOFFICE Docs. Please read this guide over if you don’t have the Docker yet.

Also, you need to have the latest version of the ONLYOFFICE Docs installed (also known as ONLYOFFICE Document Server). Install it by following the detailed instructions in this article.

Finally, you can’t get along with the latest version of the Nextcloud. This article will help you to get through the installation and configuration process with fewer efforts.

When you have all the required components installed and configured in your server, you can proceed with the integration process. For your convenience, the whole process is divided into several steps that you need to properly follow to make sure that the ONLYOFFICE and Nextcloud combined solution works as it’s supposed to.

Step 1. Installation of the ONLYOFFICE Connector

The official ONLYOFFICE integration app can be installed in two ways. The most effortless way is to find it in the built-in Nextcloud application marketplace. For this purpose, you just need to log into your Nextcloud instance with administrator rights and follow these steps:

    • In the upper right corner of the screen, find your user name and click it.
    • Choose Apps.
    • Find the Tools category.
    • Select ONLYOFFICE.
    • Click Download and enable.

If done correctly, the integration app is downloaded automatically.

Alternatively, you can install the connector manually. For manual installation, download the official integration app from the Netxcloud App Store or from the GitHub. This command helps you to get what you need from the GitHub:

wget https://github.com/ONLYOFFICE/onlyoffice-nextcloud/archive/refs/tags/vX.X.X.tar.gz

Please note that vX.X.X indicates the version of the connector. Ideally, the latest version should be indicated here.

After launching the previous command, unzip the archive:

tar -xvzf vX.X.X.tar.gz

Now, you need to change the folder name to onlyoffice:

mv onlyoffice-nextcloud-X.X.X onlyoffice

Then, clone the source code of the ONLYOFFICE connector and compile it with this command:

git clone https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git onlyoffice
                                    cd onlyoffice
                                    git submodule update --init --recursive

Copy the resulting folder to the Nextcloud server apps directory:

cp -r /root/onlyoffice/ /var/www/html/apps/

Then, enter the Nextcloud apps directory:

cd /var/www/html/apps

Now, you need to change the owner. This operation is required to update the integration app from the Nextcloud interface:

chown -R www-data:www-data onlyoffice

After that, get back to the Nextcloud instance and go to Settings by clicking your user name in the right upper corner. Click Apps and select the Disabled apps on the left-side panel. Find the ONLYOFFICE and click the Enable button.

Step 2. Configuration of the Connector

Now, you need to configure the installed integration app. For that to happen, please go to the Settings page and find the Administration section on the left-side panel. Click the ONLYOFFICE icon, and you will see these following options:

    • ONLYOFFICE Docs address. This obligatory option indicates the URL address of the ONLYOFFICE Document Server. If you installed the ONLYOFFICE Docs using a custom port, please specify this port. For example, http://127.0. 0.1:8081/.
    • Disable certificate verification. This option is used to disable the certificate verification which allows the Nextcloud to establish a connection with the ONLYOFFICE Document Server if you use your own self-signed certificates. Nevertheless, it’s recommended to use the certificates issued by a certification authority (CA).
    • Secret key. This option is used to sign the data.

In the Advanced server settings section, you will find the following options:

    • ONLYOFFICE Docs address for internal requests from the server. This is the URL address used to access the ONLYOFFICE Docs from Nextcloud.
    • Server address for internal requests from ONLYOFFICE Docs. This is the URL address designed to access the Nextcloud from the ONLYOFFICE Docs.

These two options are useful if your network doesn’t allow for requests between the ONLYOFFICE Docs and the Nextcloud using the public addresses. After configuring the required options, don’t forget to click Save.

Besides, there are some additional settings that you can enable or disable if necessary. For example, the common and customization options.

When you are done with the configuration process, you can enable the JWT to make the document editing more secure.

Step 3. Enabling JWT

In the ONLYOFFICE Docs, the JSON Web Token (JWT) is used to prevent an unauthorized access to documents. To enable this option, you need to enable the token validation first and enter your secret key in the ONLYOFFICE settings.

To do so, open the local.json file using any text editor. Access the ONLYOFFICE Docs Docker container by launching the docker exec -it <containerID> bash command and find the /etc/onlyoffice/documentserver/local.json file.

To enable the token validation, set all the false values to true in the following sections:

    • services.CoAuthoring.token.enable.browser
    • services.CoAuthoring.token.enable.request.inbox
    • services.CoAuthoring.token.enable.request.outbox

Enter your own secret key. It must be the same:

  "services": {
    "CoAuthoring": {
      "token": {
        "enable": {
          "request": {
            "inbox": true,
            "outbox": true
          "browser": true
      "secret": {
        "inbox": {
          "string": "yoursecret"
        "outbox": {
          "string": "yoursecret"
        "session": {
          "string": "yoursecret"

Save your changes and restart the services:

supervisorctl restart all

Finally, enter the same secret key in the ONLYOFFICE settings.

That’s it! Now, you have built a collaborative environment in your Ubuntu server where you can do the following:

    • Open, edit and save text documents, spreadsheets, fillable forms and presentations.
    • Share files with the other users using the more advanced sharing permissions.
    • Protect the documents with watermarks.
    • Collaborate on the documents online making the most of the two Fast and Strict co-editing modes, Track Changes and Version History features, comments, user mentions and an integrated chat for text messages.

Co-editing via the ONLYOFFICE Docs is also available between several federated Nextcloud instances connected to the same ONLYOFFICE Document Server.

Don’t forget that Nextcloud is not the only integration option for the ONLYOFFICE Docs. You can integrate this open-source office suite with a wide range of sync&share platforms and document management systems to enable a real-time document editing and collaboration:

The complete list of all available integration options for the ONLYOFFICE Docs is available on the official website.

About the author

Sergey Zarubin