Alert : Read this first :
This How To is only for Home Purpose Only, do not use it on a Production Site. There is a restriction with this Docker image, 10 differents documents at the same time, or 20 connections max at the same time.
On your Home Installation, if the docker version works, donât try this HOW TO and use docker, it doesnât worth it.
Hello everyone, here is a Step by Step to use CODE out of Docker on your own server.
Why doing this ?
1- itâs long to compile LOOLWSD / LOLEAFLET and LIBREOFFICE
2- it requires more skills, linux beginers canât do it
3- it requires a lot of space (more than 5gb) a lot of shared server canât have a lot of space for that. I have a server with only 10GB SSD for example, i canât compile LIBREOFFICE
4- You donât have to setup a proxy/reverse proxy with apache or ngnix
Iâve made and test it on a Ubuntu Server 16.04.1 (it should work well too on Debian last version)
I have also Php 7.0.8 / MariaDB Server 10.1
So first you need a working Nextcloud installation, Apache or Ngnix based with HTTPS and real certs from Letsencrypt or other legit CA.
Then you need docker installed.
A little help with docker, when you run a docker image you will have a long string as an ID for this instance, you can stop it and reload it. I will call this string during this HOWTO : CONTENER_ID
So letâs begin, first you need to lunch the docker image of Collabora, but we wonât use it, so we will lunch it with the minimal options:
docker pull collabora/code
docker run -t -d -p 127.0.0.1:9980:9980 --restart always --cap-add MKNOD collabora/code
You will have as a result the CONTENER_ID : for me itâs 86ac801d0fa9f157c58a1b598455fd0baaea4e305fdb836f0c6ad32be2d87b56
The goal now is to extract the files we need out of the docker image. We will use a lot this command :
docker cp CONTENER_ID:/path/inside/dockerimage /path/inside/harddrive
So here the list of command you will use :
docker cp CONTENER_ID:/opt/collaboraoffice5.1/ /opt/
docker cp CONTENER_ID:/usr/bin/loolforkit /usr/bin/
docker cp CONTENER_ID:/usr/bin/loolmap /usr/bin/
docker cp CONTENER_ID:/usr/bin/loolmount /usr/bin/
docker cp CONTENER_ID:/usr/bin/looltool /usr/bin/
docker cp CONTENER_ID:/usr/bin/loolwsd /usr/bin/
docker cp CONTENER_ID:/usr/bin/loolwsd-systemplate-setup /usr/bin/
docker cp CONTENER_ID:/etc/loolwsd/ /etc/
docker cp CONTENER_ID:/usr/share/loolwsd/ /usr/share/
docker cp CONTENER_ID:/usr/lib/libPocoCrypto.so.45 /usr/lib/
docker cp CONTENER_ID:/usr/lib/libPocoFoundation.so.45 /usr/lib/
docker cp CONTENER_ID:/usr/lib/libPocoJSON.so.45 /usr/lib/
docker cp CONTENER_ID:/usr/lib/libPocoNet.so.45 /usr/lib/
docker cp CONTENER_ID:/usr/lib/libPocoNetSSL.so.45 /usr/lib/
docker cp CONTENER_ID:/usr/lib/libPocoUtil.so.45 /usr/lib/
docker cp CONTENER_ID:/usr/lib/libPocoXML.so.45 /usr/lib/
Let kill docker :
docker stop CONTENER_ID
docker rm CONTENER_ID
Itâs was enought for Collabora 1.0 but, since Collabora 2.0, we have to install some libraries for getting it working.
apt-get install libcups2 libgl1-mesa-glx libsm6 libpixman-1-0 libxcb-shm0 libxcb-render0 libxrender1 libcairo2-dev
Now we start the Configuration. Letâs open loolwsd.xml with your favorite text editor :
nano /etc/loolwsd/loolwsd.xml
Line 12 add /usr/share/loolwsd
no / after loolwsd between <file_server_root_path> and
</file_server_root_path>
Line 30 to Line 32 modify the path to find the cert files.
Line 38 add a line to allow your Server to connect to Collabora Online :
<host desc="Regex pattern of hostname to allow or deny." allow="true">your.fqdn.com</host>
Line 48 the same :
your.fqdn.com
Line 53 â 54 configure a Username and a Password
Now, activate the Experimental App Collabora for Nextcloud, after that go into your nextcloud admin panel and go to the new section Collabora Online and insert this : https://your.fqdn.com:9980
Then, we will create user lool and some chown â chmodâŚ
useradd lool
sudo setcap cap_fowner,cap_mknod,cap_sys_chroot=ep /usr/bin/loolforkit
sudo setcap cap_sys_admin=ep /usr/bin/loolmount
mkdir /var/cache/loolwsd/
mkdir /opt/lool/child-roots/
chown âR lool:lool /var/cache/loolwsd/
chown âR lool:lool /opt/lool/child-roots/
Now we will lunch the system template setup :
sudo /usr/bin/loolwsd-systemplate-setup /opt/lool/systemplate /opt/collaboraoffice5.1
sudo chown -R lool:lool /opt/lool/systemplate
In order to finish this Step by Step we will create loolwsd service : (thanks to @depawlur)
CAUTION : ITâS ONLY FOR SYSTEMD SYSTEM LIKE UBUNTU 16.04, search How to make a service in Fedora, CentOs or otherâŚ
nano /etc/systemd/system/loolwsd.service
[Unit]
Description=loolwsd as a service
[Service]
User=lool
ExecStart=/usr/bin/loolwsd --o:sys_template_path=/opt/lool/systemplate --o:lo_template_path=/opt/collaboraoffice5.1 --o:child_root_path=/opt/lool/child-roots --o:file_server_root_path=/usr/share/loolwsd
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
then do:
sudo systemctl enable /etc/systemd/system/loolwsd.service
sudo systemctl daemon-reload
sudo systemctl start loolwsd.service
Itâs Time to test your Collabora Online.
If something have some lack of explaination, tell it to me, or if you have a more simple solution, tell it to me too.
Now updates ?
Well i donât know how to update, maybe we will have to delete all and start with the last docker image ?
Thanks for helping me @depawlur @egon @SpiGAndromeda