Linux

How to Install Syncthing on Ubuntu 22.04

How to Install Syncthing on Ubuntu 22.04

Syncthing is a powerful, open-source file synchronization tool that allows you to share files between multiple devices securely. It eliminates the need for third-party cloud services by enabling you to synchronize files directly between your devices over a secure connection. This guide will walk you through the process of installing and configuring Syncthing on Ubuntu 22.04.

Prerequisites
Before you start, ensure you have the following:

A computer running Ubuntu 22.04.
A non-root user with sudo privileges.
An active internet connection.
Step 1: Update Your System
It’s always a good practice to update your package list and upgrade installed packages before starting a new installation. Open your terminal and execute the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Dependencies
Syncthing requires some dependencies to be installed on your system. Use the following command to install them:

sudo apt install curl gnupg2 -y

This command installs curl, which allows you to download files, and gnupg2, which is necessary for managing cryptographic keys.

Step 3: Add the Syncthing Repository
Syncthing is not available in the default Ubuntu repositories, so you need to add its official repository. First, add the GPG key for the Syncthing repository:

curl -s https://syncthing.net/release-key.txt | gpg –dearmor | sudo tee /usr/share/keyrings/syncthing.gpg > /dev/null

Next, add the Syncthing repository to your system:

echo “deb [signed-by=/usr/share/keyrings/syncthing.gpg] https://apt.syncthing.net/ syncthing stable” | sudo tee /etc/apt/sources.list.d/syncthing.list

Step 4: Install Syncthing
Now that the repository is added, you can install Syncthing by running:

sudo apt update
sudo apt install syncthing -y

This command will download and install Syncthing along with its dependencies.

Step 5: Start Syncthing
After the installation is complete, you can start Syncthing. If you want to run Syncthing for your user account, execute the following command:

syncthing

If you want to run Syncthing as a system service, you can use the following commands:

sudo systemctl enable syncthing@$USER.service
sudo systemctl start syncthing@$USER.service

This will ensure that Syncthing starts automatically when you log in.

Step 6: Access Syncthing Web Interface
Syncthing has a web-based interface that allows you to manage your synchronization settings easily. Open your web browser and navigate to:

http://localhost:8384

You should see the Syncthing web interface. From here, you can configure shared folders, devices, and other settings.

Step 7: Configure Syncthing
Add a Folder to Sync:

Click on the “Add Folder” button in the web interface.
Provide a label for your folder and the path to the directory you want to sync.
Configure any other options as needed, then click “Save.”
Connect Devices:

Each Syncthing instance has a unique Device ID. To connect another device, you will need this ID.
Click on “Add Remote Device,” enter the Device ID, and provide a name for the device.
Ensure the device is online and has accepted your connection request.
Set Up Folder Sharing:

After adding a remote device, you can choose which folders to share with it. This allows for selective synchronization based on your preferences.
Step 8: Set Up Firewall (Optional)
If you have a firewall enabled, ensure that the necessary ports are open for Syncthing. By default, Syncthing uses port 8384 for its web interface and port 22000 for synchronization. You can open these ports using the following commands:

sudo ufw allow 8384
sudo ufw allow 22000

Step 9: Enable Secure Connection (Optional)
For added security, you can enable HTTPS for the Syncthing web interface. This involves generating a self-signed SSL certificate. You can follow the instructions in the official Syncthing documentation to configure HTTPS.

If you would like to improve yourself in server management, you can purchase a server from our site, experiment and improve yourself in an affordable and reliable environment. I wish you good luck.

Thank you for visiting our page, you can now read our rclone article by clicking the link below

How to Download and Use Rclone on Linux

Conclusion

Congratulations! You have successfully installed Syncthing on your Ubuntu 22.04 system and configured it for file synchronization. Syncthing provides a robust and secure way to keep your files in sync across multiple devices without relying on third-party cloud services.

For more information, tips, and advanced configurations, visit the official Syncthing documentation.

Related Articles

Leave a Reply

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

Back to top button