<\/span><\/h2>\n\n\n\nFirst, we will install some prerequisites:<\/p>\n\n\n\n
sudo apt install apt-transport-https ca-certificates<\/pre>\n\n\n\nOnce done, add the Collabora key and repository because it does not exist in the official Ubuntu 22.04 repo.<\/p>\n\n\n\n
cd \/usr\/share\/keyrings\n\nsudo wget https:\/\/collaboraoffice.com\/downloads\/gpg\/collaboraonline-release-keyring.gpg<\/pre>\n\n\n\nThe key is added, now create the following file with the command below:<\/p>\n\n\n\n
touch \/etc\/apt\/sources.list.d\/collaboraonline.sources<\/pre>\n\n\n\nOpen this file with your favorite editor and paste the following lines of code:<\/p>\n\n\n\n
Types: deb\nURIs: https:\/\/www.collaboraoffice.com\/repos\/CollaboraOnline\/CODE-ubuntu2004\nSuites: .\/\nSigned-By: \/usr\/share\/keyrings\/collaboraonline-release-keyring.gpg\n<\/pre>\n\n\n\nSave the file, close it, update the system and install the Collabora Online service.<\/p>\n\n\n\n
sudo apt update -y\n\nsudo apt install coolwsd code-brand -y\n<\/pre>\n\n\n\nAfter installation, start and enable the Collabora coolwsd<\/strong> service.<\/p>\n\n\n\nsudo systemctl start coolwsd && sudo systemctl enable coolwsd<\/pre>\n\n\n\nTo check the status of the service, execute the following command:<\/p>\n\n\n\n
sudo systemctl status coolwsd<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
root@host:~# systemctl status coolwsd\n\u25cf coolwsd.service - Collabora Online WebSocket Daemon\n Loaded: loaded (\/lib\/systemd\/system\/coolwsd.service; enabled; vendor preset: enabled)\n Active: active (running) since Thu 2023-06-22 06:27:10 CDT; 399ms ago\n Main PID: 3995 (coolwsd)\n Tasks: 1 (limit: 4557)\n Memory: 1.1M\n CPU: 390ms\n CGroup: \/system.slice\/coolwsd.service\n \u2514\u25003995 \/usr\/bin\/coolwsd --version --o:sys_template_path=\/opt\/cool\/systemplate --o:child_root_path=\/opt\/cool\/child-roots --o:file_server_root_path=\/usr\/sha>\n\nJun 22 06:27:10 host.test.vps systemd[1]: Started Collabora Online WebSocket Daemon.\n<\/pre>\n\n\n\nBefore we connect Collabora with the NextCloud instance, we need to execute the following commands:<\/p>\n\n\n\n
sudo coolconfig set ssl.enable false\n\nsudo coolconfig set ssl.termination true\n<\/pre>\n\n\n\nThe commands above are for disabling the TLS because the service is not able to find the certificate file. We will enable these two settings later.<\/p>\n\n\n\n
Next is to allow connection to your existing Nextcloud instance, using the Nextcloud domain with the following command:<\/p>\n\n\n\n
sudo coolconfig set storage.wopi.host YourNextCloudDomain<\/strong><\/pre>\n\n\n\nAfter executing the command, you should receive the following output:<\/p>\n\n\n\n
root@host:~# sudo coolconfig set storage.wopi.host YourNextCloudDomain<\/strong>\nNo property, \"storage.wopi.host\", found in config file.\nAdding it as new with value: \"YourNextCloudDomain<\/strong>\"\nSaving configuration to : \/etc\/coolwsd\/coolwsd.xml ...\nSaved\n<\/pre>\n\n\n\nOnce done, set Collabora Online admin password:<\/p>\n\n\n\n
sudo coolconfig set-admin-password<\/pre>\n\n\n\nYou should enter the admin username and strong password.<\/p>\n\n\n\n
root@host:~# sudo coolconfig set-admin-password\nEnter admin username [admin]: admin\nEnter admin password:\nConfirm admin password:\nSaving configuration to : \/etc\/coolwsd\/coolwsd.xml ...\nSaved<\/pre>\n\n\n\nRestart the Collabora service after any changes in \/etc\/coolwsd\/coolwsd.xml<\/strong><\/p>\n\n\n\nsudo systemctl restart coolwsd<\/pre>\n\n\n\n<\/span>Step 3. Configure Apache as a Reverse Proxy<\/span><\/h2>\n\n\n\nFinally, when Collabora Online is installed, and everything is OK with the service, we can configure the reverse proxy. Additional info about this is that the Collabora service is running on port 9980. To check this, execute the following command:<\/p>\n\n\n\n
root@host:~# netstat -tunlp | grep 9980<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
root@host:~# netstat -tunlp | grep 9980\ntcp6 0 0 :::9980<\/strong> :::* LISTEN 8310\/coolwsd<\/strong><\/pre>\n\n\n\nCreate the Apache virtual host file:<\/p>\n\n\n\n
touch \/etc\/apache2\/sites-available\/collabora.conf<\/pre>\n\n\n\nOpen it with your favorite editor, and paste the following lines of code:<\/p>\n\n\n\n
<VirtualHost *:80>\n ServerName collabora.yourdomain.com\n AllowEncodedSlashes NoDecode\n ProxyPreserveHost On\n\n\n # static html, js, images, etc. served from coolwsd\n # browser is the client part of Collabora Online\n ProxyPass \/browser http:\/\/127.0.0.1:9980\/browser retry=0\n ProxyPassReverse \/browser http:\/\/127.0.0.1:9980\/browser\n\n\n # WOPI discovery URL\n ProxyPass \/hosting\/discovery http:\/\/127.0.0.1:9980\/hosting\/discovery retry=0\n ProxyPassReverse \/hosting\/discovery http:\/\/127.0.0.1:9980\/hosting\/discovery\n\n\n # Capabilities\n ProxyPass \/hosting\/capabilities http:\/\/127.0.0.1:9980\/hosting\/capabilities retry=0\n ProxyPassReverse \/hosting\/capabilities http:\/\/127.0.0.1:9980\/hosting\/capabilities\n\n\n # Main websocket\n ProxyPassMatch \"\/cool\/(.*)\/ws$\" ws:\/\/127.0.0.1:9980\/cool\/$1\/ws nocanon\n\n\n # Admin Console websocket\n ProxyPass \/cool\/adminws ws:\/\/127.0.0.1:9980\/cool\/adminws\n\n\n # Download as, Fullscreen presentation and Image upload operations\n ProxyPass \/cool http:\/\/127.0.0.1:9980\/cool\n ProxyPassReverse \/cool http:\/\/127.0.0.1:9980\/cool\n # Compatibility with integrations that use the \/lool\/convert-to endpoint\n ProxyPass \/lool http:\/\/127.0.0.1:9980\/cool\n ProxyPassReverse \/lool http:\/\/127.0.0.1:9980\/cool\n<\/VirtualHost>\n<\/pre>\n\n\n\nSave the file and close it. After that, enable the website and the proxy modules:<\/p>\n\n\n\n
sudo a2ensite collabora.conf\n\nsudo a2enmod proxy proxy_http proxy_wstunnel<\/pre>\n\n\n\nCheck the Apache syntax:<\/p>\n\n\n\n
apachectl -t<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
root@host:~# apachectl -t\nSyntax OK\n<\/pre>\n\n\n\nNow, you can restart the Apache service.<\/p>\n\n\n\n
sudo systemctl restart apache2<\/pre>\n\n\n\n