Prerequisites

It’s assumed that you have already set up a Nextcloud server which can be on any Linux distribution. If you use Ubuntu 16.04 or Arch Linux, then you can check out the following easy-to-understand guides.

The Collabora Online server and Nextcloud server can be on the same machine or on two different machines. This tutorial shows how to install Collabora online server on Ubuntu 16.04 using a Docker image built by Collabora and Nextcloud. Then integrate it with an existing Nextcloud server.

Step 1: Install Docker on Ubuntu 16.04

If you want the latest Docker version, you can install Docker from Docker’s APT repository. For simplicity, this tutorial install Docker from the default Ubuntu software repository. Fire up a terminal window (CTRL+ALT+T) and run the following command to install Docker from Ubuntu repository.

sudo apt update
sudo apt install docker.io

Once installed, the Docker daemon should be automatically started. You can check its status with:

systemctl status docker

If it’s not running, then start the daemon with this command:

sudo systemctl start docker

And enable autostart at boot time:

sudo systemctl enable docker

Be default, Docker uses AUFS as the storage driver on Debian and Ubuntu. In order to make it work with Collabora online office, you will need to switch to the device mapper storage driver by following the instructions below.

The Collabora online server will be listening on port 9980 of localhost (127.0.0.1) as can be shown by issuing this command:

sudo netstat -lnpt

Step 3: Set up Reverse Proxy

Nextcloud server requires a TLS/SSL certificate on the Collabora online server, so we will need to create a virtual host, give the virtual host a domain name, install TLS/SSL certificate and set up a reverse proxy. We can use either Apache or Nginx to achieve this.

First let us see how to do this with Apache.

Set up Apache Virtual Host

Install Apache web server with the following command:

sudo apt install apache2

Run the following command to create an Apache virtual host file. Replace the domain name with your actual domain name for Collabora online server. Don’t forget to create an A record for this domain name.

sudo nano /etc/apache2/sites-available/office.your-domain.com.conf

Put the following text into the file.

<VirtualHost *:80>
ServerName office.your-domain.com
</VirtualHost>

Save and close the file. Enable this virtual host with the following command:

sudo a2ensite office.your-domain.com.conf

Then restart Apache.

sudo systemctl restart apache2

HTTPS helps us prevent man-in-the-middle attack and password sniffing. We can obtain a free TLS/SSL certificate from Let’s Encrypt CA. First Let’s install the certbot client. The client is still named letsnecrypt in Ubuntu repository. The following command will install the client and apache plugin.

sudo apt install letsencrypt python-letsencrypt-apache

Now issue the following command to obtain a free TLS/SSL certificate. Replace the red-colored text with your actual data.

Update: Nextcloud might have changed the Apps interface. If you can’t find Productivity tab, then go to Not Enabled tab, find and enable Collabora Online connector app. The Collabora Online connector app might also changed its name to Collabora Online.