How to Install Syncthing on Ubuntu

Install Syncthing on Ubuntu

Are you tired of juggling files between multiple devices? Want a secure, private way to keep your documents, photos, and projects synchronized across all your computers? You’ve come to the right place! In this comprehensive guide, we’ll walk you through installing Syncthing on Ubuntu – a powerful, open-source file synchronization tool that puts you in complete control of your data.

Unlike cloud storage services that store your files on someone else’s servers, Syncthing creates a direct, encrypted connection between your devices. It’s like having your own private cloud, but better – because you own it completely.

What is Syncthing?

Syncthing is a free, open-source, peer-to-peer continuous file synchronization application. Think of it as your personal file synchronization network that works without relying on any central server or third-party service. When you create, modify, or delete files on one device, Syncthing automatically replicates these changes to all your other connected devices.

This isn’t just another cloud sync tool – it’s a decentralized solution that prioritizes your privacy and gives you complete control over your data. All data transmitted between your devices is encrypted with TLS, ensuring that even if someone intercepts your traffic, they can’t read your files.

Key Features of Syncthing

Let’s dive into what makes Syncthing special:

  • 100% Free and Open Source: No hidden costs, no premium tiers, no data harvesting
  • Cross-Platform Support: Works seamlessly on Linux, Windows, macOS, Android, BSD, and Solaris
  • Real-Time Synchronization: Changes appear on other devices within seconds
  • End-to-End Encryption: All data is encrypted during transmission using TLS
  • No Central Server Required: Direct device-to-device communication
  • Selective Sync: Choose exactly which folders to sync with which devices
  • Conflict Resolution: Intelligent handling of file conflicts when the same file is modified on multiple devices
  • Web-Based Interface: Easy-to-use browser-based management interface

Why Choose Syncthing Over Other Sync Tools?

You might be wondering: “Why not just use Google Drive or Dropbox?” Here’s the thing – those services store your files on their servers, which means:

  • You’re dependent on their uptime and policies
  • Your files pass through third-party servers
  • You have limited control over data privacy
  • You often pay monthly fees for larger storage

Syncthing eliminates these concerns by creating direct connections between your devices. It’s like having your own personal Dropbox, but without the monthly fees or privacy concerns.

Prerequisites for Installing Syncthing

Before we jump into the installation process, let’s make sure you have everything you need.

System Requirements

Syncthing is lightweight and doesn’t demand much from your system:

  • Ubuntu 18.04 or newer (works on 20.04, 22.04, and 24.04)
  • At least 512MB of RAM (though 1GB is recommended for better performance)
  • 50MB of free disk space for the application itself
  • Network connectivity (local network or internet)

Required Permissions

You’ll need:

  • A user account with sudo privileges
  • Access to terminal/command line
  • Ability to modify firewall settings (if applicable)

Don’t worry if you’re not a Linux expert – we’ll guide you through each step with clear, easy-to-follow instructions.

Method 1: Installing Syncthing via Official Repository (Recommended)

The best way to install Syncthing on Ubuntu is through the official repository. This method ensures you get the latest version and automatic updates. Let’s walk through it step by step.

Step 1: Update Your System

First things first – let’s make sure your Ubuntu system is up to date. Open your terminal and run:

sudo apt update && sudo apt upgrade -y

This command updates your package lists and upgrades any outdated packages. It’s always a good practice to start with a fresh system.

Step 2: Install Required Dependencies

Syncthing needs a few tools to work properly. Install them with this command:

sudo apt install gnupg2 curl apt-transport-https -y

These packages enable secure package downloads and GPG key management.

Step 3: Add Syncthing GPG Key

Security is crucial when adding third-party repositories. Let’s add Syncthing’s official GPG key to verify package authenticity:

curl -fsSL https://syncthing.net/release-key.txt | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/syncthing.gpg

This modern approach is more secure than the older apt-key method. If you see no errors, the key was successfully added.

Step 4: Add Syncthing Repository

Now let’s add the official Syncthing repository to your system:

echo "deb https://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list

This command creates a new repository configuration file that tells APT where to find Syncthing packages.

Step 5: Install Syncthing

Time for the main event! Update your package lists and install Syncthing:

sudo apt update
sudo apt install syncthing

The installation should complete within a few minutes. You can verify the installation by checking the version:

syncthing --version

You should see output showing the installed version (likely 1.26 or newer).

Method 2: Installing Syncthing via Snap Package

If you prefer using Snap packages, you can install Syncthing this way too:

sudo snap install syncthing

However, we recommend the repository method because it provides better integration with system services and automatic updates.

Configuring Syncthing as a System Service

Once Syncthing is installed, you’ll want it to start automatically when your system boots. This is where systemd comes in handy.

Setting Up Systemd Service

Syncthing comes with a built-in systemd service template. To enable it for your user account, run:

sudo systemctl enable syncthing@$USER.service

Replace $USER with your actual username if the variable doesn’t work. For example, if your username is “john”, you’d run:

sudo systemctl enable [email protected]

Starting and Enabling Syncthing Service

Now let’s start the service:

sudo systemctl start syncthing@$USER.service

Check if it’s running properly:

systemctl status syncthing@$USER.service

You should see “active (running)” in green text. If you see any errors, don’t worry – we’ll cover troubleshooting later in this guide.

Configuring Firewall for Syncthing

Syncthing uses specific ports to communicate with other devices. If you’re running a firewall (like UFW), you’ll need to open these ports.

Syncthing primarily uses port 22000 for device communication. If you’re using UFW, open this port:

