How to Install Syncthing on Ubuntu 24.04

This article details the steps to install and configure Syncthing, an open-source tool for file synchronization on Ubuntu 24.04. It emphasizes direct device connections for enhanced privacy and control, customizable syncing options, strong security through password protection, and real-time updates, ensuring that all files are current across devices.

This article provides instructions for installing Syncthing, a file and directory synchronization tool, on Ubuntu 24.04.

Syncthing is an open-source file synchronization tool that lets you sync files between devices without relying on a centralized server.

Unlike cloud services that store data on external servers, Syncthing connects your devices directly, giving you control over your files. It synchronizes files instantly as changes occur, ensuring all your devices have the most up-to-date and accurate versions of your documents, photos, and other data.

You can choose specific folders to sync, manage versioning, and set bandwidth limits, creating a customized experience for your file synchronization requirements.

Install Syncthing

To synchronize files using Syncthing, install it on all devices. To install packages on Ubuntu, you can use the following command.

sudo apt update
sudo apt install syncthing python3-bcrypt

Once installed, the command below can start or stop Syncthing services.

systemctl --user start syncthing
systemctl --user stop syncthing

Configure Syncthing

After installing Syncthing on all your hosts, create a strong password for the configuration file.

To create a strong password string, use the Python command below.

python3 -c 'import bcrypt, getpass; print(bcrypt.hashpw(getpass.getpass().encode(), bcrypt.gensalt()).decode())'

Next, edit the configuration file and update the highlighted lines to match your environment.

sudo nano ~/.local/state/syncthing/config.xml

Update the highlighted lines.

#Line 54: update server IP address
#Add new lines for user and password generated
#
<gui enabled="true" tls="true" debugging="false" sendBasicAuthPrompt="false">
<address>192.168.156.130:8384</address>
<user>geekrewind</user>
<password>$2b$12$I3R0sNXp9hI64YWljSP6EeC3qtIxUpIEU.VintQ1eInr5W9rBo/Wq</password>

<apikey>wyTcXtXJEVndAVbsSy5uY72CLFVWEoc2</apikey>
<theme>default</theme>
</gui>

#Delete this line on line 95 of the file
#
<unackedNotificationID>authenticationUserAndPassword</unackedNotificationID>

Save the file and exit.

After making the necessary changes, start the app.

systemctl --user start syncthing

Perform these steps on all the Syncthing hosts you wish to sync.

Log in to the Syncthing portal

After setting up your environment, open a browser and browse to the server hostname or IP address, followed by port number 8384.

https://srv1.example.com:8384

Enter the username and password you added to the configuration file to log in.

Once you log in, click the “Actions” and select “Show ID” on the top menu.

Copy the connection ID and use it to add a remote host.

Click “Add Remote Device” on the remote host and enter the connection ID you copied from the other host.

Return to the original host and confirm your desire to add the host when prompted in the portal.

In no time, both hosts should be synchronized.

That should do it!

Conclusion:

In summary, Syncthing offers a flexible and effective way to synchronize files across multiple devices. You can ensure secure and reliable file management by following the installation and configuration steps outlined above. Here are the key takeaways:

  • Open-source Tool: Syncthing is a free and open-source solution for file synchronization.
  • Direct Device Connection: Unlike traditional cloud services, it connects devices directly, enhancing data privacy and control.
  • Customizable Options: Users can select specific folders, manage versioning, and set bandwidth limits according to their needs.
  • Strong Security: Configuration supports strong passwords to protect your data and access.
  • Seamless Synchronization: File changes are synchronized in real-time, ensuring all devices have the most current versions.
  • User-Friendly Interface: The Syncthing portal provides an intuitive interface to manage devices and settings.

By implementing Syncthing, you can create a powerful file synchronization setup tailored to your requirements.

Richard Avatar

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *