Deploy Syncthing with Dokploy: Docker Compose Setup Guide
Step-by-step guide to deploying Syncthing file synchronization on your VPS using Dokploy and Docker Compose. Includes persistent storage, sync ports, and SSL.
Deploy Syncthing with Dokploy
Dokploy is an open-source server management platform that simplifies deploying Docker Compose applications on your VPS. It handles reverse proxy configuration, SSL certificates, and deployment management — making it easy to run Syncthing as an always-on sync relay.
This guide covers deploying Syncthing on your VPS so it acts as a central sync node that is always online. Your other devices sync through this VPS, ensuring files stay up to date even when individual devices are offline.
Prerequisites
- A VPS with at least 1 vCPU, 1 GB RAM, and storage proportional to your sync data
- Dokploy installed and running on your server (installation docs)
- A domain name (e.g.,
sync.yourdomain.com) with DNS A record pointing to your server's IP
Docker Compose Configuration
Create a new Compose project in Dokploy and paste the following configuration:
version: "3.8"
services:
syncthing:
image: syncthing/syncthing:latest
restart: unless-stopped
ports:
- "8384:8384"
- "22000:22000/tcp"
- "22000:22000/udp"
- "21027:21027/udp"
environment:
- PUID=${PUID:-1000}
- PGID=${PGID:-1000}
- STGUIADDRESS=0.0.0.0:8384
volumes:
- ../files/syncthing-data:/var/syncthing
healthcheck:
test: ["CMD-SHELL", "curl -fkLsS -m 2 127.0.0.1:8384/rest/noauth/health | grep -o OK || exit 1"]
interval: 1m
timeout: 10s
retries: 3
Note: Ports 22000 (TCP/UDP) handle file synchronization and 21027 (UDP) handles device discovery. These must be exposed directly — Dokploy's reverse proxy is only used for the web UI on port 8384.
Environment Variables
Set these in Dokploy's Environment tab for your compose project:
| Variable | Purpose | Example |
|---|---|---|
PUID |
Process user ID for file ownership | 1000 |
PGID |
Process group ID for file ownership | 1000 |
In Dokploy, environment variables are set via the Environment editor in the project settings. Do not create a .env file manually — Dokploy manages this for you. The STGUIADDRESS is set in the compose file directly to ensure the web UI binds to all interfaces.
Volumes & Data Persistence
This setup uses Dokploy's ../files convention for bind-mounted volumes:
../files/syncthing-data— All synced files, Syncthing configuration, device keys, and the internal database
The ../files path is relative to the compose file inside Dokploy's project directory. This ensures your data persists across redeployments. Avoid using absolute paths (e.g., /opt/syncthing) because Dokploy may clean them during redeployment.
If you need S3 backup support, consider using named Docker volumes instead. Named volumes can be backed up with Dokploy's built-in backup features.
Domain & SSL Setup
- In your Dokploy project, navigate to the Domains tab
- Click Add Domain and enter your domain (e.g.,
sync.yourdomain.com) - Set the container port to
8384 - Enable HTTPS — Dokploy automatically provisions a Let's Encrypt SSL certificate
- Save and wait for the certificate to be issued (usually under a minute)
Dokploy's built-in Traefik reverse proxy handles TLS termination for the web UI. The sync protocol ports (22000, 21027) operate independently and use Syncthing's own TLS encryption.
Verifying the Deployment
- In Dokploy, go to your project's Deployments tab and click Deploy
- Watch the build logs — you should see the
syncthingcontainer pull and start - Check the Logs tab for the
syncthingservice. Look for:Startup complete - Open
https://sync.yourdomain.comin your browser — you should see the Syncthing web UI - On first access, set a GUI password under Actions > Settings > GUI to secure the web interface
- Add your VPS node's Device ID to your other Syncthing instances and share folders to begin syncing
Troubleshooting
Web UI shows "Connection Refused"
Verify that STGUIADDRESS is set to 0.0.0.0:8384. By default, Syncthing only listens on 127.0.0.1, which blocks external access. Check container logs for the GUI listening address.
Devices can't connect to the VPS Ensure ports 22000 (TCP and UDP) are open in your VPS firewall. Syncthing uses these for file transfer. Port 21027 (UDP) is used for local discovery but is less critical for remote sync — devices can connect using the Device ID directly.
Sync is slow between devices Check your VPS bandwidth limits. Syncthing defaults to no rate limit — you can configure send/receive rate limits in the web UI under Actions > Settings > Connections. For large initial syncs, consider connecting devices on the same network first.
File permission issues
Ensure PUID and PGID match the ownership of files in ../files/syncthing-data. From your server shell, fix permissions: chown -R 1000:1000 ../files/syncthing-data.
Learn more about Syncthing in our complete overview.
Need a VPS? Hostinger VPS starts at $4.99/mo — perfect for running Syncthing.
For more on Docker Compose deployments in Dokploy, see the Dokploy Docker Compose documentation.
App data sourced from selfh.st open-source directory.
Ready to get started?
Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.
Get Hostinger VPS — $4.99/mo// up to 75% off + free domain included
// related topics
fordnox
Expert VPS reviews and hosting guides. We test every provider we recommend.
// last updated: February 12, 2026. Disclosure: This article may contain affiliate links.