ownCloud

About the ONLYOFFICE and ownCloud integration

ONLYOFFICE offers an official connector to integrate ONLYOFFICE Docs with ownCloud and edit office documents within the cloud storage. You can download the ONLYOFFICE connector from the ownCloud Marketplace or the ONLYOFFICE GitHub page.

To learn more about the ONLYOFFICE and ownCloud integration connector and how it works in detail, please visit our API documentation page.
Main features
  • Creating, editing, and viewing documents, spreadsheets, and presentations.
  • Sharing files with different permissions — viewing/editing, reviewing, filling forms and commenting with user mentions. It's also possible to restrict downloading (in all editors) and modifying filters (in spreadsheets). Sharing via public links is also available.
  • Co-editing documents in real-time: two co-editing modes (Fast and Strict), Track Changes, comments, and a built-in chat.
  • Co-editing between several federated ownCloud instances connected to one Document Server.
  • JWT support to secure your traffic so that no one, besides the users with proper rights, can have access to your documents.
Supported formats
  • For editing and viewing: DOCX, XLSX, PPTX, CSV, TXT, PDF form.
  • For viewing only: PDF, DJVU, XPS.
  • For editing via OOXML conversion: ODT, ODS, ODP, and RTF.
  • For converting to Office Open XML formats using the Convert with ONLYOFFICE option: DOC, DOCM, DOT, DOTX, EPUB, HTM, HTML, ODP, ODT, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM, RTF, XLS, XLSM, XLT, XLTM, XLTX.
    ODT, ODS, and ODP are also available for instant conversion. After you enable the corresponding option in the admin settings, ODF-formatted documents are immediately converted in the editor and opened after you click on it.
What's new in version 9.6.1

Added

  • Unknown author display name settings
  • Email notifications settings
  • DOCM, XLSM, PPTM support
  • IMPORTRANGE support

Changed

  • Changed the URL for requests to Conversion API
  • Reading JSON instead of XML from Conversion API

The full change log is available here.

Connecting ONLYOFFICE Docs to ownCloud

Requirements
  • ONLYOFFICE Document Server v7.0 (server or cloud version) or later

    You need an instance of ONLYOFFICE Docs that is resolvable and connectable both from ownCloud and any end clients. ONLYOFFICE Docs must be able to POST to ownCloud directly.

    Starting from version 4.3.0, ONLYOFFICE Docs and ownCloud can be installed either on different computers or on the same machine. In case you select the latter variant, you will need to set up a custom port for ONLYOFFICE Docs, as by default both ONLYOFFICE Docs and ownCloud work on port 80.

    Please refer to the official documentation page to learn more about installing ONLYOFFICE Docs.
  • ownCloud v10.0.0 and later
  • ONLYOFFICE Connector v8.2.3 and later for ownCloud
Installing the ONLYOFFICE connector for ownCloud

The ownCloud administrator can install the integration app from the in-built application market. To do it, please follow these steps:

  1. Click the upper-left hamburger menu.
  2. Select Market.
  3. Go to the Tools category.
  4. Find ONLYOFFICE in the list of available applications.
  5. Click the Install button.

Alternatively, the administrator can install the application manually:

  1. Get the ownCloud ONLYOFFICE integration app. There are several ways to do that:
    1. Download the latest signed version from the official ownCloud store.
    2. Download the latest signed version from the application release page on GitHub. E.g.:
      wget https://github.com/ONLYOFFICE/onlyoffice-owncloud/archive/refs/tags/vX.X.X.tar.gz

      Where vX.X.X is the necessary connector version.

      Unzip the archive, e.g.:

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

      Rename the folder to onlyoffice, e.g.

      mv onlyoffice-owncloud-X.X.X onlyoffice
  2. Clone the application source code and compile it yourself:
    git clone https://github.com/ONLYOFFICE/onlyoffice-owncloud.git onlyoffice
    cd onlyoffice
    git submodule update --init --recursive
  3. ownCloud does not work with unsigned applications showing an alert message, so you will need to use either option a or b to get the application for your production environment.
  4. Move the onlyoffice folder to the ownCloud server apps/ directory (or some other directory used to connect applications):
    cp -r /root/onlyoffice/ /var/www/owncloud/apps/
  5. Go to the apps/ directory:
    cd /var/www/owncloud/apps
  6. Change the owner to update the application right from the ownCloud web interface:
    chown -R www-data:www-data onlyoffice
  7. In ownCloud, go to Settings > Admin > Apps, click Show disabled apps and click Enable for the ONLYOFFICE application.
