Nextcloud All-In-One on Unraid

I currently am running the Linuxserver Nextcloud container on unRaid with a MariaDB container for the database. I recently have been working to improve the speed because more people are going to be using my instance. I recently add more SSD so I could move my Nextcloud data off HDD. I have read that the official Nextcloud docker is faster that the Linuxserver one so I have been looking to migrate to that.

When I go looking for an official docker I find the All-In-One container. I am having some trouble getting it working. Some notes about my setup. I am using haProxy in pfSense as a reverse proxy. I have been giving my containers their own IP on a vlan that is isolated from the rest of my network. In unRaid, it is reccomended to put persistant container data in “/mnt/user/appdata/nextcloud” and I would like to put the majority of the files from users in “/mnt/user/nextcloud/”.

To this end this is the compose I tried. I also tried one closer to the default. Neither seem to be working.

services:
  nextcloud-aio-mastercontainer:
    image: nextcloud/all-in-one:latest
    container_name: nextcloud-aio-mastercontainer
    restart: unless-stopped
    networks:
      br0.70:
        ipv4_address: 10.24.70.40
    environment:
      NEXTCLOUD_DATADIR: "/mnt/user/nextcloud"
    volumes:
      - nextcloud_aio_mastercontainer:/mnt/docker-aio-config # This line is not allowed to be changed
      - /var/run/docker.sock:/var/run/docker.sock:ro
networks:
  br0.70:
    external: true

I think I need to change the volume from “nextcloud_aio_mastercontainer” to “/mnt/user/appdata/nextcloud”. Though that didn’t seem to work earlier either.

Is there really going to be any speed increase switching to the All-In-One? Am I doing things I shouldn’t somewhere? Should I be trying to use the All-In-One VM instead? Should I be putting the individual containers up and not using the All-In-One?

Thanks in advance for the help.

Hi, see all-in-one/reverse-proxy.md at main · nextcloud/all-in-one · GitHub

Did you have any luck switching to the AIO on your unraid install? I’m in the same boat currently (unraid, linuxserver\nextcloud with MariaDB) and looking for better performance before sharing the instance with family. If you got it working, was the performance indeed much better?

I don’t quite have it up and running but think I have figured out how to do it. It doesn’t however work with the mastercontainer and automation that is built in.

If you look in the manual-install folder on the git page you can find the way the containers are setup. If you follow the compose file (latest.yml) and env file (sample.conf). You can build each of the containers manually in the unraid UI. All you should have to change is the location of the docker volumes to a location on your appdata share.

Updating when there are updates will probably be a pain. The automated backup probably won’t work.

If you use the compose plugin on Unraid. It will simplify things significantly. You will be able to take the “latest.yml” and “sample.conf” and edit them. When run it will bring up all the containers at once properly. Then to update you will be able to follow the direction on the manual-install page and just look for changes in these two files to update. Once again you just update the volumes to proper unraid locations.

I am thinking about putting in a feature request to all the automated system to change the volume location. I don’t think it would be hard but I am not sure where in the GitHub to find where the changes would need to be made.

Once again this is theory. I haven’t quite tested the compose file I am working on but it should work fine. I will post my compose file when I get it working.

1 Like

I suppose the best guide for AIO on unraid is currently this one: https://myunraid-ru.translate.goog/nextcloud-aio/?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=de&_x_tr_pto=wapp

That is the only one out there I’ve found. I actually have it bookmarked. I don’t know that it is quite the solution.

All the volumes besides where the nextcloud data are placed in a location I believe would be either on the flash drive unraid runs from or in memory.

From my understanding all the actual storage disks on unraid are mounted under /mnt/

After googling a bit, I found this article which mentions the docker.img file which should include all docker volumes and all docker data: https://www.reddit.com/r/unRAID/comments/q4b5e3/-/hfxlnu4. Based on this comment, it looks like you might be able to move that file around onto another disk for example.

Looking at the manual-install directions it seems simple enough to add an ENV variable for volume location and prepend the volumes with that. If it is left blank then they would be created like they are now and if not they would go where directed.

I don’t know how well that would work with the mastercontainer but I would think that would be relatively simple too.

services:
  nextcloud-aio-apache:
    depends_on:
      - nextcloud-aio-onlyoffice
      - nextcloud-aio-collabora
      - nextcloud-aio-talk
      - nextcloud-aio-nextcloud
    image: nextcloud/aio-apache:${IMAGE_TAG}
    ports:
      - ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/tcp
    environment:
      - NC_DOMAIN=${NC_DOMAIN}
      - NEXTCLOUD_HOST=nextcloud-aio-nextcloud
      - COLLABORA_HOST=nextcloud-aio-collabora
      - TALK_HOST=nextcloud-aio-talk
      - APACHE_PORT=${APACHE_PORT}
      - ONLYOFFICE_HOST=nextcloud-aio-onlyoffice
      - TZ=${TIMEZONE}
      - APACHE_MAX_SIZE=${APACHE_MAX_SIZE}
      - APACHE_MAX_TIME=${NEXTCLOUD_MAX_TIME}
    volumes:
      -  ${VOLUME_LOCATION}nextcloud_aio_nextcloud:/var/www/html:ro
      -  ${VOLUME_LOCATION}nextcloud_aio_apache:/mnt/data:rw
    restart: unless-stopped
    networks:
      - nextcloud-aio

I am sorry but we will not add support for this. Using docker volumes is the much cleaner approach. You should rather look into how to move the docker.img file to another disk like mentioned above.

I don’t understand that but I guess have to accept it. I don’t know why allowing it for all the volumes is any worse than allowing it for the nextcloud_aio_nextcloud_data volume.

I guess I will be stick with the linuxserver container. Just need to figure out how to get nextcloud office working with it.

Because you will need to handle the permissions for the chosen paths yourself correctly which docker does for volumes automatically. So this will be a documentation nightmare. Docker volumes also come with other advantages like having the option to manage them via cli, etc.

What is your problem with moving the docker.img file around?

That is a good point about the permissions but I don’t see any notes in the documentation worrying about them for datadir. I could see that becoming a problem though.

I understand how moving the docker.img would work. I just don’t like keeping persistent data in it. That is probably mostly because of the way docker is integrated into unraid and the way templates are built. They put all the persistent data in an appdata folder, with only occasional other data placed elsewhere but always in a folder on either a cache drive or the array.

I suppose really the only other container that has persistent data is the database. The rest of them probably don’t need persistence over time. So even allowing that one would probably work for me. I just worry about losing the data somehow.

I guess some of the configuration in the mastercontainer may also need to be persisted.

Yes, this is because the initial process in the Nextcloud container runs as root which allows to modify the ownership of the target directory (as long as the target directory is not SMB or NTFS based) which however is not the case with all the other containers (they don’t run as root but completely as different users which are not able to change the ownership of the target directory.)

But when moving the docker.img into a different place, wouldnt that also persist the data on your drive arrays?

Also, afaik are docker volumes meant to be persistent so this would rather be a design-mistake of the unraid docker implementation…

Actually no. All of these have persistant data in it: all-in-one/containers.json at 910b72e4c08363033a967dbb66c1f824877d1077 · nextcloud/all-in-one · GitHub

I didn’t realize there was persistent data in some of those. I wouldn’t have expected redis or apache to care at all. I had forgotten about the backup container which would need persistence.

It is probably just something I should get comfortable with. Thanks for the conversation.

1 Like

Yeah, however for the built-in backup solution you can indeed specify a target directory on your host directly from the AIO interface :slight_smile: