Syncthing container setup
Introduction
Syncthing is an open-source self-hosted file synchronization solution. It allows you to sync files between different devices and operating systems. I use Syncthing to sync notes for example.
Setup
-
Create the folders needed by the container
Run the following commands inside your home folder:
-
Create the script needed to run the container
Save the following script as
syncthing_run.sh
:Instructions:
- Optional Replace
docker
withpodman
if needed - Required Replace hostname
syncthing-vm1
with the name of your device when you have Syncthing running on multiple devices - Optional Replace
--net=host
with ports to pass through if you want to expose ports. Here is described how to check if ports are available. Make sure port8384
is available - Required Replace
$PWD/data
with a local folder you want to sync. The folder/var/syncthing/data/
can then be selected to sync in the Syncthing settings - Optional Replace
/mnt/fileserver/archive
with a local folder you want to sync. The folder/var/syncthing/archive/
can then be selected to sync in the Syncthing settings. So it is possible to sync the contents of a folder from my fileserver which is mounted on the Docker host - Required Replace
Europe/Amsterdam
with your own timezone
- Optional Replace
-
Run the script to create the container
Run the following command:
The image
syncthing/syncthing
is automatically pulled and the container is created. -
Check the results
If needed you can check if the container is running properly.
Now you can use Syncthing by opening a web browser and going to:
http://localhost:8384
. Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier. -
Syncthing Settings
Setup authentication and HTTPS
To turn on authentication and the option to use HTTPS for the GUI:
Actions
>Settings
>GUI
>GUI Authentication User
: your syncthing userActions
>Settings
>GUI
>GUI Authentication Password
: your syncthing passwordActions
>Settings
>GUI
>Use HTTPS for GUI
: turnON
Now you can use Syncthing by opening a web browser and going to:
https://localhost:8384
. Replace localhost with the relevant IP address or FQDN if needed, and adjust the port if you changed it earlier. So usehttps
instead ofhttp
.Setup connections
Within my local network Syncthing is running on Linux, Windows and Android. I disabled the following settings because I didn’t think it was necessary:
Actions
>Settings
>Connections
>Enable NAT traversal
: turnOFF
Actions
>Settings
>Connections
>Global Discovery
: turnOFF
Actions
>Settings
>Connections
>Enable Relaying
: turnOFF
But just make your own choices here.
Advanced settings
Since sending crash reports is turned on by default without prompting I turned this off:
Actions
>Advanced
>Options
>Crash Reporting Enabled
: turnOFF
Sync
Now you can add folder(s) to sync by clicking on
Add Folder
in the main screen. The Docker mappings can be selected by browsingFolder Path
to/var/syncthing/
.
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.