Configuring the ONLYOFFICE connector for ownCloud

To configure the ONLYOFFICE application settings, please go to Settings > Admin > Additional.

In the Server settings section, specify the following options:

  • ONLYOFFICE Docs address - specify the URL address where the Document Editing Service is installed. This field mandatory. If you install ONLYOFFICE Docs on a custom port, you must specify the port, e.g.: http://127.0. 0.1:8081/
    The address of ONLYOFFICE Docs must be accessible from ownCloud, as well as the address of ownCloud must be accessible from ONLYOFFICE Docs.
  • Disable certificate verification (insecure) - check this box to disable the certificate verification and allow ownCloud to establish connection with ONLYOFFICE Docs if you are using a self-signed certificate for your ONLYOFFICE Docs (otherwise, ownCloud will not validate a self-signed certificate and will not allow for connection to/from ONLYOFFICE Docs). This is an insecure solution, and we strongly recommend that you replace the certificate with the one issued by some CA.
  • Secret key - specify the secret used to sign the data.
    Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to enable it on the ownCloud side as well: find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings. For more details, see the Enabling JWT for the ONLYOFFICE and ownCloud integration section of this article.
  • The Advanced server settings section can be used if your network configuration does not allow for requests between the installed ownCloud and ONLYOFFICE Docs using the public addresses. In this case, specify addresses for internal requests in the corresponding fields:
    • In the ONLYOFFICE Docs address for internal requests from the server field, specify the address that is used to access Document Editing Service from ownCloud.
    • In the Server address for internal requests from ONLYOFFICE Docs field, specify the address that is used to access ownCloud from Document Editing Service.
SettingsSettings

Click the Save button. After saving the Server settings, the Common settings, Editor customization settings, and Common templates sections will appear.

In the Common settings section, you can specify the following options:

  • Restrict access to the editors to following groups - check this box and select user groups that will not be allowed to use the ONLYOFFICE editors in ownCloud.
  • Use ONLYOFFICE to generate a document preview - check this box for thumbnail generation via ONLYOFFICE. It will take up some disk space.
  • Open file in the same tab - check this box to open a file in the current browser tab. If this option is unchecked, a file will be opened in a new browser tab.
  • Keep metadata for each version once the document is edited function makes it possible to keep metadata and display changes for each document version in the version history. It will take up some disk space. You can use the Clear button to remove the metadata and free up disk space.
  • The default application for opening the format - allows you to check the formats to associate with the ONLYOFFICE editors. The docx, xlsx, and pptx formats are selected by default.
    Opening in ONLYOFFICE editors will be performed only for the formats selected in this section.
  • Open the file for editing - allows administrators to choose the document formats to edit via conversion to OOXML formats. The csv and txt formats are selected by default.
    ImportantDue to format restrictions, some data might be lost when saving to the formats from the list (csv, odp, ods, odt, rtf, txt).

    After you enable the corresponding option, documents in the specified formats will be immediately converted and opened in the ONLYOFFICE editor for editing after clicking on them and choosing the Open in ONLYOFFICE menu item. If a format is unchecked, the file will be opened for viewing.

In the Editor customization settings section, you can specify the following options:

  • Keep intermediate versions when editing (forcesave) function allows you to send all changes to the storage directly when clicking the Save button in the ONLYOFFICE editors' interface if you want to prevent data loss. When this option is disabled, your changes are saved to the editors' cache automatically.
  • Select the interface elements of the editors that you want to hide / show (Chat, More compact header, Feedback & Support, Help, Monochrome toolbar header).
  • Review mode for viewing function allows you to set the default document review display mode:
    • Markup - for highlighting the proposed changes,
    • Final - for showing with changes applied,
    • Original - for showing the original document without any changes.
SettingsSettings

After making changes to the Common settings and/or Editor customization settings, click the Save button located below to save the changes.

