How to install Collabora Online on Nextcloud 15 on a Debian 9 LEMP system. No docker required!

0. Install https support for apt

1
sudo apt install apt-transport-https ca-certificates

1. Add Collabora CODE repository

Import the Collabora CODE repository signing key:

1
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D

Add the Collabora CODE repository to the apt sources list:

1
2
3
# File: /etc/apt/sources.list.d/collabora.list
# Collabora CODE
deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian9 ./

Update apt database:

1
sudo apt update

2. Install Collabora/CODE

Install the Collabora packages:

1
sudo apt install loolwsd code-brand

3. Configure Collabora Online

Disble SSL

The default loolwsd configuration (/etc/loolwsd/loolwsd.xml) looks for an SSL certificate and key, which are not present, so lets disable SSL, and optionally enable SSL termination, then set up the reverse proxy.

1
2
3
4
5
# File: /etc/loolwsd/loolwsd.xml
    <ssl desc="SSL settings">
        <enable type="bool" default="true">false</enable>
        <termination desc="Connection via proxy where loolwsd acts as working via https, but actually uses http." type="bool" default="true">true</termination>
        # [...]

Setup WOPI storage

Adjust your trusted domain in /etc/loolwsd/loolwsd.xml by replacing cloud\.example\.com with the domain with the WOPI client you’re running:

1
2
3
4
5
6
# File: /etc/loolwsd/loolwsd.xml
    <storage desc="Backend storage">
        <filesystem allow="false" />
        <wopi desc="Allow/deny wopi storage. Mutually exclusive with webdav." allow="true">
            <host desc="Regex pattern of hostname to allow or deny." allow="true">localhost</host>
            <host desc="Regex pattern of hostname to allow or deny." allow="true">cloud\.example\.com</host>

Restart loolwsd

1
sudo systemctl restart loolwsd.service

4. Setup nginx as a reverse proxy

Setup nginx as a reverse proxy which will provide a valid ssl setup. We can either run this reverse proxy on a seperate (sub-)domain or add it to the same domain your Nextcloud runs on. Add a new server block to your nginx configuration or add the location entries to an existing one if you’re re-using the same domain.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File: /etc/nginx/sites-enabled/cloud.example.com
server {
  listen       443 ssl;
  server_name  cloud.example.com;
  # You can also set a dedicated domain instead:
  # server_name  office.example.com;

  ssl_certificate /path/to/your/certficate;
  ssl_certificate_key /path/to/your/key;

  # [...]

  # Static files
  location ^~ /loleaflet {
    proxy_pass http://127.0.0.1:9980;
    proxy_set_header Host $http_host;
  }

  # WOPI discovery URL
  location ^~ /hosting/discovery {
    proxy_pass http://127.0.0.1:9980;
    proxy_set_header Host $http_host;
  }

  # Capabilities
  location ^~ /hosting/capabilities {
    proxy_pass http://localhost:9980;
    proxy_set_header Host $http_host;
  }

  # Main websocket
  location ~ ^/lool/(.*)/ws$ {
    proxy_pass http://127.0.0.1:9980;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
  }

  # Download, presentation and image upload
  location ~ ^/lool {
    proxy_pass http://127.0.0.1:9980;
    proxy_set_header Host $http_host;
  }

  # Admin Console websocket
  location ^~ /lool/adminws {
    proxy_pass http://127.0.0.1:9980;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 36000s;
  }
}

Restart nginx:

1
sudo systemctl restart nginx

5. Install and config Collabora Online app

Install Collabora Office app.

Configure Nextcloud to use Collabora Office:

  • Navigate to Settings -> Collabora Online
  • Set Collabora Online server to https://cloud.example.com or whatever domain you use for your collabora office reverse proxy;
  • Apply settings.

Enjoy your new Collabora Online Office :-)

References