{"id":120321,"date":"2022-06-26T10:57:20","date_gmt":"2022-06-26T07:57:20","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=120321"},"modified":"2023-08-25T12:25:02","modified_gmt":"2023-08-25T09:25:02","slug":"integrate-onlyoffice-docs-and-nextcloud","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/integrate-onlyoffice-docs-and-nextcloud\/","title":{"rendered":"How to integrate ONLYOFFICE Docs and Nextcloud on Ubuntu"},"content":{"rendered":"\n<p>Welcome to our guide on how to create a collaborative environment on Ubuntu by integrating <a href=\"https:\/\/www.onlyoffice.com\/office-suite.aspx\" rel=\"noopener\" target=\"_blank\" rel=\"noreferrer noopener\">ONLYOFFICE Docs<\/a>, an open-source online office suite, with <a href=\"https:\/\/nextcloud.com\" rel=\"noopener\" target=\"_blank\" rel=\"noreferrer noopener\">Nextcloud<\/a>, an open-source file-sharing service. Following the steps described below, you will learn how to deploy the latest versions of the given software tools on your Ubuntu server, install the official integration app and configure it with ease.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ONLYOFFICE Docs and Nextcloud: main features<\/h2>\n\n\n\n<p>ONLYOFFICE Docs offers an official connector that makes it possible to integrate the ONLYOFFICE suite with the Nextcloud cloud storage. With the combined solution, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create, edit and collaboratively work on text documents, spreadsheets and presentations;<\/li>\n\n\n\n<li>Create and fill out online forms;<\/li>\n\n\n\n<li>Share files with other users using various permission rights;<\/li>\n\n\n\n<li>Protect office documents with watermarks;<\/li>\n\n\n\n<li>Make the most of real-time document collaboration &#8211; two co-editing modes (Fast and Strict), Version History, Track Changes, comments, user tags and a built-in chat;<\/li>\n\n\n\n<li>Co-edit documents within several federated Nextcloud instances connected to one ONLYOFFICE Document Server;<\/li>\n\n\n\n<li>Enable JWT support to prevent unauthorized access to your documents.<\/li>\n<\/ul>\n\n\n\n<p>The latest version of the integration app, v7.4, comes with support for new types of access rights (Commenting, Reviewing and Custom filter for spreadsheets), Dark Theme, new interface language (Catalan), disabling\/enabling macros, quick file location access, and several important fixes. You can find the full changelog on <a href=\"https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud\/blob\/master\/CHANGELOG.md\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a> if you want to learn more.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation of ONLYOFFICE Docs and Nextcloud<\/h2>\n\n\n\n<p>First of all, you need to deploy an ONLYOFFICE Docs instance and a Nextcloud instance. They can be installed either on different machines or on the same one. If you prefer the latter option, you will have to set up a custom port for ONLYOFFICE Docs. The reason is that both ONLYOFFICE Docs and Nextcloud use port 80 by default.<\/p>\n\n\n\n<p>The ONLYOFFICE Docs instance must be resolvable and connectable both from Nextcloud and any other end clients. Also, it must be able to directly POST to the Nextcloud instance. <\/p>\n\n\n\n<p>Install ONLYOFFICE Docs on Debian\/Ubuntu using the aid here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/install-onlyoffice-docs-on-debian-ubuntu\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install ONLYOFFICE Docs Community on Debian \/ Ubuntu<\/a><\/li>\n<\/ul>\n\n\n\n<p>To install the latest version of ONLYOFFICE Docs via Docker, you can refer to the following guide:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-run-onlyoffice-docs-as-a-docker-container\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Run ONLYOFFICE Docs as a Docker Container<\/a><\/li>\n<\/ul>\n\n\n\n<p>It\u2019s worth mentioning that ONLYOFFICE Docs also runs on ARM-based devices. So, if your machine has an ARM chip, you can install the office suite without any problems.<\/p>\n\n\n\n<p>When it comes to Nextcloud, you can install it by following this detailed guide:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/computingforgeeks.com\/how-to-install-nextcloud-on-ubuntu-debian\/\" target=\"_blank\" rel=\"noreferrer noopener\">How To Install Nextcloud on Ubuntu<\/a><\/li>\n<\/ul>\n\n\n\n<p>When both ONLYOFFICE and Nextcloud are installed successfully, you can proceed with the next step.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation of the ONLYOFFICE integration app for Nextcloud<\/h2>\n\n\n\n<p>The official connector for Nextcloud developed by the ONLYOFFICE team can be installed in two ways. The easiest solution is to get it from the built-in application marketplace. To do so, you need to log into your Nextcloud instance as an administrator and follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click the user name in the upper right corner;<\/li>\n\n\n\n<li>Select Apps;<\/li>\n\n\n\n<li>Access the Tools category;<\/li>\n\n\n\n<li>Find ONLYOFFICE among all available applications;<\/li>\n\n\n\n<li>Click Download and enable.<\/li>\n<\/ul>\n\n\n\n<p>That\u2019s it. The connector will be automatically downloaded.&nbsp;<\/p>\n\n\n\n<p>The other alternative way is manual installation that also requires administrator rights. You can either get the integration app from <a href=\"https:\/\/apps.nextcloud.com\/apps\/onlyoffice\" rel=\"noopener\" target=\"_blank\" rel=\"noreferrer noopener\">the Netxcloud App Store<\/a> or download it from <a href=\"https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud\" rel=\"noopener\" target=\"_blank\" rel=\"noreferrer noopener\">GitHub<\/a>. If you prefer the latter option, just download the latest version with this command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt install curl wget\nVER=$(curl -s https:\/\/api.github.com\/repos\/ONLYOFFICE\/onlyoffice-nextcloud\/releases\/latest|grep tag_name|cut -d '\"' -f 4)\nwget https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud\/archive\/refs\/tags\/${VER}.tar.gz<\/code><\/pre>\n\n\n\n<p>Provided commands will download the latest version of the integration app. It\u2019s recommended to use the newest one. Then, unzip the archive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -xvzf ${VER}.tar.gz<\/code><\/pre>\n\n\n\n<p>After that, change the folder name to <em>onlyoffice<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mv onlyoffice-nextcloud-*\/ onlyoffice<\/code><\/pre>\n\n\n\n<p>Now you need to clone the source code of the integration app and compile it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone https:\/\/github.com\/ONLYOFFICE\/onlyoffice-nextcloud.git onlyoffice\ncd onlyoffice\ngit submodule update --init --recursive<\/code><\/pre>\n\n\n\n<p>Regardless of how you got the integration app, from the Nextcloud App Store or GitHub, now you have the <em>onlyoffice<\/em> folder that you need to move to the Nextcloud server apps directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cp -r \/root\/onlyoffice\/ \/var\/www\/html\/apps\/<\/code><\/pre>\n\n\n\n<p>Then, go to the apps directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/var\/www\/html\/apps<\/code><\/pre>\n\n\n\n<p>Change the owner so that the application can be updated right from the Nextcloud interface:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chown -R www-data:www-data onlyoffice<\/code><\/pre>\n\n\n\n<p>Log into the Nextcloud instance and open the Settings page. Choose Apps and select Disabled apps. Click Enable for the ONLYOFFICE integration app. Now you can proceed with the configuration process.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuration of the ONLYOFFICE integration app<\/h2>\n\n\n\n<p>To configure the ONLYOFFICE connector for Nextcloud, go to Settings, select Administration and find ONLYOFFICE. You will see the following options in the Server settings section:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ONLYOFFICE Docs address<\/strong> is the URL address of the ONLYOFFICE Document Server. This field is obligatory. If you installed ONLYOFFICE Docs on a custom port, you need to specify this port. For example, <em>http:\/\/127.0. 0.1:8081\/<\/em>;<\/li>\n\n\n\n<li><strong>Disable certificate verification (insecure)<\/strong> box is used to disable certificate verification and allows Nextcloud to establish connection with ONLYOFFICE Docs if you use self-signed certificates. However, we recommend that you replace your self-signed certificate with the one issued by a certification authority (CA);<\/li>\n\n\n\n<li><strong>Secret key<\/strong> is used to sign data. For more information, please refer to the Enabling JWT section of this guide.<\/li>\n<\/ul>\n\n\n\n<p>The Advanced server settings section contains some options that are useful if your current network configuration doesn\u2019t allow for requests between the installed Nextcloud and ONLYOFFICE Docs instances using public addresses. If this occurs, you need to specify addresses for internal requests in these fields:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ONLYOFFICE Docs address for internal requests from the server<\/strong> is the address that is used to access the ONLYOFFICE Document Server from Nextcloud;<\/li>\n\n\n\n<li><strong>Server address for internal requests from ONLYOFFICE Docs<\/strong> is the address that is used to access Nextcloud from the ONLYOFFICE Document Server.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/v35h1CCSS69pQtqt9GSeRPTAXMA0yn1rqkQIUzcHxE3oYsNeSI_ogPwa9J6v-aLiV3dbEgM8u2JyVUodxZMjzrtUvmzkIglJqK_mR2zzYqsoqgKha3tFgPGz7YVnYKVcPu0IblICE3ni5r4Wqw\" alt=\"\" title=\"\"><\/figure>\n\n\n\n<p>Specify the required options and click Save. After that, you will see other settings sections that allow you to adjust the integration app according to your preferences. If you want to learn more about each particular setting, please read <a href=\"https:\/\/helpcenter.onlyoffice.com\/integration\/gettingstarted-nextcloud.aspx#Configure_block\" rel=\"noopener\" target=\"_blank\" rel=\"noreferrer noopener\">the official documentation<\/a>.<\/p>\n\n\n\n<p>After making all the required changes, click the Save button below each settings section. Now you can make your integrated solution more secure.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enabling JWT<\/h3>\n\n\n\n<p>ONLYOFFICE Docs uses JSON Web Token (JWT) to prevent unauthorized access. To enable this feature in your integration, you need to enable token validation and specify your secret key in the ONLYOFFICE Docs configuration. To do so, just follow these steps:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1. Configure ONLYOFFICE Docs<\/h4>\n\n\n\n<p>First of all, you need to open the local.json file with any text editor. Since you installed ONLYOFFICE Docs via Docker, enter the ONLYOFFICE Docs container using the <em>docker exec -it &lt;containerID&gt; bash<\/em> command and open the <em>\/etc\/onlyoffice\/documentserver\/local.json<\/em> file.<\/p>\n\n\n\n<p>Now enable token validation by setting the false values to true in these sections:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>services.CoAuthoring.token.enable.browser<\/em><\/li>\n\n\n\n<li><em>services.CoAuthoring.token.enable.request.inbox<\/em><\/li>\n\n\n\n<li><em>services.CoAuthoring.token.enable.request.outbox<\/em><\/li>\n<\/ul>\n\n\n\n<p>Specify your secret key by replacing the secret value with a text string in three sections. The secret key must be the same:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>services.CoAuthoring.secret.inbox.string\nservices.CoAuthoring.secret.outbox.string\nservices.CoAuthoring.secret.session.string\n{\n  \"services\": {\n    \"CoAuthoring\": {\n      \"token\": {\n        \"enable\": {\n          \"request\": {\n            \"inbox\": true,\n            \"outbox\": true\n          },\n          \"browser\": true\n        }\n      },\n      \"secret\": {\n        \"inbox\": {\n          \"string\": \"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">yoursecret<\/mark>\"\n        },\n        \"outbox\": {\n          \"string\": \"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">yoursecret<\/mark>\"\n        },\n        \"session\": {\n          \"string\": \"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">yoursecret<\/mark>\"\n        }\n      }\n    }\n  }\n}\n<\/code><\/pre>\n\n\n\n<p>Save the made changes and restart the services with this command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo <em>supervisorctl restart all<\/em><\/code><\/pre>\n\n\n\n<p>Finally, specify the same secret key in the settings of the ONLYOFFICE integration app.<\/p>\n\n\n\n<p>Congratulations! Now you have a collaborative environment where you can share files and co-edit documents built by integrating ONLYOFFICE Docs with Nextcloud on Ubuntu.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/jNFusHVGVsTBSkLtLYvlDxud_2n1v_AyVqmlhgouaUHvt66AjA4pRAF_rbC0QKofCrZmCb3vH8-7hU7yDzsw0EuwiIfVbGTeayLqEfMRh3GaQ8galkSkGwXSqn-huu7BOUExC1WCj4-kX8sp-A\" alt=\"\" title=\"\"><\/figure>\n\n\n\n<p>Thank you for using our tutorial. We hope this was helpful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to our guide on how to create a collaborative environment on Ubuntu by integrating ONLYOFFICE Docs, an open-source online office suite, with Nextcloud, an open-source file-sharing service. Following the steps described below, you will learn how to deploy the latest versions of the given software tools on your Ubuntu server, install the official integration &#8230; <a title=\"How to integrate ONLYOFFICE Docs and Nextcloud on Ubuntu\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/integrate-onlyoffice-docs-and-nextcloud\/\" aria-label=\"Read more about How to integrate ONLYOFFICE Docs and Nextcloud on Ubuntu\">Read more<\/a><\/p>\n","protected":false},"author":3,"featured_media":120327,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,50,832,81],"tags":[37547,37546],"cfg_series":[],"class_list":["post-120321","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-linux-tutorials","category-tech","category-ubuntu","tag-onlyoffice-docs","tag-onlyoffice-docs-and-nextcloud"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/120321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=120321"}],"version-history":[{"count":0,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/120321\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/120327"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=120321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=120321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=120321"},{"taxonomy":"cfg_series","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/cfg_series?post=120321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}