In the Common templates section, you can click the Add icon icon and upload docx, xlsx, or pptx templates for creating new documents.

You can download or delete a template from this list using the corresponding icons.

SettingsSettings

After adding templates in the admin settings, users will be able to choose a template when creating a new document using the Add icon add button in the ownCloud interface or via the File > Create new menu in the ONLYOFFICE editors' interface.

Checking the connection

You can check the connection to ONLYOFFICE Docs by using the following occ command:

occ onlyoffice:documentserver --check

You will see a text, either with information about the successful connection or the cause of the error.

How it works

The ONLYOFFICE integration follows the API documented here.

  1. When creating a new file, the user navigates to a document folder within ownCloud and clicks the Document, Spreadsheet or Presentation item in the new (+) menu.
  2. The browser invokes the create method in the /lib/Controller/EditorController.php controller. This method adds a copy of a file from the assets folder to the folder the user is currently in.
  3. When opening an existing file, the user navigates to it within ownCloud and selects the Open in ONLYOFFICE menu option.
  4. A new browser tab is opened and the index method of the /lib/Controller/EditorController.php controller is invoked.
  5. The app prepares a JSON object with the following properties:
    • url - the URL that ONLYOFFICE Docs uses to download the document;
    • callbackUrl - the URL that ONLYOFFICE Docs uses to inform about status of the document editing;
    • documentServerUrl - the URL that the client needs to respond to ONLYOFFICE Document Server (can be set at the administrative settings page);
    • key - the UUID+Modified Timestamp to instruct ONLYOFFICE Docs whether to download the document again or not.
  6. ownCloud takes this object and constructs a page from templates/editor.php template, populating all the necessary values to ensure the client browser successfully loads the editor.
  7. The client browser makes a request to the JavaScript library from ONLYOFFICE Docs and sends ONLYOFFICE Docs the DocEditor configuration with the above properties.
  8. Then ONLYOFFICE Docs downloads the document from ownCloud and the user begins editing.
  9. ONLYOFFICE Docs sends a POST request to callbackUrl to inform ownCloud that a user is editing the document.
  10. When all users and client browsers are done with editing, they close the editing window.
  11. After 10 seconds of inactivity, ONLYOFFICE Docs sends a POST to callbackUrl letting ownCloud know that the clients have finished editing the document and closed it.
  12. ownCloud downloads a new version of the document, replacing the old one.
Enabling JWT for the ONLYOFFICE and ownCloud integration

To protect documents from unauthorized access, ONLYOFFICE editors use the JSON Web Token (JWT). The token is added in the configuration when the Document Editor is initialized and during the exchange of commands between inner ONLYOFFICE Docs services. The secret key is used to sign the JSON web token and validate the token upon the request to ONLYOFFICE Docs.

Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings.

Step 1: Find your secret key in the ONLYOFFICE Docs configuration file

  1. Open the local.json file with any available text editor.
    • For Linux - /etc/onlyoffice/documentserver/local.json
    • For Windows - %ProgramFiles%\ONLYOFFICE\DocumentServer\config\local.json
    • For Docker – enter the ONLYOFFICE Docs container using the docker exec -it <containerID> bash command and open /etc/onlyoffice/documentserver/local.json

      Alternatively, you can use the following command to find the default secret key without opening local.json:

      sudo docker exec <containerID> /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'

    The local.json file should look like this:

    {"services": {"CoAuthoring": {"token": {"enable": {"request": {"inbox": true,"outbox": true},"browser": true}},"secret": {"inbox": {"string": "yoursecret"},"outbox": {"string": "yoursecret"},"session": {"string": "yoursecret"}}}}}
  2. The true value is specified in three sections. It means that token validation is enabled.
    • services.CoAuthoring.token.enable.browser
    • services.CoAuthoring.token.enable.request.inbox
    • services.CoAuthoring.token.enable.request.outbox
  3. The automatically generated secret key is specified in three sections. You can replace the default secret value with your own secret key. The secret key must be the same in three sections.
    • services.CoAuthoring.secret.inbox.string
    • services.CoAuthoring.secret.outbox.string
    • services.CoAuthoring.secret.session.string
  4. If you make changes, save them and restart the services for the config changes to take effect.
    supervisorctl restart all

