# Nextcloud with Collabora/Docker on Gentoo

## NismoC32

Hi

I'm trying to get collabora to work on my Gentoo server, but have run in to some problems I haven been able to solve.

Se the details in this thread on Nextcloud:

https://help.nextcloud.com/t/problem-getting-collabora-to-work-in-gentoo-with-docker/23259

Let me know if more info is needed.

Maybe someone here can help figure out whats wrong.

PS: Havent gotten apache access_log to work ether.

Thanks.

----------

## NismoC32

It looks like connection to https://127.0.0.1 is refused when attempting to connect to 127.0.0.1:9980

When I run 'docker ps' I get the following list:

```
 CONTAINER ID   IMAGE                 COMMAND                  CREATED            STATUS                          PORTS

655ddcae4bc6    collabora/code      "/bin/sh -c 'bash ..."    About an hour ago  Restarting (1) 42 seconds ago
```

Should the PORT show the connection info like 127:0.0.1:9980/tcp or something ?

I did use this command to start the docker image:

docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=office\\.mydomain\\.com' --restart always --cap-add MKNOD collabora/code

As explained here https://nextcloud.com/collaboraonline/

Is there something wrong here ?

----------

## msst

I have a nextcloud installation here as well. All working fine.

Was also once interested to install collabora. Then I saw it is only available as a docker crap version and have nor pursued it. Should anyone find out how to completely de-docker that stuff without a huge hassle and install it normally I may give it a try.

And by the way: If the docker stuff gives config troubles a normal installation likely bypasses that, because a normal installation should allow you to run it of your normal apache:80 system.

----------

## Elleni

I am in the same boat, have a nice nextcloud installation here, and did not install colabora online cause of docker version. Then I have seen onlyoffice which offers similar functionality, and there is even an ebuild that compiled fine:  

https://gpo.zugaina.org/app-office/onlyoffice

But I found no explanation where to go from there. If anyone is able to get it working, I would be glad to get any hint  :Smile: 

----------

## NismoC32

I do agree with you guys.

The only reason for trying to get docker/collabora to work is that it would be a nice tool for

me know when I'm studying in another country.

Maybe I should look into onlyoffice instead.

----------

## Elleni

if you do and find out what to do after compiling onlyoffice, please share  :Smile: 

----------

## NismoC32

Hmm I might be wrong here but the 'ebuild' in the link over is for the desktop version of the suite

and not what they call the integration edition that is needed for integration with cloud servers.

If you look at this link on the onlyoffcie's web page regarding nextcloud it looks like you have to pay

to get the integration edition.

Check this link: https://www.onlyoffice.com/connectors-nextcloud.aspx

You at lest get a 30 day trial time.

One more thing, it seems to only support MS office formats, so this is at least a deal breaker for me.

----------

## szatox

NismoC32, I had to install nc + collabora recently, it took a bit of digging on the internet, trying and failing, but I eventually got it ot work using those 2 guides:

https://docs.nextcloud.com/server/12/admin_manual/installation/source_installation.html

https://www.linuxbabe.com/cloud-storage/integrate-collabora-online-server-nextcloud-ubuntu-16-04

Those guides are for ubuntu, but it's irrelevant since they regard manual process.

Now, I tihnk I set it with 2 separate domains (so vhost  'nextcloud' served nextcloud instance and vhost 'collabora' was set with all the proxy stuff you can find in that guide - take this bit with a grain of salt though, it's been some time ago)

However, the most critical part was this one: at some point you will be asked for collabora's domain. Your answer (the parameter provided to docker as -e 'domain=<your answer>) is "nextcloud\\.your\\.domain"

Yup. You're expected to enter the domain assigned to nextcloud instance rather than collabora. And you escape dots with double backslashes.

----------

## NismoC32

Thanks for the info szatox.

I have now concluded that my problem is docker.

Here is my problem, when I start the image with

docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=mydomain\\.com' --restart always --cap-add MKNOD collabora/code

My nextcloud url is https://mydomin.com

My collabora url is https://office.mydomain.com

The docker ps shows:

```
docker ps

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                         PORTS               NAMES

f71410eea895        collabora/code      "/bin/sh -c 'bash ..."   22 seconds ago      Restarting (1) 8 seconds ago                       compassionate_ardinghelli
```

As you can see no PORTS shows.

The Docker info shows this:

 *Quote:*   

> docker info
> 
> Containers: 1
> 
>  Running: 0
> ...

 

And it says no containers are running.

So something is wrong here why does't the container show as started ?

Here is the docker.log output:

 *Quote:*   

> time="2017-11-27T11:54:26.966204931+01:00" level=info msg="stopping containerd after receiving terminated" 
> 
> time="2017-11-27T11:54:45.192846140+01:00" level=info msg="libcontainerd: new containerd process, pid: 24132" 
> 
> time="2017-11-27T11:54:46.198222738+01:00" level=info msg="Graph migration to content-addressability took 0.00 seconds" 
> ...

 Last edited by NismoC32 on Fri Dec 01, 2017 4:56 pm; edited 1 time in total

----------

## szatox

I'm not a big fan of docker and I don't know its design, but setting storage driver to device mapper seemed important. You have it set to btrfs. I had similar issues there and I suppose this was the cause.

Also, I think it's supposed to work with routed networking (AKA NAT mode) rather than with bridged networking, though I'm not quite sure how to read this output from your docker info. Either way, set storage driver first.

----------

## NismoC32

Well I have now changed the btrfs storage driver to overlay2 on a ext4 file system and that fixed the problems with

docker. It now works like it should   :Very Happy:   Thanks szatox.

Here is the output from 'ip addr' after docker now working.:

```

4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 

    link/ether 02:42:4c:af:d1:f5 brd ff:ff:ff:ff:ff:ff

    inet 172.17.0.1/16 scope global docker0

       valid_lft forever preferred_lft forever

    inet6 fe80::42:4cff:feaf:d1f5/64 scope link 

       valid_lft forever preferred_lft forever

1544: veth7d28fd4@if1543: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master docker0 state UP group default 

    link/ether 56:ec:97:af:0c:d2 brd ff:ff:ff:ff:ff:ff link-netnsid 0

    inet6 fe80::54ec:97ff:feaf:cd2/64 scope link 

       valid_lft forever preferred_lft forever

```

But the collabora still does not work in nextcloud.

The problem have to be the link between docker - apache(proxy).

As mentioned before my nexcloud address is: https://mydomain.com

and the collabora is set up to use: https://office.mydomain.com

I therefore used this command to start the collabora docker image:

```
docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=mydomain\\.com' --restart always --cap-add MKNOD collabora/code
```

```
netstat -lnpt
```

```
tcp        0      0 127.0.0.1:9980          0.0.0.0:*               LISTEN      7530/docker-proxy   
```

```
docker network ls
```

```
docker network ls

NETWORK ID          NAME                DRIVER              SCOPE

e728b9917d57        bridge              bridge              local

ccddd5565a72        host                host                local

6911be7f7248        none                null                local

```

You mention routed networking instead of bridged, how do you achieve that ?

[Moderator edit: changed [quote] tags to [code] tags to preserve output layout. -Hu]

----------

## szatox

Good, at least one thing sorted out.

Now, as I said before I'm not a big fan of docker and I had rather a limited experience with it. Either way, collabora actually exposes a port and a socket, so perhaps you're already set with this part. Maybe some other members could chime in on the topic of docker's networking.

Anyway, where are you with the proxy part? Do you have your vhosts ready? Are apache's proxy modules enabled? AFAIR you need proxy, http proxy and wss proxy or something like that.

Can you poke at that vhost with curl and see any valid response? (and http 503 bad gateway when collabora is down?)

Any problems / errors there?

The final step is about enabling collabora (And providing collabora's address: office.something.... I suppose 127.0.0.1 would also work if you bound the proxy vhost to our loopback, making second domain expendable. Haven't tested.) in nextcloud administrator's panel.

----------

