Syncthing Photos, a Dropbox or Google Photos Replacement

Syncthing Photos, a Dropbox or Google Photos Replacement Featured Image

If you’ve not come across Syncthing before, it’s an open source file synchronisation replacement for commercial big-tech services like Dropbox and Google Drive.

You configure it, run it and control your data. There’s no central server that stores your data, no company with other interests. It uses a clever P2P (peer-to-peer) file synchronisation technology called BEP (Block Exchange Protocol) to sync your files back-and-forth between devices directly without a storage server in the cloud.

It’ll sync all your files and photos from your phone like Dropbox Camera Uploads or Google Photos automatic backup, replacing all but the public sharing features of Dropbox or Google Drive.

You can skip the Syncthing background reading and jump straight to the easy Dropbox Photo’s or Google Photo’s setup below.

How much storage space and how fast?

Syncthing has as much storage space as you have. It syncs between your devices directly so there’s no limit other than your device itself.

e.g. If you have 1000GB on your laptop and other computer, you can sync up to 1000GB.

It can also sync very fast, depending on how it’s configured. i.e. If you setup your devices in a linear bunny-hop style network all on their own closed networks then it’ll naturally be slower than a mesh network of all devices talking to each other with all their network ports open.

Synchronisation is Different from Backup.

The word backup is thrown around loosely, and although some people may consider having their data saved in the Dropbox or Google Drive cloud as a backup, technically speaking it is not a true backup.

File timeline states. Syncing does not store all states of the files in cohesion. e.g. if you edit a file offline 3 times and then go back online to sync, only the most recent/current version is sent off to the cloud or other devices - if you need constant file state backups, you could use something like git or drive snapshots, but this is for another post.

Deletion. Deletion is involved in file synchronisation by definition. If you’re syncing a folder from one place to another, this means syncing deletions too. If you delete a file on your laptop it’ll be deleted in the cloud or other devices too. Not great for a backup.

Cloud sync providers and Syncthing have an additional feature to save you from accidental deletions. They usually call this something like “file recovery” or “file versioning”. If any file is deleted or overwritten it’ll save a copy of it somewhere else for a specified time frame so you can get it back by restoring the accidentally lost file. This is a helpful feature but it’s not technically a real backup solution, as again they can only save the removed files if they know about it i.e. you’re online and syncing when it happens. I’ll post about Syncthing’s file versioning and a real 3-2-1 home backup solution in the future.

Cloud sync services like Dropbox and Google Drive also have the disadvantage that they can close your account at any time for any reason, and if you’re only using their cloud features with no external backups, you’ve lost all your data with no notice. 🙅

Syncthing’s Disadvantages

Syncthing requires you to bring your own cloud or devices, as it syncs data between your devices peer-to-peer (with some clever systems called Discovery and Relays to work around firewalls and network issues). So, if you only have your laptop online, it’s not going to sync your laptop data to anywhere else. This means you need at least two of your devices to be online at the same time for the sync to work, then when other devices come online they’ll catch up also.

The easy solution for keeping your sync up-to-date is to have an always on “server”, this could just be your main computer that you leave on all or most of the time, or a dedicated home-server (big or small) or even a VM/VPS in the cloud (although this last one comes with a cost of hosting, storage space limitations and also a potential mitigation of Syncthing’s benefit of privacy from big-tech, unless you setup the new encryption options also). I’ll post about this option sometime soon.

Another disadvantage for the average Dropbox or Google Drive user is that it’s a technical piece of software. It’s not entirely straight forward to configure, however, if you’re a software developer or have ever played with Linux you’ll have no problem as it’s easier than terminal/command line tools, there’s even a web-based interface. That said Syncthing’s web interface is not built with UX in mind, you have to learn how it works to set it up right, it’s easy to configure incorrectly for your use-case and to lose your data.

This technical complexity makes it highly configurable at the cost of a steep learning curve for a drop-in Dropbox/Google Photos replacement - unless of course you have a handy guide in the form of a blog post… 😉

Replace Dropbox Camera Uploads or Google Photos with Syncthing

One of the first things you’ll notice when installing the Syncthing Android app is that the Camera Uploads folder is setup by default as an example.

You may thing this perfectly replaces Dropbox’s Camera Upload folder or Google Photo’s automatic upload out of the box, where all your pictures and videos taken on the phone are synced somewhere else.

However the default Syncthing phone camera upload does not operate as many people might expect.

Syncthing uses a true two-way sync of files on your phone, in this case pics and vids, this would mean that any photos deleted on the phone would also be deleted from your computer or other devices too… precisely the opposite of what most people want for this use-case.

Dropbox Camera Upload and Google Photo’s operate technically as a one-way sync - where photos and videos from your phone are uploaded and saved into the cloud no matter what happens to them on the device.

If you discover this the hard way, you’ve possibly lost data already (this is why real backups are so important) and you may have seen on a Google Search or on the Syncthing Forums that many people come across this issue with camera uploads.

The most prominent solution you may come across online is to set the phone settings as “Send Only” and the computer/other device settings as “Receive Only” rather than the Syncthing folder default of “Send & Receive” - however again this does not solve the issue as “Receive Only” also accepts deletions (perhaps the “Receive Only” setting would be better named as “Mirror Only”? 🤔). So this setup still does not replicate the one-way sync of Dropbox Camera Uploads or Google Photos.

Looking further you may come across another suggestion. In the advanced settings on the receiving side, you can change the “ignore deletes” setting to “true”, this effectively prevents files from being deleted from your computer once they are removed from the phone. Sounds perfect right? However this is always marked with a warning and recommendation against using this option, this advanced option is not designed for this use case by the developers and your synced folder will constantly show as “Out of Sync” due to the deletions being ignored. Also, if the setting ever gets changed back, all the deletions rush-in to catch up with the sync status, resulting in data-loss.

There are other suggests to write some custom code on a server, however you can tweak a friendlier setting directly in Syncthing without any hacky options…

Once you’ve setup the “Camera Uploads” sync folder on the receiving device(s):

  1. Set the “File Versioning” from the default “No File Versioning” to “Simple File Versioning”.
  2. Ensure “Clean out after” is set to 0 zero, this means the deleted files will never be removed.
  3. Change “Keep Versions” to a number larger than 1, e.g. 1000.
  4. Set the “Versions Path” directory to a folder outside of “Camera Uploads” sync folder such as ../Camera Uploads Archive/ (../ in this context on Linux and macOS means up-one directory, i.e outside of “Camera Uploads”).

So if all your Syncthing synced folders are under the default ~/Sync/, after you’ve deleted a synced photo from your phone you’ll end up with this:

  • ~/Sync/Camera Uploads The original “Camera Uploads” folder as a live synced staging area.
  • ~/Sync/Camera Uploads Archive a new “Camera Uploads Archive” where phone deleted files end up.

File Versioning usually keeps copies of deleted or replaced files in a default sub-directory within the sync folder called ./.stversions. This folder is ignored when syncing to other devices by default. The type of file versioning determines how and how many copies to keep, in our basic scenario we only really need to keep 1 permanently as a phone is unlikely to overwrite photos that are filename timestamped.

You could set a full absolute path here however going up one directory works fine with the default Syncthing setup. When ever a synced file, photo or video etc, is deleted on the phone e.g. when trying to save space, when it syncs to this receiving device it’ll be copied with a timestamp into the other directory called “Camera Uploads Archive”.

You can then even share/sync this new “Camera Uploads Archive” folder like any other sync folder to other devices. (Just don’t sync it back onto your phone assuming you deleted the originals to save space!)

You can replicate this simple setting on other receiving devices also, make sure to use more than 1 Keep Versions in case of multiple device file versioning clashes if you’re also syncing the new “Camera Uploads Archive” folder too.

TIP: remember to turn on mobile data sync if you want your phones photos and videos to be synced while you’re away from WiFi.

Comments & Questions

Reply by email to send in your thoughts.

Comments may be featured here unless you say otherwise. You can encrypt emails with PGP too, learn more about my email replies here.

PGP: 9ba2c5570aec2933970053e7967775cb1020ef23