[How-To]: Self Hosted Collabora Office and then routed through Nextcloud

  • Problem: You want off Google Docs, but the CODE server for Nextcloud is abysmally slow on the official nextcloud docker and doesn't work at all on the Linuxserver Nextcloud container that most of us are using. The solution is to host your own Collabora Office container and route it through through your Nextcloud install.


    Prerequisite:

    You have docker installed and running (this should probably go w/o saying)


    You have successfully gotten a cert with swag. It doesn't matter if you're using duckdns, dns, cloudflare, whatever.


    Because you're using swag, the below will assume you're using the Linuxserver version of Nextcloud (it may work with the official container as well, I don't know)


    You have Nextcloud running through swag and can securely access it at https://nextcloud.yourdomain.url . This will go over in detail using subdomains. It can probably be modified to use subfolder, I've just never used it in that manner and you're on your own with it. You will also need admin privileges on the Nextcloud install


    You are comfortable either using Portainer Stacks or docker-compose. I'll be proceeding using a stack in Portainer, but it should work just the same with docker-compose.


    You can identify the network mode of your swag container. In Portainer click on Networks and find the network name assigned to your swag container. In my case, it's "swag_default". If you don't have Portainer, you can use the following command to get swag's network mode (below assumes your swag container is named "swag")


    Code
    docker inspect swag | grep NetworkMode

    You should get an output similar to this... which I dentifies swag's network mode.

    Code
    root@openmediavault:~# docker inspect swag | grep NetworkMode
                "NetworkMode": "swag_default",
    root@openmediavault:~# 


    Finally, I'm using the 64bit version of Nextcloud. This should work well w/ arm64 (the collabora container says it has am arm64 image).. but I've not ever set it up.


    Installation:

    Log in to Nextcloud as an admin user.


    Click your profile icon/Apps, and do a search for CODE. Completely uninstall the built in CODE server app. This is the default Collabora app on Nextcloud and is generally installed automatically on all new installs. If you don't uninstall it, it makes a mess in the GUI when this is done.


    Update on this part: My apologies on this next step. I somehow had originally combined my docker-compose for onlyoffice and collabora. The original I had here will not work for Collabora, but would with OnlyOffice. THIS one works with Collabora. Issue with OnlyOffice, is it doesn't allow access from mobile devices, where Collabora does. The below codebox is correct. Again, sorry.


    Next, go to Portainer, Add a new stack and name it collabora. Paste the following into the stack:


    Code
    version: "2.2"
    services:
      collabora:
        image: collabora/code
        container_name: collabora
        network_mode: swag_default  #Adjust
          ports:
          - 9980:9980


    As the compose states, set your network mode (Line 6).


    Once it deploys, watch the log and see if it flags any errors. When the container finishes deploying, go to https://your-server-ip:9980 . You'll get a security risk message, just accept it since we aren't open to the internet yet... Once accepted, you should just see a message that says "OK". This means the collabora container is working.


    Now, cd to your proxy-confs folder under swag. We need to create a new one.


    Now we need to create a collabora.subdomain.conf file and edit it. We can do that with:


    Code
    nano collabora.subdomain.conf


    Once it opens, copy/paste this in it's entirety.


    If you've not made any changes, etc.. and followed along exactly what I've put in this post, the only line you need to change is #37. Change that to your server's network IP


    Cntrl X, Y, then enter to save


    If you're using duckdns, you can skip this step. Log in to your panel, and create a CNAME "collabora". It may take a few minutes for the CNAME to go active. Make sure you can ping it at ping collabora.your-domain.url (cntrl C to stop).


    Once your CNAME responds to a ping go to your swag stack in Portainer and add "collabora" to your subdomains list. If you're using SUBDOMAINS=wildcard then you don't need to do this.


    Redeploy swag. Watch the log and make sure you get no errors. If you've defined your subdomains, make sure a new cert is pulled w/o error. Once it's done, go to https://collabora.yourdomain.url and you should now get the "OK" message, and the site is secured with a padlock. If it's not, you did something wrong and you need to fix it before proceeding or the next steps won't work.


    Now, go back to Nextcloud as an admin user, click your profile icon and then apps. Do a search for Nextcloud Office and install it.


    Now go back out to your folders, and create a folder to hold Templates. Doesn't matter what you name it, where you put it, etc.. just create one.


    Once that is done, go to your profile icon/settings. Under Personal, click on Office. Set your templates folder to the one you just created. Each user will have their own templates folder. So if you have multiple users that want to use NC Office... each one will need to create a templates folder and set it here (assuming they want to use the NC Office templates).


    Now under Administration on the same page, click on Office. On the top, CODE should be grayed out if you uninstalled CODE.. if you didn't, do it now otherwise it gets screwy with the GUI. Choose Use your own server


    Where it asks for the domain... https://collabora.yourdomain.url


    Uncheck the disable certificate box, and click Save. You should get a Green Check mark and a message the collabora server is reachable.


    Now go back out to the Nextcloud files section, click the + and choose an office document to create (or if you already have one, you can click it should open in NC Office).


    NC Office works very similarly to Google Docs. It constantly saves your document, so most progress is not lost if the browser is closed, etc. for some reason.


    Conclusions:


    I've been using NC Office for about 4-5mo before posting this (it's come up on reddit a number of times asking how to do this) and have been pretty happy with it. It seems plenty fast enough on my ancient server. I would not call myself a "heavy" user, but I've gotten a fair amount of use out of it and have been happy with it.


    Hope this helps

    Air Conditioners are a lot like PC's... They work great until you open Windows.


    Join us on Discord https://discord.gg/qcGj2upevS


    Edited 5 times, last by KM0201: Fixed a fairly significant error on my part... my apologies ().

  • KM0201

    Approved the thread.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!