Collabora on the same server with Nextcloud set up with snap

Hi there,

I have set up Nextcloud with snap, following the instruction provided here: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-nextcloud-on-debian-9

I am just wondering if it would be possible to set up Collabora Online on the same server, along with the Nextcloud instance set up with snap. Do I need another server to run that?

Thanks in advance,

Hello,
I haven’t dug deep enough recently to have it by-the-numbers, but hopefully I can nudge you in the right direction. It’s perfectly possible to have both services running on the same server, so long as you’re aware of the hang-ups.

Even though they’re on the same server, you’ll want Nextcloud and Collabora to have separate DNS names, to prevent cross-site-scripting attacks. The simplest way would be to add a CNAME record (e.g., ‘collabora.example.com’) which points to your existing A record (‘nextcloud.example.com’).

Since both Nextcloud and Collabora need to be reachable on ports 80 and 443, you’ll want a reverse proxy set up in front of them. For me, that’s an Apache web server (with a LetsEncrypt wildcard cert) that is reachable on those ports, and then forwards requests to Nextcloud or Collabora, as appropriate. Nextcloud and Collabora are listening on non-standard ports so they don’t conflict with that Apache instance or each-other.

Basically, you’d be running 3 Apache instances on the same server: 1 as part of the Nextcloud snap, 1 as part of Collabora’s Docker image (iirc), and 1 as the host, passing requests through to them.

1 Like

Thanks, I’ll give a try once :slight_smile:

Hello,

I stuck on the same situation as You describe. I have nextcloud and collabora on the same IP, same server, same FQDN, it’s working, but only with opened 9980 port on firewall. I trying to figure it out using your suggestion, could you please describe it more ?
3 apache instance you mean really 3 apaches or one apache with 3 virtualhosts ?
I can imagine to run nextcloud on let’s say port 444 and collabora on 446 (I am using https only, so I guess one port for each server will be ok) and reverse proxy on port 443. But I not sure howto configure all of them. Is really necessary for collabora port 443 ? I thought 9980 is enough

Thank you

Since you’re running Nextcloud and Collabora inside separate containers, each has an Apache instance. If you’re ok with opening multiple ports, and Collabora is configured to use the port you’ve opened for it, then you don’t need a 3rd Apache.

If you want all traffic from outside to go to port 443, then yes, you’ll need the 3rd Apache (or another web service) to listen there and forward connections to Nextcloud and Collabora as you describe.

For how to configure them, the link above is a very basic starter for Apache.
Alternatively, there are some new examples for using nginx instead of Apache: the snap’s wiki, and config files here on the forum.

Well, I am not using a docker or containers, I placed NC and Collabora on the same physical server. That’s why I am strugling with Apaches. Now I have a separate FQDN for each of them and trying to setup Apaches.

If that’s the case, you can absolutely take the recommended configurations and combine them to make 1 Apache instance with 2 virtualhosts.
Just to be clear, though, I’d count snaps as ‘containers’ for this purpose, since an Apache instance inside a snap has a configuration of its own, separate from instances on the host or in other snaps.

I am strugling with in section nextcloud.xy.com:

ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/

I tried to used a port 443, but it is not working and I think it is not important. When I ommit these rows, my nexcloud.xy.com is working, collabora.xy.com working too, but when I try to rearch collabora without port :9980, I get error Could not establish connection to the Collabora Online server., with port 9980 its working nice. I thing something is wrong with reverse proxy.

Well, it’s working now without a port 9980 opened. But I have to check Disable certificate verification, which is weird, cos I have multidomain cert from Let’s Encrypt for both of FQDN nextcloud.xy.com and collabora.xy.com.