Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔄 Update "Install and Configure ONLYOFFICE Docs for Nextcloud" #918

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
path: "/tutorials/install-and-configure-onlyoffice-docs-for-nextcloud"
slug: "install-and-configure-onlyoffice-docs-for-nextcloud"
date: "2021-08-24"
date: "2024-08-21"
title: "Install and Configure ONLYOFFICE Docs for Nextcloud"
short_description: "This guide covers the installation and configuration of ONLYOFFICE Docs to work with Nextcloud."
tags: ["ONLYOFFICE", "Docker", "Nextcloud"]
author: "Ksenia Fedoruk"
author_link: "https://github.com/kseniafedoruk"
author_img: "https://avatars.githubusercontent.com/u/39296259?s=400&u=1e8ca4fc0e50f214b0cf277f40443f4298d855d8&v=4"
author_img: "https://avatars.githubusercontent.com/u/39296259"
author_description: ""
language: "en"
available_languages: ["en"]
Expand All @@ -17,25 +17,26 @@ cta: "cloud"

## Introduction

`ONLYOFFICE Docs` (ONLYOFFICE Document Server) is an open-source web-based office suite that provides you with online editors for text documents, spreadsheets, and presentations highly compatible with OOXML formats (.docx, .xlsx, .pptx).
ONLYOFFICE Docs (ONLYOFFICE Document Server) is an open-source web-based office suite that provides you with online editors for text documents, spreadsheets, and presentations highly compatible with OOXML formats (`.docx`, `.xlsx`, `.pptx`).

The suite can be connected with your `Nextcloud` instance bringing you the ability to edit and co-author office documents right from the `Nextcloud` frontend.
You can connect the suite with your Nextcloud instance, bringing you the ability to edit and co-author office documents right from the Nextcloud frontend.

This tutorial will describe how to install `ONLYOFFICE Document Server` and connect it to your Nextcloud instance via the `integration app`.
This tutorial will describe how to install ONLYOFFICE Document Server and connect it to your Nextcloud instance via the `integration app`.

**Prerequisites**

* Ubuntu 20.04 server
* A domain for ONLYOFFICE Document Server (e.g. yourdomain.com)
* Your Nextcloud installed on a different machine
* Ubuntu 24.04 server
* A domain for the ONLYOFFICE Document Server (e.g. example.com)
* Nextcloud installed on a different machine

## Step 1 - Set up Docker repository

The easiest way to start an instance of `ONLYOFFICE Document Server` is to use Docker. Before you install Docker on a new host machine, you need to set up the Docker repository:
The easiest way to start an instance of ONLYOFFICE Document Server is to use Docker. Before you install Docker on a new host machine, you need to set up the Docker repository:

```shell
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sh get-docker.sh
curl -fsSL https://get.docker.com -o get-docker.sh
sh ./get-docker.sh --dry-run # Check which steps this script will run
sh ./get-docker.sh
```

## Step 2 - Install ONLYOFFICE Document Server
Expand All @@ -46,77 +47,99 @@ Run Docker and execute the following command to install `ONLYOFFICE Document Ser
sudo docker run -i -t -d -p 80:80 --restart=always onlyoffice/documentserver
```

