Repository navigation
Description
Hello,
I'm in Africa and we have both a slow and expensive bandwidth (illimited plans are very rare). In addition, in a climate change perspective, it would be useful to limit bandwidth usage over large distances to save energy. In order to optimize this, we'd like to have the ability to sync over a LAN both with the server if it's on the LAN, and especially with other clients on the same LAN, who have already synced.
It is a cool and efficient existing Dropbox feature (https://help.dropbox.com/installs-integrations/sync-uploads/lan-sync-overview). And a lot of discussions have already started, both on owncloud and Nextcloud, but it looks like there's no activity anymore for years (nextcloud/server#7092, nextcloud/server#8331, owncloud/client#230).
Would it be possible to consider this feature? Thank you!
For reference, other links where this feature is requested:
Nextcloud:
owncloud:
- https://central.owncloud.org/t/lan-sync-between-clients/4205
- https://central.owncloud.org/t/gsoc-2017-fast-lan-sync/6271
- LAN Sync #FeatureRequest owncloud/core#26752
- LAN Sync [Migrated from owncloud/core] owncloud/client#230
Client configuration
Client version: 2.6.4stable-Win64 (build 20200303)
Activity
RogoTe commentedon Jun 4, 2020
Just for the reference... Have you ever looked at syncthing.net and pydio?
michaelstingl commentedon Jun 5, 2020
@RogoTe maybe you could provide some more context/pointers. Syncthing doesn't have a central server, and Pydio doesn't have LAN sync? (afaik)
biva commentedon Jul 17, 2020
@RogoTe I'm not a dev so I can't know if they are good strategies. I think they were already mentioned in previous posts (notably owncloud/client#230 (comment)). [Edit] Synchthing was also discussed in nextcloud/server#8384
How would the Nextcloud team consider this feature request?
wizdude commentedon Jul 17, 2020
Syncthing is designed to be peer to peer and your main server can most certainly be the central server. Replication occurs between the peers and the preference will be to use the local LAN where possible. Ideally I'd like to see this technique implemented into the Nextcloud desktop agent rather than supporting two different pieces of software.
zephyrus00jp commentedon Jul 17, 2020
Hi, I wrote in 2015 at owncloud/client#230
--- That is, Dropbox uses the same underlying protocol used by UPnP to broadcast a request or announce the availability of files and then let the peers to exchange files after a certain negotiations.
--- Maybe for the files the particular client has created/updated recently (i.e., has just uploaded to the server. Obviously, this client has the most up-to-date copy of the files.)
So if you have Dropbox installed on your PCs in your LAN, monitor the LAN traffic with a packet capture tool.
Create/modify/delete files on one PC or the other, and you will see what I described above.
I am not claiming Dropbox's method is the best, but it uses an established protocol (RFC) to broadcast the new file/modification and to exchange application-level command/data/response and so owncloud/nextcloud should do something similar.
zephyrus00jp commentedon Jul 17, 2020
A concrete algorithm would be.
When a client creates/modifies (or removes) a file, and this is propagated to the owncloud/nextcloud server after the ordinary processing (transaction-wise), the server issues a notice (signed by server PKI key to avoid forgery) that this client, let's call this Client C (I am not entirely sure how the client is identified uniquely. IP address may not cut it. It is easy to spoof it later on. Maybe a MAC and other PC identification combined. If each client has its own PKI key pair, obviously, that client can be identified by its public key.) has the copy of a file, let's call it file A, and others can copy it instead of copying it from the server.
Now upon receiving the notice from the server,
this client C advertises that it has the latest copy of File A by broadcasting the notice on the LAN (this is similar to UPnP).
Let's pick up another client D on the LAN.
Client D always listens for such an announcement on the LAN.
Upon hearing this announcement,
(a negotiation ensues)
(Possible additional step to let Client D also act as the source of the latest copy of File A.)
Upon the successful completion of the file copy, client D can notify the server
that it has the latest copy of the file A by sending its check sum etc. (via secure channel.)
the server can issue another notice that Client D indeed has the latest copy of the file A.
Client C, upon hearing the broadcast, checks its file store, and knows that it already has the latest copy (I am not familiar with owncloud/nextcloud internal, but I assume it has some file ID (based on a hash?)/relative-path-to-the-repostiry-root to make it easy for the identification.) ignores it.
Other clients which may have missed the earlier broadcast from Client C (broadcast is not reliable, you see), can now talk to Client D to initiate the copy process if they don't have the latest copy of file A.
The broadcast can be repeated at 1, 2, 5, 10 min and thereafter 1 hour apart for a day or something like that.
That was a push side.
The pull side would be simply this.
Currently, owncloud/nextcloud clients can begin downloading files from a server after it learns the server has newer files.
Upon figuring that, instead of starting the downloading files from the server, the client can initiate the request from a LAN by broadcasting the request:
Clients that have such files will respond that they have the latest copy of certain files among the requests.
What happens afterward is left as an exercise to the reader. The server can ascertain that a client, let's call client E, seems to have such files by checking such a claim by checking the hash of files sent from the client. The requesting client already knows the authentic hash of the requested file, and so at the end of copying, the mismatched check sum means either a corrupted file or bogus claim.
Anyway, requesting client can pick up the positive response among such responses and begin talking for file transfer.
It is doable securely. Just fill in the details and we are all done. Famous Last Words.
biva commentedon Aug 13, 2020
Thanks @zephyrus00jp ! In addition, shouldn't we verify the authenticity of the file to be downloaded? (I think NC uses this anyway to verify if 2 files are different or not, I don't remember if it's a hash or something similar).
@er-vin thanks for the enhancement label: is there any chance that the NC team considers this an interesting feature? Thanks again :)
er-vin commentedon Aug 13, 2020
Interesting feature? Definitely yes. But to be honest there are a ton of other features waiting as well and time is limited. Although I like the idea, don't expect something from us any time soon on that one.
biva commentedon Aug 13, 2020
:( I understand time is limited and I respect your job and your choices: you develop Nextcloud and I'm nobody to complain because of your choices as I'm just a user. But how to advocate this topic? Indeed, in my opinion, Nextcloud could consider it as a higher priority because:
er-vin commentedon Aug 13, 2020
Well, I know... your arguments are sound. Still, I won't make empty promises and in all likelihood it'd come after more pressing matters we have.
Of course, if someone starts working on it I'd be happy to help review.
biva commentedon Aug 14, 2020
Thanks @er-vin :) By curiosity, does it mean that you will bring these arguments in your internal discussions to decide if Nextcloud can make a specific effort for this issue? Thanks again for your consideration.
er-vin commentedon Aug 17, 2020
It means the same that I've said before: I like it, currently we don't have the bandwidth for it, we probably won't have the bandwidth for it for a long while.
Railsimulatornet commentedon Sep 6, 2020
I really hope that this feature will come, it would save a lot of traffic.
Frizou commentedon Sep 20, 2020
Nextcloud.com knows LAN Synchronization functionality is missing, see: https://nextcloud.com/fr_FR/compare/
33 remaining items
pylorak commentedon Oct 26, 2023
NAT reflection/loopback is a totally separate feature/function which is not required for the solution that I and many others have described (redirecting to the LAN address using a local DNS server). So the lack of this feature in consumer hardware is not a problem and is irrelevant here.
The only router feature that is beneficial for the proposed solution is the ability to configure the DNS server addresses that are handed out to DHCP-clients. This is supported by almost every router, even by ISP-provided ones. Also, even this feature is optional, because in the extremely rare case where configuring the DNS server addresses is not possible in the router, you can still configure the DNS server address statically on clients, or adjust their hosts files.
HammyHavoc commentedon Oct 26, 2023
Scenario: you run a Nextcloud server for your family members. It's a holiday. They all come over to your house, they're snapping away with photos and video, sharing them with each other, and they bring your WAN to its knees because they haven't got the statically configured settings. Is it fringe? Sure.
pylorak commentedon Oct 26, 2023
Static client configuration was a last resort in my answer. Realistically, you can configure this in almost every router, including ISP-provided ones.
Also, what are you arguing about? I didn't say native support for LAN sync in NC isn't needed, I actually said the opposite of that. I was just pointing people to a workaround in the meantime that will work for most private users of NC.
HammyHavoc commentedon Oct 26, 2023
I'm not "arguing" about anything, and whether you support LAN sync or not doesn't negate the suggestions made, which aren't appropriate for a sizeable number of people.
E.g., https://www.quora.com/Why-dont-ISP-routers-allow-you-to-change-the-DNS/answer/Khairul-Aizat-28
On some ISP-provided hardware, you must use the ISP-provided DNS. This affects what gets dished out via DHCP in terms of DNS.
sunjam commentedon Oct 28, 2023
Was already discussed and formally rejected here:
Do note that Syncthing can already be integrated with Nextcloud folder mounts as described here: nextcloud/server#8384 (comment)
Also see the discussion on adding delta sync support:
i2h3 commentedon May 19, 2026
From my point of view this feature is unfeasible to implement in Nextcloud desktop client directly. It appears like third party tools already mentioned are better for this purpose. The Nextcloud desktop client architecture is based completely on the centralized server model. This feature indeed looks nice from the user perspective but technically it might require a full rewrite. 😅
ktuulos commentedon May 19, 2026
This is mostly just a matter of will. Dropbox is also based completely on the centralized server model, but dropbox has adopted the content-addressed block idea. There is no reason, why this 4MB content-addressed block mechanism could not be implemented on parallel to current Nextcloud file transfer mechanism.
i2h3 commentedon May 19, 2026
@ktuulos Then go ahead! 🙂 I am looking forward to your pull request.
oleua commentedon Sep 16, 2026
It is sad... :(