How to Use `syncthing` for P2P File Sync on Arch Linux
syncthing
for P2P File Sync on Arch LinuxCategories:
6 minute read
In an era where cloud storage services dominate the file syncing landscape, many users are turning to decentralized and privacy-respecting alternatives. One of the most prominent tools in this space is Syncthing — a powerful, open-source, cross-platform file synchronization tool that operates via peer-to-peer (P2P) communication. It allows users to sync files directly between devices without storing data on a third-party server.
In this article, we’ll explore how to install, configure, and effectively use Syncthing on Arch Linux to sync files between two or more devices securely and efficiently.
🌐 What is Syncthing?
Syncthing is an open-source, continuous file synchronization program. It synchronizes files between two or more devices over a local network or the internet. It does not require a centralized server — each device (or “node”) communicates with peers directly, encrypting all traffic end-to-end using TLS.
🔐 Key Features
- End-to-end encryption
- Peer-to-peer architecture (no central server)
- Cross-platform support (Linux, Windows, macOS, BSD, Android)
- Versioning and conflict resolution
- Configurable and lightweight
- User-friendly web UI
⚙️ Installing Syncthing on Arch Linux
Arch Linux users can easily install Syncthing from the official repositories using pacman
.
Step 1: Update Your System
sudo pacman -Syu
Step 2: Install Syncthing
sudo pacman -S syncthing
This will install the core Syncthing service and CLI tools.
🧑💻 Running Syncthing
You can run Syncthing either as a user-level service or system-wide. It’s generally recommended to run it under your user account, as each user may have different sync preferences and folders.
Step 1: Start Syncthing for Your User
systemctl --user start syncthing.service
Step 2: Enable Syncthing on Startup
systemctl --user enable syncthing.service
This ensures Syncthing starts automatically when you log into your user session.
🔍 Note: If you’re running Syncthing on a headless server, consider enabling and managing the system-wide service.
🌐 Accessing the Syncthing Web Interface
After starting the service, Syncthing launches a web-based GUI that you can access locally:
http://localhost:8384
If you’re using a remote system, you may need to set up port forwarding or a reverse proxy. The web interface allows you to manage your Syncthing configuration without needing to use the CLI.
🖧 Understanding Syncthing Terminology
Before diving into configuration, it helps to understand some of the core concepts used in Syncthing:
📁 Folder
A folder in Syncthing is a directory on your file system that you want to synchronize. You can add multiple folders, each with its own sync settings.
🖥 Device
Each computer or mobile device running Syncthing is considered a device. Devices are identified by a unique Device ID, which is generated automatically.
🔐 Device ID
This is a unique cryptographic identifier that allows devices to recognize and communicate securely with each other.
🔄 Sync Direction
You can configure folders to be:
- Send & Receive (default – full synchronization)
- Send Only (one-way sync)
- Receive Only (mirror without changes being pushed back)
🔧 Configuring Syncthing for File Sync
Let’s go through a basic two-device setup.
Step 1: Get the Device ID
On each device, open the web interface and go to:
Actions → Show ID
Copy the full device ID. You’ll need to exchange this between the devices you want to sync.
Step 2: Add the Remote Device
On Device A:
- Go to the web interface.
- Click Add Remote Device.
- Paste the Device ID of Device B.
- Optionally give it a name.
- Choose which folders (if any) to share immediately.
Repeat the same on Device B by adding Device A’s ID.
When both devices have each other’s IDs and shared folders, they will begin syncing once connected.
Step 3: Add and Share Folders
Click Add Folder on either device:
- Set a Folder Label (name in the UI).
- Set the Folder Path (actual location on disk).
- Assign a Folder ID (must match across devices).
- Under Sharing, select which remote device(s) to sync with.
Once accepted on the other device, synchronization begins automatically.
🔒 Security Considerations
Syncthing is designed with privacy and security in mind:
- All communication is TLS-encrypted.
- Data is not stored on third-party servers.
- Devices must be explicitly added to your trusted list.
- Each node only syncs with devices you’ve approved.
You can further secure your setup by:
- Setting a GUI password (
Actions → Settings → GUI
). - Using firewall rules to restrict access.
- Running Syncthing on a VPN or over SSH tunnels for remote access.
⚡ Advanced Features
🕓 Versioning
Enable File Versioning to preserve old versions of modified/deleted files:
- Simple Versioning: Keeps a set number of old versions.
- Staggered Versioning: Saves versions at increasingly longer intervals.
- Trash Can: Moves deleted files to a
.stversions
directory.
🧠 Ignoring Files
Use .stignore
files within folders to exclude certain files or patterns from syncing.
Example .stignore
:
*.tmp
node_modules/
*.log
This is useful for development folders, backups, or temporary files.
🌍 NAT Traversal and Global Discovery
Syncthing can sync over the internet even when devices are behind NAT, using:
- Global Discovery Servers
- Relay Servers
These features can be disabled for LAN-only syncing if desired.
🐚 CLI Usage
Though most users stick to the web UI, you can manage Syncthing via the CLI:
syncthing --help
Useful commands:
syncthing -browser-only
– opens the UI without restarting the service.syncthing -reset
– resets configuration (use with caution).syncthing --logfile=syncthing.log
– write logs to a file.
📱 Syncing with Mobile Devices
Syncthing is also available for Android via the Google Play Store or F-Droid. This makes it easy to sync photos, documents, and more between your phone and Arch Linux system.
Once installed:
- Open the app and copy your Device ID.
- Add it to your Arch system’s Syncthing UI.
- Share folders between the devices as needed.
🧪 Troubleshooting Tips
Devices not connecting?
- Ensure Syncthing is allowed through the firewall.
- Check that both devices are online.
- Use the “Actions → Logs” menu for troubleshooting.
Files not syncing?
- Check folder IDs and paths match.
- Make sure both devices have accepted the folder share.
- Look for conflicts or file permission issues.
Web UI not loading?
- Ensure the service is running:
systemctl --user status syncthing
- Check if another service is using port 8384.
- Ensure the service is running:
🧭 Alternatives to Syncthing
While Syncthing is a great tool, depending on your needs, you might also consider:
- Resilio Sync (formerly BitTorrent Sync) – Proprietary but fast.
- Nextcloud + Local Sync – More than just file syncing.
- Seafile – Efficient and good for larger file sets.
However, for a truly free, decentralized, and cross-platform P2P sync, Syncthing is hard to beat.
🏁 Conclusion
Syncthing is a reliable, secure, and flexible tool for syncing files between devices without relying on cloud storage. Whether you’re looking to keep your desktop and laptop in sync, back up photos from your phone, or collaborate on projects with peers, Syncthing provides a seamless experience on Arch Linux.
Its ease of use, robust encryption, and customizable behavior make it ideal for both tech-savvy users and those new to decentralized tools. Give it a try — and take back control of your data.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.