For a persistent installation use a docker-compose.yml file and manage the container with compose. This enables users to version config files and easily restore them on different machines. [Link to the yml file](https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/docker-compose.yml).
For a persistent installation use a `docker-compose.yml` file and manage the container with compose. This enables users to version config files and easily restore them on different machines. [Link to the YAML file](https://github.com/ONLYOFFICE/Docker-DocumentServer/blob/master/docker-compose.yml).

Now your ONLYOFFICE Docs should be available at `http://server_ip`.

## Step 3 - Switch to HTTPS using certbot

The easiest way to switch `ONLYOFFICE Docs` to HTTPS is to automatically get Let's Encrypt SSL Certificates using certbot.
Run the `ONLYOFFICE Docs` Docker container specifying ports 80 and 443 and setting your own values for the variables:
The easiest way to switch ONLYOFFICE Docs to HTTPS is to automatically get Let's Encrypt SSL Certificates using certbot.
Run the ONLYOFFICE Docs Docker container specifying ports 80 and 443 and setting your own values for the variables:

```shell
sudo docker run -i -t -d -p 80:80 -p 443:443 \
-e LETS_ENCRYPT_DOMAIN=yourdomain.com -e [email protected] onlyoffice/documentserver
sudo docker run -i -t -d -p 80:80 -p 443:443 --restart=always \
-e LETS_ENCRYPT_DOMAIN=example.com -e [email protected] onlyoffice/documentserver
```

Where:

* LETS_ENCRYPT_DOMAIN - a domain name to use for the certificate.
* LETS_ENCRYPT_MAIL - an email used for registration and recovery contact.
* `LETS_ENCRYPT_DOMAIN` - a domain name to use for the certificate.
* `LETS_ENCRYPT_MAIL` - an email used for registration and recovery contact.

The letsencrypt.org CA-signed certificate will be automatically generated and installed to your server. Now your ONLYOFFICE Docs should be available at the https://yourdomain.com address.
The letsencrypt.org CA-signed certificate will be automatically generated and installed to your server. Now your ONLYOFFICE Docs should be available at the https://example.com address.

## Step 4 - Get ONLYOFFICE connector for Nextcloud

Launch `Nextcloud` as an admin, click your user icon in the upper right corner, switch to + Apps, find `ONLYOFFICE` in the list of available applications (section ‘Office & text’), and click the Download and enable button.
Access you Nextcloud and login as admin.

* Click your user icon in the upper right corner
* Switch to `+ Apps`
* Go to "Office & text"
* Search for `ONLYOFFICE` and click the "Download and enable" button.

## Step 5 - Configure ONLYOFFICE within Nextcloud

Click your user icon in the upper right corner, go to Settings and find the `ONLYOFFICE` settings page in the Administration section.
* Click your user icon in the upper right corner
* Switch to `Admninistration settings` and go to the `ONLYOFFICE` page

Specify the address of the machine with `ONLYOFFICE` installed. Make sure the `Nextcloud` server address is accessible from `ONLYOFFICE Document Server` for correct work.
![](images/1-server-administration-settings.png)

Enter the Secret key in the corresponding field. Specify the same secret key in the `ONLYOFFICE Document Server` config file https://api.onlyoffice.com/editors/signature/ to enable the validation.
| Field | Description |
| ----------------------- | ----------- |
| ONLYOFFICE Docs address | Enter the address of the server that has ONLYOFFICE Docs installed. For it to work, make sure the server that has ONLYOFFICE installed can successfully build a connection to the server that has Nextcloud installed. (e.g. double-check firewall rules) |
| Secret key (leave blank to disable) | Enter a secret key. The key you specify in Nextcloud has to be identical to the key specified in the config file on the server that has ONLYOFFICE Docs installed. For more information about the secret key, see [api.onlyoffice.com/editors/signature](https://api.onlyoffice.com/editors/signature/) and "ONLYOFFICE Docs config file" below this table. |
| Advanced server settings | Sometimes your network configuration might not allow using public addresses for requests between Nextcloud and the ONLYOFFICE Document Server. The Advanced server settings section allows you to set the ONLYOFFICE Document Server address for internal requests from the Nextcloud server and the returning Nextcloud address for internal requests from the ONLYOFFICE Document Server. |

Sometimes your network configuration might not allow the requests between installed `Nextcloud` and `ONLYOFFICE Document Server` using the public addresses. The Advanced server settings section allows you to set the `ONLYOFFICE Document Server` address for internal requests from `Nextcloud` server and the returning `Nextcloud` address for internal requests from `ONLYOFFICE Document Server`.
<br>

Once done, save the server settings.
> **ONLYOFFICE Docs config file:**
>
> This tutorial used Docker to install the ONLYOFFICE Documentation Server. For this reason, you have to access the ONLYOFFICE Docs Docker container to view the config file:
>
> ```bash
> docker container ls
> docker exec -it <container-id> /bin/bash
> cat /etc/onlyoffice/documentserver/local.json
> ```

![](images/1-server-settings.png)
<br>

Once done, save the server settings.

## Step 6 - Configure additional settings

Once you’ve done with the server settings, you can adjust additional ones which are not mandatory but will make your user experience more comfortable.
Once you’re done with the server settings, you can adjust additional ones which are not mandatory but will make your user experience more comfortable.

Restrict access to the editors to user groups within your instance, enable or disable the Open file in the same tab option, select file formats that will be opened with `ONLYOFFICE` by default, etc.

`docx`, `xlsx` and `pptx` files are opened directly for editing, all other formats will require a preliminary conversion. The Open the file for editing setting allows you to select `csv`, `odp`, `ods`, `odt`, `rtf` and `txt` formats to be to auto-converted and opened directly for editing as well.
`docx`, `xlsx` and `pptx` files are opened directly for editing, all other formats will require a preliminary conversion. The `Open the file for editing` setting allows you to select `csv`, `odp`, `ods`, `rtf` and `txt` formats to be auto-converted and opened directly for editing as well.

The Editor customization settings section allows you to adjust the editor interface and change the presence or absence of the additional buttons.
The `Editor customization settings` section allows you to adjust the editor interface and change the presence or absence of the additional buttons.

What’s more, you can activate Force Save and select one of the Review modes for viewing. It allows users to see the changes made in a reviewed document when it’s shared for viewing: with Final mode you will see the document with all the proposed changes accepted, with Markup the proposed changes are highlighted, with Original you’ll see the initial version of a document with no changes.
What’s more, you can activate "Force Save" and select one of the review modes for viewing. It allows users to see the changes made in a reviewed document when it’s shared for viewing: With `Final` mode, you will see the document with all the proposed changes accepted. With `Markup` mode, the proposed changes are highlighted. With `Original` mode, you’ll see the initial version of a document with no changes.
Once you are ready, don’t forget to save the changes.

![](images/2-common-settings.png)
![](images/2-common-settings-modes.png)

**Document templates**

You can add your own templates and use them for creating new documents. Upload a new template by clicking on the plus icon next to the Common templates section:

![](images/3-templates.png)
![](images/3-templates-letter.png)

**Watermarks**

`ONLYOFFICE` integrated in your `Nextcloud` allows you to insert watermarks into your docs to protect any confidential or sensitive information they might contain. To activate watermarking, check the Enable watermarking box in the Secure view settings section:
ONLYOFFICE integrated in your Nextcloud allows you to insert watermarks into your docs to protect any confidential or sensitive information they might contain. To activate watermarking, check the `Enable watermarking` box in the `Secure view` settings section:

You are able to replace the default watermark text with your own using the supported placeholders {userId} and {date}. These placeholders will be displayed individually for each user when opening a file.

You can also define groups to differentiate users for whom the watermark will be displayed as well as select types of shares where the watermark has to be shown.

![](images/4-watermarking.png)
![](images/4-watermarking-admin.png)

## Conclusion

You have installed `ONLYOFFICE Docs` (Document Server) and connected it to your `Nextcloud` instance. Now you’re able to edit and co-author your documents, spreadsheets, and presentations right within `Nextcloud`.
You have installed ONLYOFFICE Docs (Document Server) and connected it to your Nextcloud instance. Now you’re able to edit and co-author your documents, spreadsheets, and presentations right within Nextcloud.

##### License: MIT

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.