How to install and use Syncthing on Ubuntu 22.04

Endrit Qerreti

Endrit Qerreti

In this tutorial, you will learn how to install Syncthing on Ubuntu 22.04.

Syncthing is an app that allows you to share files between devices and sync them.

Syncthing is a very useful app, especially when you own multiple machines, and want to be able to share files between them.

All you have to do is install Syncthing on any device, and use Syncthing Web UI via your browser.

Installing Syncthing is very easy, and it can be done by using the official Syncthing's repository, which can be used on any Debian based distro.

In this tutorial, we'll be installing Syncthing on Ubuntu 22.04.

Step 1 - Add Syncthing Key

Before installing Syncthing, you need to add Syncthing's PGP key on your machine. This is the key that apt will be using to verify that Syncthing package is legit.

Adding the PGP key is quite simple, and you can do so by running the commands below one by one.

sudo mkdir -p /etc/apt/keyrings
sudo curl -L -o /etc/apt/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg

Step 2 - Add Syncthing Repository

Next, proceed to to add Syncthing repository on your machine.

Syncthing provides two different repositories stable and candidate that you can use to download Syncthing package.

stable repository provides you with stable releases, while candidate on the other hand releases builds that are closer to development.

To use stable repository run the command below.

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

To use candidate repository, simply run.

echo "deb [signed-by=/etc/apt/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing candidate" | sudo tee /etc/apt/sources.list.d/syncthing.list

Step 3 - Update your package index

Now that you added Syncthing's repository on your system, proceed to update the package index on your machine, so that Syncthing's repository is fully added and usable.

Ubuntu, and any other Debian based distro can be easily updated by using the default package manager apt.

To update your machine, simply run the command below.

sudo apt update

Step 4 - Install Syncthing

Now you should be able to install Syncthing on your machine.

To do so, simply run the following.

sudo apt-get install syncthing

Step 5 - Use Syncthing

Now that Syncthing is installed on your machine, you need to start it manually in order to be able to use it. To do so, you need to start Syncthing process by going into your Applications Menu, and searching for "Start syncthing", once you see the icon click it to launch it.

Syncthing runs on port 8384, and to access Syncthing Web UI you need to navigate to your machine's IP using your browser.

For example you can access Syncthing via the localhost IP

127.0.0.1:8384

How to share files between machines

Syncthing must be installed on all machines that you want to be able share and synchronize files between them.

To add another machine in Syncthing is very easy, as each machine has its own ID, which means to connect to another machine you can do so by using its ID.

To get your machine's ID, simply click to Actions, and then click button "Show ID" as shown in the screenshot below.

Next, copy your machine's ID. This is the ID that you will need to use in order to connect to your machine from another machine.

Next, connect your machine, by clicking "Add Remote Device button".

And add the Machine ID in the Device ID box, then simply click "Save" to save changes.

Next, you will receive the following prompt on the other machine.

First you need to click to "Add Device" button

Then simply save changes by clicking "Save" button

Once the other machine is added, it will appear under "Remote Devices" on Syncthing

Now both machines should be connected. By default Syncthing uses /home/owlhowto/Sync as the path of the shared folder. However, this folder is not shared by default, if you want to share this folder, then you need to enable it manually.

To do so, first click to "Default Folder" where it says Unshared.

Next, click to "Edit"

Next, go to "Sharing tab"

Now all you need to do is check the box of the Unshared Device, then finally click "Save" button.

Conclusion

In this tutorial, you learned how to install Syncthing, and how to connect multiple machines in Syncthing, and use it to share files between them.