Step 2: Specify the same secret key in the connector settings

In the connector settings, specify the same secret in the Secret key field and save the settings.

Connecting to the demo ONLYOFFICE Docs

Starting from ONLYOFFICE connector version 3.0.1, you can try the ONLYOFFICE online editors within ownCloud without installing ONLYOFFICE Docs.

To turn the connection on, click the Connect to demo ONLYOFFICE Docs server checkbox and click the Save button.

Important This is a public test server that will be available during a 30-day period. Don’t share your sensitive data there.

Installing ONLYOFFICE Docs with ownCloud using Docker Compose

Using Docker Compose, you can quickly and easily deploy the preconfigured version of ONLYOFFICE Docs connected to ownCloud with all the required dependencies in the Docker containers.
Installing Docker and Docker Compose
  1. Follow this instruction to download and install Docker to your computer. Docker is a program for automating application development and management in container-enabled environments.
  2. Then follow this instruction to download and install the Docker Compose package manager, which allows you to describe and run multi-container applications.
Installing ONLYOFFICE Docs and ownCloud servers
  1. Download the latest version of the docker-onlyoffice-owncloud repository. To do so, insert the following line into the Command line interface:
    git clone --recursive https://github.com/ONLYOFFICE/docker-onlyoffice-owncloud
  2. Once the repository is downloaded, go to the docker-onlyoffice-owncloud folder:
    cd docker-onlyoffice-owncloud
  3. Update submodules in the repository:
    git submodule update --remote
  4. Launch Docker Compose:
    sudo docker-compose up -d
    You might need to wait a couple of minutes until all the containers are up and running after the command above.

In the browser address bar, enter http://localhost to open the ownCloud setup page and create your admin account. Enter your Login and Password (by default, admin is used for both fields).

Now you can create and edit documents in ownCloud using ONLYOFFICE Docs without configuring any settings.

Server settings are specified during the deployment, but you can adjust Common settings, Editor customization settings, and Common templates. Please refer to the Configuring the ONLYOFFICE connector for ownCloud section to learn more about the available connector settings.

Installing ONLYOFFICE Docs with ownCloud on a virtual machine using UCS

App appliances introduced by Univention are a distribution format that allows installing systems already packed with components such as ONLYOFFICE Docs and ownCloud.

Univention, an open-source corporate infrastructure developer, introduced a handy method of installing systems already equipped with third-party components – virtual app appliances. These are VirtualBox or VMware images that include the app, UCS management system and the UCS runtime environment.

The following virtual images contain Univention Corporate Server, ownCloud and ONLYOFFICE. The apps work out of the box with the additionally created auto-configuration that makes sure that the required ONLYOFFICE add-on in ownCloud is configured correctly. The installation process is far easier than a classic manual method: no manual steps by the administrator are needed.

Download the necessary components

First, you need to install the hypervisor for the virtual machine. Choose between VMware Workstation Pro or VirtualBox and follow the documentation for detailed installation instructions.

Then download ONLYOFFICE-ownCloud VM for the hypervisor that you’ve chosen.

UCS step 1
Import the virtual appliance

Now open the hypervisor and import the ONLYOFFICE-ownCloud virtual appliance. This guide describes how to do this in both platforms.

Install the application

Once the image is successfully imported, start the Virtual Machine. Go through the booting process via the installation wizard, following the steps below.

  1. Choose your language and enter the nearest city.
    UCS step 2UCS step 2

    The wizard will obtain the default system locale, timezone, and keyboard layout.

    UCS step 2-1UCS step 2-1
  2. Set up your domain and network settings. By default, you obtain an IP address automatically. Alternatively, you can specify your IP address, net mask, and gateway manually. Enter the address of the preferred DNS server.
    UCS step 3UCS step 3
  3. Select your domain settings. The Manage users and permissions directly on this system option is selected by default. It allows creating a new domain in this system. Alternatively, you can connect to the existing UCS or Microsoft Active Directory domain.
    UCS step 4UCS step 4
  4. Enter your Company name, admin email address for activating ONLYOFFICE (the license file will be sent to this email address), create and confirm a new password for your administrator account.
    UCS step 5UCS step 5
  5. Specify the fully qualified domain name for this system and the LDAP base:
    UCS step 6UCS step 6
  6. Review your settings and make sure everything is filled out correctly. Then click the Configure System button.
    UCS step 7UCS step 7
  7. Once everything is configured, ONLYOFFICE is ready to start in a newly created UCS platform.
    UCS step 8UCS step 8
    UCS step 9UCS step 9
  8. Enter your IP address in the browser address bar and upload your ucs.license file received via email.
  9. To log in to your ONLYOFFICE Docs and ownCloud appliance, click ownCloud in the Applications section and enter the default username and password (owncloud, owncloud).

    To log in to your Univention Management Console, click LOGIN on the top or System and domain settings in the Administration section and enter your admin email address and the password specified during the registration (see step 4).

    UCS step 10UCS step 10
