Why self-host Syncthing on a VPS
Syncthing is a decentralized file synchronization tool: each device talks directly to the others, with no central server or copy held by a provider. The problem with pure peer-to-peer is that your machines aren't always on at the same time — your laptop is off when your desktop wants to sync. A VPS solves exactly this: it acts as a permanent node available 24/7, present on the Internet with a stable public IP, toward which all your devices converge. Files transit encrypted (TLS) and the VPS holds a synchronized copy that also serves as an off-site backup. Unlike shared hosting, a VPS allows opening the transfer ports and keeping a Syncthing daemon running permanently.
Concrete benefits of Syncthing on a VPS
- Permanent relay node: your devices no longer need to be on simultaneously to synchronize.
- End-to-end encryption (TLS) between all nodes, with no trust granted to any cloud.
- Natural off-site backup: the VPS keeps an up-to-date copy of your shared folders.
- File versioning (staggered/simple), configurable folder by folder, to recover a previous version.
- No per-gigabyte storage cost: only the VPS disk space matters.
- Discovery by static IP: fast direct connection without depending on public discovery servers.
Technical prerequisites
Syncthing is remarkably frugal in CPU and RAM, but it's the disk that sizes the server: you need as much space as the volume of data to synchronize. Plan for 1 vCPU and 1 GB of RAM, plus the storage suited to your folders (20, 50 GB or more depending on your needs). On the network side, two ports must be reachable: 22000 (TCP/UDP, data transfer) and 21027 (UDP, local discovery, optional on a remote VPS). The admin interface runs on port 8384 and must absolutely stay protected. Docker and Docker Compose are enough; a sync.yourdomain.com subdomain is useful to access the interface over HTTPS via a reverse proxy.
Deploy Syncthing step by step
Prepare the container
On the VPS, create /opt/syncthing and a docker-compose.yml based on the syncthing/syncthing:latest image. Mount a configuration volume and a data volume, and set the PUID/PGID variables for file permissions.
Open the transfer ports
Map port 22000 in TCP and UDP to the container and open it in the VPS firewall: ufw allow 22000. This is the port through which data transits between nodes. Do not publish port 8384 to the Internet.
Start Syncthing and retrieve the ID
Start with docker compose up -d. Retrieve the node identifier (Device ID) from the logs or via the interface: it's the unique fingerprint that will be used to pair your other devices.
Secure the admin interface
Expose port 8384 only behind an HTTPS reverse proxy with authentication. With Caddy: sync.yourdomain.com { reverse_proxy syncthing:8384 }. Also set an interface username/password in Syncthing's GUI settings.
Pair your devices
On each device (desktop, laptop, mobile), add the VPS as a new device via its Device ID, then accept the reciprocal request on the server side. Set up a shared folder and choose the mode (send only, receive only, or bidirectional).
Enable versioning
For important folders, enable “staggered” versioning on the VPS side: Syncthing keeps the successive versions of modified or deleted files there, turning your node into a safety net against handling mistakes.
Configure the VPS node in “Receive Only” mode for the folders you only want to back up: that way the server will never overwrite your devices, it only archives what is sent to it. And since you have a static IP, disable the global discovery servers and declare the VPS address explicitly (tcp://IP:22000) in the config of the other nodes: connections establish faster and don't depend on any external service.