Skip to content

Instantly share code, notes, and snippets.

@guerrerocarlos
Last active February 14, 2024 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guerrerocarlos/97a4f3051f556a67e428ee1c96bdbad5 to your computer and use it in GitHub Desktop.
Save guerrerocarlos/97a4f3051f556a67e428ee1c96bdbad5 to your computer and use it in GitHub Desktop.
How to setup Syncthing in a Raspberry Pi

Install syncthing:

sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing
printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing.pref
sudo apt-get install apt-transport-https

Open the firewall port

sudo ufw allow 8384

Configure it

Since you will probably mostly access it remotelly, enable the service to be accesed by any IP in the network:

Edit the file:

/home/pi/.local/state/syncthing/config.xml

Change where it says "127.0.0.1" with "0.0.0.0"

Make it start automatically on restarts

sudo systemctl enable syncthing@pi.service

Start it up

sudo systemctl start syncthing@pi.service

Profit

Access it over http://[RaspberryIP]:8384

Syncthing is an awesome piece of software, you can make a donation to them, if you feel like it :)

Security

First thing you must do is setup a login and password to it, be sure to use a hard to guess easy to remember password ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment