Home Docker Keep Your Files In Sync with SyncThing

Keep Your Files In Sync with SyncThing

by Behrad
245 views

There are a lot of Cloud storage providers these days which you can use to have the files which you need in sync. But what if you only want to sync your files in your own network? Then SyncThing is here to rescue!

So I was looking for a way to have some files & folder which are on my Raspberry Pi synced to a specific folder on my new Synology DS220+ NAS. And since both of the devices are on my own network I wanted to have something which could do this job for me.

What Is SyncThing?

SyncThing is a free and open-source tool which allows you to continuously synchronize files across multiple devices without relying on a central server. One of the reasons that I love this tool is that it’s focused on:

  • Privacy: None of the data is stored on a central server but only between the devices in your own network.
  • Encrypted: All the file transfers are encrypted and will prevent eavesdropper from ever gaining access to your data.
  • Authentication: Every device is identified by a strong cryptographic certificate. Only devices you have explicitly allowed can connect to your other devices.

How To Install SyncThing?

To install SyncThing, simply go to the official website and download the version for your operating system. Once the download is complete, run the installer and follow the instructions to complete the installation.

It goes without saying but you need to have SyncThing installed on the devices which you want to keep synced. In my case this would be needed to installed on my Raspberry Pi & my Synology DS220+ NAS using Docker containers. For this I use the following Docker Compose on my Raspberry Pi.

---
version: "2.1"
services:
  syncthing:
    image: lscr.io/linuxserver/syncthing
    container_name: SyncThing
    hostname: syncthing #optional
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Amsterdam
    volumes:
      - /home/pi/Configs/SyncThing/Config:/config #This is the path to store your config.
      - /home/pi/Configs/:/RPi4B-Config #The Path which you want to share
      - /home/pi/Backup:/RPi4B-Duplicati-Backup #Another Path
    ports:
      - 8384:8384
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped

And this is the Docker Compose which I used on my Synology DS220+.

version: "2.1"
services:
  syncthing:
    image: linuxserver/syncthing
    container_name: SyncThing
    hostname: syncthing #optional
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Europe/Amsterdam
    volumes:
      - /volume1/docker/syncthing:/config
      - /volume1/RPi4B-Backup/:/RPi4B-Backup
    ports:
      - 8384:8384
      - 22000:22000/tcp
      - 22000:22000/udp
      - 21027:21027/udp
    restart: unless-stopped

How To Use SyncThing?

Click to enlarge!

I must admit it took a while before I understood how the setup needed to be done, but in the end, this is actually very easy. Basically you’ll need to set-up a folder on each device that you want to keep in Sync. Then you’ll need to add these folders to SyncThing by clicking on the “Add Folder” button and selecting the other folder location.

Once you’ve added the folders, you’ll need to specify which devices you want to sync them with. To do this, click on the “Add Device” button and enter the device ID and a name for the device.

SyncThing will then automatically detect changes made to the files in the synced folders and synchronize them across all the devices that have access to those folders. It’s as easy as that! 😉

Once you have set-up your folders, don’t forget to make sure to protect the SyncThing admin pages with an unique password. For this you can use Bitwarden!

Conclusion:

SyncThing is a powerful and versatile tool that can help you keep your files in sync across multiple devices without relying on a centralized service or cloud storage provider. It’s free, open-source, and easy to use, making it an excellent choice for anyone who needs to keep their files organized and up to date. Give it a try and see how it can help simplify your digital life!

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Discover more from ITB4X.com

Subscribe now to keep reading and get access to the full archive.

Continue reading