sudo ufw allow 22000/tcp

If UFW isn’t enabled but you’d like to use it:

sudo ufw enable
sudo ufw allow 22000/tcp

For the web interface (local access only), Syncthing uses port 8384, but this doesn’t need to be opened in the firewall since it only accepts local connections by default.

Accessing Syncthing Web Interface

This is where the magic happens! Syncthing provides a beautiful, user-friendly web interface for all your synchronization needs.

Initial Setup and Configuration

Open your web browser and navigate to:

http://127.0.0.1:8384

or

http://localhost:8384

You should see the Syncthing web interface. If this is your first time running Syncthing, you’ll go through a quick setup wizard that helps you:

  • Set a device name for your Ubuntu machine
  • Configure basic security settings
  • Understand the interface layout

Understanding the Dashboard

The Syncthing dashboard shows you:

  • Folders: Directories you’re synchronizing
  • Remote Devices: Other computers connected to your Syncthing network
  • Recent Changes: A log of recent file modifications
  • Global State: Overall sync status across all devices

Take a few minutes to explore the interface. It’s intuitive, but familiarity will help you troubleshoot issues later.

Setting Up Your First Folder Sync

Now for the exciting part – actually syncing some files!

Adding a Folder

  1. Click the “Add Folder” button in the web interface
  2. Choose a folder on your Ubuntu system that you want to sync
  3. Give it a descriptive label (like “Documents” or “Photos”)
  4. Set sharing preferences – you can choose which devices get access to this folder
  5. Configure advanced options if needed (ignore patterns, file versioning, etc.)

Connecting Remote Devices

To sync with other devices:

  1. Install Syncthing on your other devices (Windows, Mac, Android, etc.)
  2. Exchange Device IDs – each Syncthing installation has a unique identifier
  3. Add the remote device in your Ubuntu Syncthing interface
  4. Accept the connection on the remote device
  5. Share folders between devices

The initial sync might take a while depending on how many files you’re synchronizing, but subsequent changes sync almost instantly.

Advanced Configuration Options

Once you’re comfortable with basic syncing, you might want to explore advanced features.

Security Settings

Syncthing offers several security enhancements:

  • GUI Authentication: Set a username and password for the web interface
  • HTTPS: Enable HTTPS for the web interface
  • Device Authentication: Control which devices can connect to yours
  • Folder Passwords: Add extra encryption to specific folders

Performance Tuning

For better performance, consider:

  • Adjusting sync intervals: Reduce CPU usage by syncing less frequently
  • Bandwidth limits: Prevent Syncthing from saturating your internet connection
  • Ignore patterns: Exclude temporary files, system files, or large media files
  • Folder types: Choose between “Send & Receive,” “Send Only,” or “Receive Only” depending on your needs

Troubleshooting Common Issues

Even the best software sometimes hiccups. Here are solutions to common Syncthing problems.

Service Won’t Start

If the systemd service fails to start:

  1. Check the service status: systemctl status syncthing@$USER.service
  2. Look at the logs: journalctl -u syncthing@$USER.service
  3. Ensure you used the correct username in the service name
  4. Try restarting: sudo systemctl restart syncthing@$USER.service

Connection Problems

If devices won’t connect:

  1. Verify both devices are online
  2. Check firewall settings on both ends
  3. Ensure port 22000 is accessible
  4. Try using relay servers (enable in settings)
  5. Check that Device IDs are correct

Sync Conflicts

When the same file is modified on multiple devices:

  1. Syncthing creates conflict copies automatically
  2. Review conflicted files in your sync folder
  3. Manually resolve conflicts by choosing the correct version
  4. Delete unwanted conflict copies

Best Practices for Syncthing

To get the most out of Syncthing:

  1. Regular Updates: Keep Syncthing updated for security and performance improvements
  2. Backup Strategy: Syncthing isn’t a backup solution – use it alongside proper backups
  3. Folder Organization: Create logical folder structures before syncing
  4. Device Naming: Use descriptive names for your devices (“John’s Laptop,” “Office Desktop”)
  5. Monitor Resource Usage: Keep an eye on CPU and network usage, especially with large syncs
  6. Security First: Use strong passwords and keep your systems updated

Frequently Asked Questions (FAQs)

Q1: Is Syncthing safe to use for sensitive documents?

A: Absolutely! Syncthing uses TLS encryption for all data transmission, ensuring your files remain private during sync. Since there’s no central server, your data never leaves your control. However, remember that files are stored unencrypted on each device’s local storage.

Q2: Can I sync files between Ubuntu and Windows devices?

A: Yes! Syncthing is cross-platform and works seamlessly between Ubuntu, Windows, macOS, Android, and other supported operating systems. The setup process is similar on all platforms.

Q3: How much bandwidth does Syncthing use?

A: Syncthing only transfers changed parts of files, not entire files. This means minimal bandwidth usage after the initial sync. You can also set bandwidth limits in the settings to prevent it from affecting other network activities.

Q4: What happens if I delete a file on one device?

A: By default, the file gets deleted on all synced devices. However, you can enable file versioning to keep deleted files in a special folder, giving you a safety net against accidental deletions.

Q5: Can I use Syncthing without the web interface?

A: While Syncthing has a command-line interface, the web interface is the most user-friendly way to manage your synchronization. You can disable the web interface once everything is configured, but it’s recommended to keep it enabled for easy management and monitoring.

Marshall Anthony is a professional Linux DevOps writer with a passion for technology and innovation. With over 8 years of experience in the industry, he has become a go-to expert for anyone looking to learn more about Linux.

Related Posts