Nextcloud: Install Collabora Online

This installation guide is tested with Nextcloud 11, 12 and 13 on Ubuntu 16.04.

See also installation instructions for Nextcloud 15 on Ubuntu 18.04.


Setup Subdomain

on your nameserver, for example office.domain.xx. The subdomain is essential for running a Collabora online server.

Install SSL Certificate

Install the Collabora Online Server

docker pull collabora/code
docker run -t -d -p -e 'domain=cloud\\.domain\\.xx\|nc\\.domain2\\.xx' -e 'username=admin' -e 'password=Secret.Password' --restart always --cap-add MKNOD collabora/code

Adjust domains, username and password. If you have more than one vHost with Collabora, be sure to add them in the docker start command. Otherwise you’ll get an error message:

Unauthorised WOPI host

Add Collabora to services

vi /etc/services
collabora     9980/tcp     # Nextcloud
netstat -pat | grep collabora
tcp   0    0    localhost:collabora     *:*    LISTEN     9756/docker-proxy

Install the Apache Reverse Proxy

a2enmod proxy
a2enmod proxy_wstunnel
a2enmod proxy_http
a2enmod ssl

Configure a subdomain to proxy the traffic

<VirtualHost *:80>
  ServerName office.domain.xx
  ServerAdmin webmaster@domain.xx

<IfModule mod_ssl.c>
    ServerName office.domain.xx:443
    ServerAdmin webmaster@domain.xx

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/office.domain.xx/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/office.domain.xx/privkey.pem

    SSLProtocol all -SSLv2 -SSLv3
    SSLHonorCipherOrder on

    # Encoded slashes need to be allowed
    AllowEncodedSlashes NoDecode

    # Container uses a unique non-signed certificate
    SSLProxyEngine On
    SSLProxyVerify None
    SSLProxyCheckPeerCN Off
    SSLProxyCheckPeerName Off

    ProxyRequests Off

    # keep the host
    ProxyPreserveHost On

    # static html, js, images, etc. served from loolwsd
    # loleaflet is the client part of LibreOffice Online
    ProxyPass /loleaflet retry=0
    ProxyPassReverse /loleaflet

    # WOPI discovery URL
    ProxyPass /hosting/discovery retry=0
    ProxyPassReverse /hosting/discovery

    # Main websocket
    ProxyPassMatch "/lool/(.*)/ws$" wss://$1/ws nocanon

    # Admin Console websocket
    ProxyPass /lool/adminws wss://

    # Download as, Fullscreen presentation and Image upload operations
    ProxyPass /lool
    ProxyPassReverse /lool

Adjust domain and IP address.

Restart Apache

service apache2 restart

WOPI discovery URL


Credentials are of the docker run command as specified above

... -e 'username=admin' -e 'password=Secret.Password' ...

Install Collabora Online app

of the Nextcloud app store:

Configure the app

Go to Admin Settings | Collabora Online and enter the subdomain

If the Collabora Online Server is not running or not configured in the Nextcloud administration, you’ll get an intern server error:

Also check if SSL certificates are setup correct.


Your have successfully installed and configured Collabora Online Office.