Install Syncthing under windows and ubuntu


A tool that can be used to synchronize files between different devices.

Install under window

There is a client version, which is maintained by the community. I downloaded it and tried it, but I did not follow the latest version. It seems that there are bug s in other articles, and the boss also gave other solutions.
That is to say, a bat file is started automatically at boot, and the command line tool provided by Syncthing is started.

Go to the official website for the next package

Then win + r Enter shell:startup , and create a new bat file in it (you can create a new txt file first, enter the following content, and then change the txt suffix to bat)
Three places need to be modified

  1. D:\software\syncthing-windows-amd64-v1.22.0\syncthing.exe

program directory.

  1. -config="C:\Users\admin\AppData\Local\Syncthing"

Syncthing's configuration directory. You have to run the syncthing.exe of the installation package before it will appear, and the following one is the same

  1. -data="C:\Users\admin\AppData\Local\Syncthing\index-v0.14.0.db"
%1 start mshta vbscript:createobject("").run("""%~0"" ::",0)(window.close)&&exit
start /b D:\software\syncthing-windows-amd64-v1.22.0\syncthing.exe -config="C:\Users\admin\AppData\Local\Syncthing" -data="C:\Users\admin\AppData\Local\Syncthing\index-v0.14.0.db" -no-browser

After the program runs, access Can enter the management page

Reference link

Install under ubuntu

Synchronization service requires a 24-hour online server. I use Tencent Cloud, the system is Ubuntu Server 20.04 LTS

# Add the release PGP keys:
sudo curl -o /usr/share/keyrings/syncthing-archive-keyring.gpg

# Add the "stable" channel to your APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list

# Update and install syncthing:
sudo apt-get update
sudo apt-get install syncthing

# check version
syncthing --version

The above is installed, but there will be a problem. The webui of this thing cannot be accessed with the public network ip of the server. It can only be accessed with access. It should be solved with the reverse proxy of nginx. I was too lazy to configure it for a long time, and then I found another way.

The following source reference link 1
Since Ubuntu 18.04+, the syncthing service can be managed by creating a systemd configuration file. The official also provides configuration files: etc/linux-systemd
First create a file
sudo vim /etc/systemd/system/syncthing@.service
Then enter the following

Description=Syncthing - Open Source Continuous File Synchronization for %I

ExecStart=/usr/bin/syncthing -no-browser -gui-address="" -no-restart -logflags=0
SuccessExitStatus=3 4
RestartForceExitStatus=3 4


In this way, you can use the ip given by Tencent Cloud to access, of course, the firewall has to open 8384.
Note: And you must open port 22000, otherwise you can't add remote devices (I was trapped for a long time)
Then you can configure systemd

# Update systemd services
sudo systemctl daemon-reload

# Start the syncthing service
sudo systemctl start syncthing@$USER
# Turn on auto-start
sudo systemctl enable syncthing@$USER

# View service status
systemctl status syncthing@$USER

Reference link


The following links briefly describe how to use it:

Tags: Linux Windows Ubuntu

Posted by acabrera on Thu, 03 Nov 2022 01:12:47 +0300