Back to articles
DevOps & Systems

Skip the Cloud: High-Speed File Sync Directly Between VPS and Personal Device Using Syncthing P2P

A detailed DevOps guide to set up high-speed file synchronization between a VPS and a personal device without using cloud services, using Syncthing's P2P technology. Covers...

DPTCloud Engineering6 min read
Skip the Cloud: High-Speed File Sync Directly Between VPS and Personal Device Using Syncthing P2P

Image credit: ArminEP · Pixabay Content License

In software development and data management environments, synchronizing files between a VPS and a personal device is a common requirement. However, using cloud services like Google Drive, Dropbox, or OneDrive often results in speed limitations, costs, and reduced data control. Syncthing, an open-source file synchronization platform, enables you to create a direct P2P (Peer-to-Peer) network between devices, completely bypassing intermediate cloud services. This guide will walk you through setting up high-speed, direct file synchronization between a VPS and a personal device using Syncthing.

1. Introduction to Syncthing and Benefits of Skipping the Cloud

Syncthing is an open-source file synchronization platform based on a P2P model. Instead of sending files through a central server (cloud), Syncthing establishes a direct connection between the source and destination devices. This approach offers several key benefits:

  • Faster speeds: Not limited by cloud upload speeds, you can leverage the maximum bandwidth of your network connection.
  • Reliability and data control: Your data only passes through devices you control, avoiding storage on third-party servers.
  • Low cost: No need to pay for storage capacity or bandwidth.
  • Scalability: Easily add more devices to the synchronization network.

Bypassing the cloud is especially useful when you need to synchronize large files (such as videos, development projects, or database backups) between a VPS (e.g., a Docker, Nginx, or database server) and a personal computer without relying on cloud services.

2. Installing and Configuring Syncthing on VPS and Personal Device

The installation and configuration process is straightforward and similar on both devices. Below is a detailed guide for both common platforms.

2.1. Install on VPS (Linux)

For Linux VPS (typically Ubuntu or Debian), you can install Syncthing using the package manager.

# Update package list
sudo apt update

# Install Syncthing
sudo apt install syncthing -y

# Start Syncthing service
sudo systemctl start syncthing@<username>

# Enable service to start on boot
sudo systemctl enable syncthing@<username>

Replace <username> with your VPS username. After installation, Syncthing will run as a background service.

2.2. Install on Personal Device (Windows/Mac/Linux)

For personal devices, download the installer from Syncthing’s official website.

  1. Download the appropriate installer for your operating system from https://syncthing.net/downloads/.
  2. Run the installer and follow the prompts.
  3. After installation, open the Syncthing application.

On both devices, Syncthing will create a web interface (GUI) for management. This interface is typically accessible at http://localhost:8384 (on the personal device) or http://:8384 (on the VPS).

3. Setting Up Direct P2P Connection Between VPS and Personal Device

After installation, you need to establish a connection between the two devices.

  1. On the personal device, open the Syncthing web interface. In the "Devices" section, select "Add Device".
  2. On the VPS, open the Syncthing web interface and go to the "Devices" section. Select "Add Device".
  3. On the personal device, enter the Device ID of the VPS (found in the "Devices" section of the VPS). On the VPS, enter the Device ID of the personal device.
  4. Select "Add" to add the device. The two devices will automatically discover and establish a P2P connection.
  5. On the personal device, select the folder you want to sync (e.g., "Documents"). On the VPS, select the corresponding folder (e.g., "/home/user/Documents").
  6. Select "Add" to start synchronization.

Synchronization will begin immediately. You can monitor the progress in the Syncthing web interface.

4. Testing Connection and Troubleshooting

To ensure the connection works reliably, perform the following checks:

4.1. Connection Test

In the Syncthing web interface, go to the "Devices" section. You should see the opposing device with a status of "Connected" and "OK". If the status is "Waiting for connection", there may be a firewall or NAT issue.

4.2. Common Troubleshooting

  • Cannot connect: Check the firewall on both the VPS and personal device. Ensure ports 22000 (TCP) and 21027 (UDP) are open. For VPS, you may need to configure the firewall or request the provider to open the ports.
  • Slow synchronization: Ensure both devices have stable internet connections. Check network bandwidth. Syncthing may be limited by network configuration or system resources.
  • Device not found: Ensure you are entering the correct Device ID. Device IDs are long strings and are case-sensitive. Double-check the ID entry.

For more complex issues, refer to the official Syncthing documentation at https://docs.syncthing.net/.

5. Conclusion

Using Syncthing to synchronize files directly between a VPS and a personal device without cloud intermediaries is a powerful, secure, and efficient solution. It allows you to maximize network bandwidth and maintain full control over your data. With this guide, you can set up a reliable P2P synchronization system that meets the needs of development and data management in a DevOps environment.

Related infrastructure & engineering guides: NVMe Cloud VPS for Docker, Nginx & Databases · Benchmarking and Stress Testing: Advanced DevOps Guide

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478