Syncthing is amazing alternative to things like Dropbox or Google Drive plus you control your data. Now it works little differently than usual cloud storage solutions. Instead of one central server Syncthing uses peer to peer sharing. Also Syncthing is quite flexible for sharing files between your different devices or between people. I will not go into details of Syncthing features and options because probably if you are already here you want to know how to install it so here goes …
- Syncthing has its own repository and signing key. Download and install the signing key, run:
wget -O - https://syncthing.net/release-key.txt | sudo apt-key add -
This key is required in order for apt-get to install any packages that it was used to sign.
- Next, add the Syncthing repository to APT’s list of known sources by creating a new source list. Run:
sudo nano /etc/apt/sources.list.d/syncthing.list
And add following to file:
deb http://apt.syncthing.net/ syncthing release
Save your changes.
- Now we will install syncthing.
sudo apt-get update sudo apt-get install syncthing
- ow you can configure Syncthing from browser if you use a desktop enviorement but because I use Pi as headless server we will do configuration via terminal.
Start and close syncthing.syncthing CTRL+C
- Open Syncthing’s configuration file using nano:
sudo nano ~/.config/syncthing/config.xml
- Find the GUI section similar to this:
<gui enabled="true" tls="false" debugging="false"> <address>127.0.0.1:8384</address> <apikey></apikey> <theme>default</theme> </gui>
- And replace the 127.0.0.1:8384 with 0.0.0.0:8384.
Now any machine on the local network can access the program.
Save and Close - Start the Syncthing
- Navigate your browser to the Raspberry Pi-s IP with port 8384.
- Proceed with “Settings” button.
- Fill in values for the “GUI Authentication User” and password.
- Now Syncthing automatically created sync folder to Raspberry Pi-s home folder. Now we need second computer with Syncthing. I use my main PC for that so just install Syncthing on second computer (for my Linux Mint I just downloaded the 64bit linux package from their website, unpacked and ran).
- Now we have to introduce two Syncthings to each other.
Click “Action” drop down menu and select “Show ID” - Now on Pi select “Add Remote Device” from the lower part of the page.
- Copy the code above the QR code from second device to Raspberry Pi-s Device ID field.
- Check the “Default Folder” checkbox at the bottom.
- Click “Save”
- Return to second devices Web UI. There should be prompt asking to approve the device. Click “Add Device”
- You will be prompted the familiar “Add Device” form.
Check the “Default Folder” box and click “Save” - Now after 20 seconds both UI-s show the Remote device status connected and after that Up to Date. (You may need to confirm the sharing of folder on Raspberry Pi after 19. step)
Testing:
Add a file to your “Sync” folder and if internet gods are merciful the file will appear on second computer.
Now Syncthing is very well documented so I recommend to read their documentation @ https://docs.syncthing.net/
Leave a Reply