Syncthing installation on docker. Allows you to synchronize folders between multiple machines on LAN and WAN.
Syncthing is a continuous file synchronization program. Synchronize files between two or more computers in real time, safely protected from prying eyes.
This image supports x86-64, arm64, and armhf architectures.
The following installation of Syncthing in OMV through docker allows to synchronize data from our OMV server with other machines in our internal or external network. It can be synced with Android, iOS, Windows, Linux, FreeBSD, and other platforms. For this, the application must be installed on each of the machines individually, and then they are configured for the synchronization job..
1. Initial System Preparation.
- You can use this guide: [How to] Prepare OMV to install docker applications
- It is assumed that you have followed the previous guide, therefore, the user variables, location, "config" folder are already defined. Customize otherwise.
2. Define required parameters in Syncthing.
-
Establish
access paths to the data that we are going to synchronize. As an
example we suppose that we want to synchronize two folders of two
different users (user1 and user2) with access to the NAS. We assume
that each user has a folder with his name inside /DATA. That is, we
will have the following two routes:
- /DATA/user1
- /DATA/user2
- The user "appuser" must have read and write access to these two folders. We can do it from the OMV GUI by editing the user privileges.
- The default port to access the Syncthing interface is 8384, we leave it as is. (for change see point 1).
-
The
host name is optional but if we leave it already defined, the
initial subsequent configuration will be easier. We define it as
"NAS".
3. Installing Syncthing on Docker.
- Adjust and implement the following stack in Portainer (for help see point 1). Note: Verify on the official page that this stack has not changed before installing it. https://hub.docker.com/r/linuxserver/syncthing
---
version: "2.1"
services:
syncthing:
image: lscr.io/linuxserver/syncthing
container_name: syncthing
hostname: NAS #See point 2
environment:
- PUID=1002 #See point 1
- PGID=100 #See point 1
- TZ=Europe/Madrid #See point 1
volumes:
- /SSD/config/Syncthing:/config #See point 1
- /DATA/user1:/data1 #See point 2
- /DATA/user2:/data2 #See point 2
ports:
- 8384:8384 #See point 2
- 22000:22000/tcp
- 22000:22000/udp
- 21027:21027/udp
restart: unless-stopped
Alles anzeigen
- Run the stack, this will download the necessary images and start the container.
- Access the Syncthing interface through a browser by typing the IP of your NAS and the defined access port 8384 (for help see point 1).
- The first thing you should do is set a password. Go to the top menu and click on "Actions", then in the window menu click on "GUI" and enter a username and password. Use strong passwords.
4. Sync with Android.
- From our smartphone we go to the google app store, find and install the Syncthing app.
- In the Syncthing interface of our NAS, click on the bottom button "Actions", then on "Show ID". A QR code will appear that we must scan with the smartphone.
- We open the Syncthing application of the smartphone and click on "Devices", then on "+", then on the icon to the right of "Device ID" and scan the QR code of the NAS. We accept the messages and we already have the two devices connected.
-
To
sync a folder, for example photos, from your smartphone:
- We create the folder /DATA/user1/phone_photos on our NAS. We make sure that "userapp" has read and write permissions on this folder.
- In the Syncthing interface of the smartphone we click on "Folders" and then on "+", in the window we click on "Directory" and look for our photos folder (usually DCIM), we allow access, we select the "NAS" device to activate this folder, and accept the icon on the top right.
- In the NAS Syncthing interface a dialog box will appear, click on "Add". In the window we go to "Folder path" and write "/data1/phone_photos/". It will probably be useful to go to the "Advanced" tab and click on "Permissions to ignore". Then click on "Save". At this moment, the synchronization of photos from our smartphone should begin to the folder defined in the NAS in /DATA/user1/phone_photos.
5. Configuration of a client in other systems.
- To install Syncthing on other platforms, see here: https://syncthing.net/downloads/
6. More information.
- User manual: https://docs.syncthing.net/intro/getting-started.html
- LinuxServer docker Syncthing installation: https://hub.docker.com/r/linuxserver/syncthing
I hope it is useful !!