Nextcloud bidirectional sync with NAS


iam searching for weeks now how to sync a local NAS to an Nextcloud Server inside a Datacenter. My Problem is that i have a slow Internet connection to access the NAS from WAN. So i want to sync the NAS Files to the Nextcloud Server and the same backwards.

Also, if I delete a file on the one side, it should automatically delete the same file on the other end.

The NAS is a Qnap. I tried every App, I experimented with Syncthing… nothing helped.
Does somebody have an Idea?


This is nothing for Nextcloud, use incremential rsync between your QNAP and hosted Nextcloud Server. For security reasons you should do this inside an openVPN connection. On your Nextcloud Server connect to the rsynced folder via external drive.

Did you try to use the External Storage app? That That would connect Nextcloud to your NAS using a SMB/CIFS share, allowing data to be updated either on the NAS or through Nextcloud.

That is not the same as using your NAS as the backend storage for Nextcloud, because Nextcloud would still have its own local data directory.

Iam trying to solve with with the External Storage App at the moment.
I will use SFTP. The connection is established but i cant see any Files now.
Its not a permission failure. I have to search and i will give updates if i have some.

Now i have a Connection and can see all my files. I made another user and gave him the same Persmissions as the first one. Idk why but the new user works fine.

Now still one problem is left.
My Nextcloud writes and reads with about 60kb/s
If i connect with Filezilla and the exact same Login Data, I get the Max speed of my Bandwith.
Does someone know why?

How are you testing this? There is a connection between Nextcloud and the SFTP server using the LAN directly (right?), and there’s also the connection between the client and Nextcloud. Can you isolate which connection is going slow?

Both are connecting from WAN. On my Notebook i can reach the full speed of the QNAPs Bandwith. Nextcloud (which has gigabit WAN, so it cant be the bottleneck) only uses 60kb/s.

As said before, rsync your data between your QNAP inside an openVPN tunnel. Connect to the folder on your Nextcloud server via External Storage App (Loopback). Everything else is security nightmare and/or bottleneck.