I'd like to preface that this solution is not intended as an easy cloud solution if you have multiple users. For each user you'd have to manually setup Syncthing for the folders and subfolders they want to sync with their clients. Seafile might be a simpler alternative for you.
After some pain points of using Nextcloud, mainly due to sync issue related to conflicts and that the client has an issue with ignoring folders (as of day of writing). Other than that I don't have the need to run something as "big" as Nextcloud anymore. The attractive thing about it is mainly it's support for apps, but I have found better once since then.
The idea is rather simple, setup a docker container for File Browser and use that as the interface for accessing data remotely on the web, and sharing of data to thrid-parties. With that up and running, a Syncthing container will then act as our sync server and client.
Rather straight forward.
I'm running it in swarm, but the same file should work for Docker-compose of course. Some things from my actual configuration are omitted, namely my deploy section (for placement and Traefik labels) but there is nothing special there.
The only thing really to get this to work is that File Browser and Syncthing have the same directory for files mounted.
Note: I did not add the discovery port (21027 udp) below for Syncthing as it's not used in my use-case. Syncthing will complain, but just turn off Global and Local discovery in Syncthing settings.
version: '3' services: srv: image: filebrowser/filebrowser:latest user: 1000:1000 volumes: - /srv/docker/filebrowser/root:/srv - /srv/docker/filebrowser/filebrowser.db:/database.db syncthing: image: linuxserver/syncthing:latest environment: - PUID=1000 - PGID=1000 - STGUIADDRESS= volumes: - /srv/docker/filebrowser/root:/data1 - /srv/docker/syncthing/:/config ports: - 8384:8384 - 22000:22000/tcp - 22000:22000/udp
I recommend not exposing the Syncthing UI to the outside. In my setup I've configured Traefik so it's only accessible within my own networks (VPNs, docker, internal network, the server itself etc.) - If you do feel the need to expose it to the internet, remember to at least set a password.
File Browser is a really cool project for managing and sharing files through a web interface, it's simple to use and setup. I only changed one thing inside the settings, which was adding a global rule. Since File Browser and Syncthing are looking at the same directory, will end up showing the Syncthing files (.stfolder and .syncthing files). Inside Global Settings I added a regex rule with allow unmarked, and a value of
On the user side of things here, I simply created a new folder in the root of the directory, then created a new user with a scope to that folder
./zero in my case (Zero was the name of my user).
On the Syncthing side, there isn't really anything special. Created the folder inside the UI for my Syncthing container where the folder was where I mounted the File Browser root and then my user folder (
/data1/zero in my case). And that's pretty much it.
Syncthing do not provide support for sync of nested folders. It's doable, but the system is not built that purpose in mind.
One of my own use-cases is wanting to sync a specific folder instead of the whole root of the user, this could for example be Documents, or in my case, my home directory/user profile.
To get it working there is not much magic. Do it like the first time, but the path will just point to the sub-directory. Nothing more than that (other than doing same on the client/remote device).
I recommend adding the sub-directories you sync to the ignore patterns for the client. Otherwise you'd end up with duplicate data. Also in my test of Android, my pictures would come up twice since it saw it on the filesystem but from my main/root synced folder.
For a client, I'd use SyncTrayzor which is a Windows tray utility, making it easier for my Windows device. It handles both automatic startup and a easy launcher for the UI.
For Android there is also a nice app for syncing, it can be found both on the Play Store and F-Droid. It was quite easy to use, and if you setup the remote devices first, it will send a request to the app after sharing a folder (just like the website does). This makes it quite easy.
While this is a pretty functional solution, I don't know if I can recommend it or not. Mainly due to the administration of it, if you manage a service for other users this is probably a no-go. Also given that while nested folder syncing works, it might be undesirable since you're on your own (with it having no support from Syncthing as they don't recommend it).
I think when I'm going to kill my Nextcloud in the near future, it will probably be in favor of Seafile. Personally I don't have anything against software that provides a premium version for extra features, but if you do then you might like the Syncthing alternative better afterall. Seafile has the bare minimum I'd really want; support for my different devices, sync of sub-folders, a good UI. It actually has support for ONLYOFFICE as well, though I haven't tested it yet.
Actually went ahead with this solution in the end, since I do not mind the administration overhead. I have future plans to maybe try making my own solution with Syncthing as a backend, for a more complete experience. But that can come after my current projects.