Enabling editing for ownCloud Web

To enable work within ownCloud Web, register the connector in the ownCloud Web config.json:

To register the connector, use these lines:

"external_apps": [
                {
                  "id": "onlyoffice",
                  "path": "http(s):///custom/onlyoffice/js/web/onlyoffice.js"
                }
              ]
              

Depending on your web server configuration, you can drop the index.php segment from the URL path.

Start using ONLYOFFICE Docs within ownCloud

To create a document:

  1. Open the needed folder within ownCloud.
  2. Click the Add icon add button.
  3. Choose the needed file type: Document, Spreadsheet, or Presentation.
    CreateCreate
  4. Type in the document name and press Enter.
  5. Optional. If some templates are added by the administrator, select the necessary template and click Create.
    TemplateTemplate

To open a document for editing or viewing:

  1. Open the folder with the needed document.
  2. Click the More iconmore button or the document title.
  3. Click the Open in ONLYOFFICE option.
    OpenOpen

To convert a document to the Office Open XML format:

  1. Open the folder with the needed document.
  2. Click the More iconmore button or the document title.
  3. Click the Convert with ONLYOFFICE option.
    ConvertConvert
    See the full list of the formats which can be converted into OOXML.

    The ODT, ODS, ODP, and RTF formats are also available for instant conversion. If the corresponding option is enabled in the admin settings, documents in the specified formats will be immediately converted and opened in the ONLYOFFICE editor for editing after clicking on them and choosing the Open in ONLYOFFICE menu item.

Connecting ONLYOFFICE Desktop Editors to ownCloud

ONLYOFFICE allows you to edit the files stored in your ownCloud account and collaborate on them using both online and desktop editors. Thereby, you can use not only online collaboration tools but also the features available in your desktop application only:

  • protecting documents with a password or a digital signature,
  • sending the currently edited file right from the editor using the Send plugin,
  • inserting audio and video via the Presentation Editor.
It's supposed that you already have ownCloud server, ONLYOFFICE Docs and the integration app installed and configured.

Launch ONLYOFFICE Desktop Editors. To connect Desktop Editors to your ownCloud server, perform the following actions:

  1. Switch to the Connect to cloud section on the left side panel.
  2. Click the ownCloud cloud service button. Alternatively, you can use the Connect now link at the bottom.
    Connect to cloud tabConnect to cloud tab
  3. If you pressed the ownCloud service button, the Connect to cloud office window opens with the ownCloud selected. If you used the Connect now link, choose the ownCloud cloud storage from the drop-down list.
    • in the Cloud office URL field, enter your ownCloud server domain name or IP address. When ready, click the Connect now button.
      Connect to cloud office windowConnect to cloud office window
    • The ownCloud sign in page will open in a new tab of the Desktop Editors interface.

      • Specify your Username or email and the Password you use to access your ownCloud account,
      • Click the Log in button.
      Connect to cloud office windowConnect to cloud office window

The Files section of your ownCloud account will open. Now you can edit your existing files and create new ones, share your documents and collaborate on them with ownCloud users using ONLYOFFICE editors.

To learn more about managing your connected accounts, please refer to this instruction.

Connecting ONLYOFFICE Documents to ownCloud on iOS or Android

You can connect ownCloud to the ONLYOFFICE Documents mobile app to work on your ownCloud documents, spreadsheets, and presentations and edit them collaboratively on-the-go.

It's supposed that you already have ownCloud server, ONLYOFFICE Docs and the integration app installed and configured.

To connect ONLYOFFICE to ownCloud on your mobile device, download and install the latest version of the ONLYOFFICE Documents app for iOS or ONLYOFFICE Documents application for Android and perform the following actions:

  1. Go to the Clouds section.
  2. Choose ownCloud.
  3. Insert the URL address of your ownCloud server in the Connection URL field.
  4. Enter the login and password of your ownCloud account.
  5. Press Next.

To edit documents from your ownCloud using ONLYOFFICE Docs on your mobile device, tap the necessary file name in the file list.

Known issues
  • Connecting external storages. Adding the storage using the External storages app has issues with the co-editing in some cases. If the connection is made using the same authorization keys (the Username and password or Global credentials authentication type is selected), then the co-editing is available for the users. If different authorization keys are used (Log-in credentials, save in database or User entered, store in database authentication options), the co-editing is not available. When the Log-in credentials, save in session authentication type is used, the files cannot be opened in the editor.
  • Encrypting file storage. ownCloud provides an option to encrypt the file storage. But if the encryption with the per-user encryption keys (used by default in ownCloud Default encryption module app) is enabled, ONLYOFFICE Docs cannot open the encrypted files for editing and save them after the editing. The ONLYOFFICE section of the administrative settings page will display a notification about it. However, if you set the encryption with the master key, ONLYOFFICE application will work as intended. The instruction on enabling master key based encryption is available in the official documentation on ownCloud websites.
    ImportantownCloud recommends using master encryption key only on fresh installations with no existing data, or on systems where encryption has not already been enabled, as your files previously encrypted with the use of per-user encryption keys might be lost forever after you enable master key based encryption on them.
  • Validating certificate. If you are using a self-signed certificate for your Document Server, ownCloud will not validate such a certificate and will not allow connection to/from Document Server. This issue can be solved in two ways:
    1. Check the Disable certificate verification (insecure) box on the ONLYOFFICE administration page, Server settings section, within your ownCloud.
    2. Change the ownCloud config file manually. Locate the ownCloud config file (/owncloud/config/config.php) and open it. Insert the following section to it:
      'onlyoffice' => array (     'verify_peer_off' => true )

      This will disable the certificate verification and allow ownCloud to establish connection with Document Server.

      Please remember that this is a temporary insecure solution, and we strongly recommend that you replace the certificate with the one issued by some CA. Once you do that, do not forget to uncheck the corresponding setting box or remove the above section from the ownCloud config file.
  • Federated Cloud Sharing. If the document is shared using the Federated Cloud Sharing app, the co-editing between the ownCloud instances connected to different ONLYOFFICE servers will not be available. The users from one and the same Document Server can edit the document in the co-editing mode, but the users from two (or more) different Document Servers will not be able to collaborate on the same document in real time.
  • Converting files. ONLYOFFICE Docs uses Office Open XML format as a basis when opening and editing files. If the file format is different from OOXML, it will still be converted to the corresponding OOXML for the Document Server proper work and faster performance. After that you can edit the file, making any changes available for the base OOXML format and save the file to this base OOXML format.

    In case the source ownCloud file format was different from the base one, and you still want to save it to the original format, the file will be converted to this format from OOXML. As the formats are fundamentally different, some data (such as charts, tables, autoshapes or images) and formatting can be lost due to the simple reason that some formats (csv, txt, etc.) do not support them or treat them differently than OOXML standard does. That is why all the non-OOXML files by default are opened for viewing only, although there is an option to convert the file in the context menu. If you realise the data/formatting loss risks after the conversion, but still want to open non-OOXML files for editing, you can check them in the list in the settings. Editing for csv and txt files is available by default.

  • When accessing a document without download permission, file printing and using the system clipboard are not available. Copying and pasting within the editor is available via buttons in the editor toolbar and in the context menu.

Watch video

How to integrate ONLYOFFICE Docs with ownCloud
Configuring ONLYOFFICE connector for ownCloud

Host ONLYOFFICE Docs on your own server or use it in the cloud

Article with the tag:
Browse all tags