What Do I Need?
- A Dedicated or VPS Linux Server
- Ubuntu
- Docker
What is Collabora?
Collabora is an amazing open-source software platform that’s essentially Microsoft Office Online with collaboration. It provides powerful on-premise office suites, for both online and offline, desktop solutions that enable document access, and a platform to author new content and work collaboratively. In this how-to guide, we’re going to be focusing on Collabora Development Edition (CODE), which is what’s directly integratable into Nextcloud and other office and collaboration platforms.
- Install Docker
In order to install Collabora, we’re going to use an awesome package installation and maintenance platform, Docker.sudo apt update
sudo apt install docker.io
- Once installed we want Docker to start automatically:
systemctl status docker
- If the service isn’t running, use the following command:
sudo systemctl start docker
- In order to enable auto-start on system reboot use the following command:
sudo systemctl enable docker
- Install and Run Collabora Online Server
- Next, let’s pull the latest build of the Collabora CODE implementation:
sudo docker pull collabora/code
- Next, run this docker container with the following command:
sudo docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=nextcloud\.example\.com' -e "extra_params=--o:ssl.enable=false --o:ssl.termination=true" --restart always collabora/code
- Replace nextcloud\.example\.com with your own Nextcloud hostname, preserving the double slashes. This is because Collabora only allows known hosts to access its service and we need to add Nextcloud hostname to the whitelist with domain= flag.
-d: Detached mode makes the container run in the background.
-t: Allocate a pseudo-TTY.
-p: Publish a container’s port to the host.
-e: Set environment variables. - Install net-tools:
sudo apt install net-tools
- The Collabora Online server will listen on port 9980 of localhost (127.0.0.1) by default.
sudo netstat -lnpt ¦ grep docker
- Replace nextcloud\.example\.com with your own Nextcloud hostname, preserving the double slashes. This is because Collabora only allows known hosts to access its service and we need to add Nextcloud hostname to the whitelist with domain= flag.
- Next, let’s pull the latest build of the Collabora CODE implementation:
- Set Up the Reverse Proxy
- Nextcloud servers require a TLS certificate to be on the Collabora Online server that they’re connecting to, so you’ll need to create a virtual host, give it a name, set up a reverse proxy and install the TLS certificate itself.
- Install the Apache webserver with the following command:
sudo apt install apache2
- Next, run the following command to create an Apache virtual host file:
sudo nano /etc/apache2/sites-available/collabora.conf
- Replace the domain name with your actual domain for Collabora Online and don’t forget to create an A record for this if you’re using a sub-domain.
<VirtualHost *:80> ServerName voxworx.xyz Options -Indexes ErrorLog "/var/log/apache2/collabora_error" # Encoded slashes need to be allowed AllowEncodedSlashes NoDecode # keep the host ProxyPreserveHost On # static html, js, images, etc. served from loolwsd # loleaflet is the client part of Collabora Online ProxyPass /loleaflet http://127.0.0.1:9980/loleaflet retry=0 ProxyPassReverse /loleaflet http://127.0.0.1:9980/loleaflet # 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 "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon # Admin Console websocket ProxyPass /lool/adminws ws://127.0.0.1:9980/lool/adminws # Download as, Fullscreen presentation and Image upload operations ProxyPass /lool http://127.0.0.1:9980/lool ProxyPassReverse /lool http://127.0.0.1:9980/lool </VirtualHost>
- Save and close the file using ctrl+x and following the instructions. In order to enable proxy traffic using Apache, you need to enable some additional modules:
sudo a2enmod proxy proxy_wstunnel proxy_http
- Enable the virtual host with the following command:
sudo a2ensite collabora.conf
- Next, you’ll need to restart Apache:
sudo systemctl restart apache2
- Set Up and Install TLS Certificate
- It’s now time to obtain a free TLS certificate from Let’s Encrypt. Use the following command to install the Let’s Encrypt client (certbot) from the official certbot PPA:
sudo apt install certbot
- Next, you need to install the Certbot Apache plugin.
sudo apt install python3-certbot-apache
- Then, use the following command to obtain a free TLS/SSL certificate:
sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email info@voxworx.xyz -d voxworx.xyz
- It’s now time to obtain a free TLS certificate from Let’s Encrypt. Use the following command to install the Let’s Encrypt client (certbot) from the official certbot PPA:
Conclusion
Look out for the next part of this how-to guide when we discuss how to connect a Collabora Online server to your own custom NextCloud instance for your own quick, efficient, and secure office and file collaboration suite.
- Do you need the best VPS? Read about our different offers.