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.
- Update the repository.
sudo apt update -y
- 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:
- 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 thecoolconfig
tool to disable HTTPS on the connection.sudo coolconfig set ssl.enable false sudo coolconfig set ssl.termination true
- 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 ofexample.com
.sudo coolconfig set storage.wopi.host nextcloud.example.com
- Create an administration account and provide a password for the account. When prompted, enter the
admin username
. Then, enter theadmin password
twice.sudo coolconfig set-admin-password
- 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 proxy
, proxy_http
, proxy_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