Ubuntu – Install Collabora Online (CODE) on Nextcloud server on Ubuntu 22.04

Step by Step CODE Instructions

Step 1 – Add CODE (Collabora Online Development Edition) Repository for Ubuntu 

We need to obtain and install some additional packages on our Ubuntu machine in order to enable the online editing capabilities.  Collabora provide Ubuntu support and offer official package repository for Ubuntu.   In order to access this repository, we will need to tell our Ubuntu machine that we will be using it.  To add a third party repo on Ubuntu, you will need to issue the following command 

1. Import the signing key

CODE packages are digitally signed by Collabora Productivity Ltd. First step is to import the signing key.

On deb based distributions use the following command:cd /usr/share/keyrings sudo wget https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg

On rpm based distributions use the following command:wget https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos7/repodata/repomd.xml.key && sudo rpm –import repomd.xml.key

2. Add CODE package repositories

On deb based distributions create /etc/apt/sources.list.d/collaboraonline.sources with the following contents:

sudo vi /etc/apt/sources.list.d/collaboraonline.sources

Types: deb

URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-ubuntu2204

Suites: ./ Signed-By: /usr/share/keyrings/collaboraonline-release-keyring.gpg

On rpm based distributions use the following commands:

RHEL, CentOS, Fedora, etc.:sudo yum-config-manager –add-repo https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-rpm

SUSE:sudo zypper ar ‘https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-rpm’ ‘CODE’ sudo zypper mr -r ‘CODE’ # enable auto refresh

3. Install packages

On deb based distributions use the following command:sudo apt update && sudo apt install coolwsd code-brand

On RHEL, CentOS, Fedora, etc. use the following command:sudo yum install coolwsd CODE-brand

On SUSE, use the following command:sudo zypper ref && sudo zypper in coolwsd CODE-brand

This is the minimal installation, without localizations. For full installation install ‘collaboraoffice*’ packages.

  1. Update the repository.sudo apt update -y
  2. Install Collabora CODE using apt.sudo apt install coolwsd code-brand -y

How to Configure Collabora

Collabora configuration depends on an XML file at /etc/coolwsd/coolwsd.xml. Although this file can be edited directly, it is faster to use the coolconfig tool to make configuration changes. To configure Collabora, follow the steps below:

  1. With the current configuration, the coolwsd service continues to fail and restart. This happens because Collabora cannot establish an HTTPS connection with the local host. Use the coolconfig tool to disable HTTPS on the connection.sudo coolconfig set ssl.enable false sudo coolconfig set ssl.termination true
  2. Only certain designated hosts are allowed to access the Collabora server. To designate Nextcloud as a trusted client, set storage.wopi.host to the Nextcloud domain, for example, nextcloud.example.com. In the following command, substitute the real domain name in place of example.com.sudo coolconfig set storage.wopi.host nextcloud.example.com
  3. Create an administration account and provide a password for the account. When prompted, enter the admin username. Then, enter the admin password twice.sudo coolconfig set-admin-password
  4. Restart the coolwsd service and verify the service status.sudo systemctl restart coolwsd sudo systemctl status coolwsd

How to Configure the Collabora Virtual Host

Note

For details on how to configure the Apache virtual host, see the Collabora Apache Proxy Settings from the Collabora installation guide. Enable the proxyproxy_httpproxy_connect, and proxy_wstunnel modules using the a2enmod command.

Create a collabora APACHE virtual host file.

sudo vi /etc/apache2/sites-available/collabora

<VirtualHost *:443>

ServerName office.example.com

Options -Indexes

 ########################################

 # Reverse proxy for Collabora Online   #

 ########################################

 AllowEncodedSlashes NoDecode

 ProxyPreserveHost On

 # static html, js, images, etc. served from coolwsd

 # browser is the client part of Collabora Online

 ProxyPass           /browser http://127.0.0.1:9980/browser retry=0

 ProxyPassReverse    /browser http://127.0.0.1:9980/browser

 # WOPI discovery URL

 ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0

 ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery

 # Capabilities

 ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0

 ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities

 # Main websocket

 ProxyPassMatch      “/cool/(.*)/ws$”      ws://127.0.0.1:9980/cool/$1/ws nocanon

 # Admin Console websocket

 ProxyPass           /cool/adminws ws://127.0.0.1:9980/cool/adminws

 # Download as, Fullscreen presentation and Image upload operations

 ProxyPass           /cool http://127.0.0.1:9980/cool

 ProxyPassReverse    /cool http://127.0.0.1:9980/cool

 # Compatibility with integrations that use the /lool/convert-to endpoint

 ProxyPass           /lool http://127.0.0.1:9980/cool

 ProxyPassReverse    /lool http://127.0.0.1:9980/cool

SSLEngine on

SSLCertificateFile /etc/ssl/private/CertificateBundle1.pem

SSLCertificateKeyFile /etc/ssl/private/svcloud1.pem

</VirtualHost>

Create a collabora NGINX virtual host file.

sudo vi /etc/nginx/sites-available/collabora

Leave a Reply

Your email address will not be published. Required fields are marked *

RELATED POST

How to automatically restart Linux services with Systemd

Getting your Linux deployments working reliably is of paramount concern for production applications. One way to guarantee that a service…

How to Install SFTPGo on Ubuntu 22.04

Setup UFW Firewall For security reasons, it is recommended to install and configure the UFW firewall in your system. First,…

Executing Bash Scripts at Startup in Ubuntu Linux

Creating a Bash script in Ubuntu To create a Bash script in Ubuntu, you can use any text editor of…

How To Clear PHP’s Opcache

PHP can be configured to store precompiled bytecode in shared memory, called Opcache. It prevents the loading and parsing of PHP…