Here’s a complete, step-by-step guide to installing and configuring Syncthing on servers that use Webmin/Virtualmin, including one-way (unidirectional) sync and instructions for all major Linux families. This article assumes that Webmin/Virtualmin is already installed on the server (Mine is an Ubuntu Server v24.04).
Overview:
When you install Syncthing on a Webmin/Virtualmin server there are a couple of Prerequisites:
The prerequisites are:
– Root or sudo access
– Webmin already installed (optional but assumed)
– At least 2 servers/devices
Open ports:
– 8384 (Web UI)
– 22000/tcp (sync traffic)
– 21027/udp (discovery)
Step 1 — Install Syncthing
Ubuntu / Debian:- sudo apt update
- sudo apt install syncthing -y
- curl -fsSL https://syncthing.net/release-key.txt | sudo gpg --dearmor -o /usr/share/keyrings/syncthing.gpg
echo "deb [signed-by=/usr/share/keyrings/syncthing.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
- sudo apt update
- sudo apt install syncthing
note: (Optional: Official repo for latest version)
CentOS / RHEL / AlmaLinux / Rocky Linuxsudo dnf install epel-release -y
sudo dnf install syncthing -y
note: Syncthing is provided via EPEL on RHEL-based systems
Generic (any Linux with Webmin)- wget https://github.com/syncthing/syncthing/releases/latest/download/syncthing-linux-amd64.tar.gz
- tar -xvf syncthing-linux-amd64.tar.gz
- cd syncthing-*/
- sudo cp syncthing /usr/local/bin/
Step 2 — Enable & Start Service
Run as your normal user (recommended):sudo systemctl enable syncthing@$(whoami)
sudo systemctl start syncthing@$(whoami)
Check status:systemctl status syncthing@$(whoami)
Step 3 — Access the Web UI
Local server:
http://localhost:8384
Remote server (via SSH tunnel):
ssh -L 8384:localhost:8384 user@server-ip
Then open:
http://localhost:8384
note: Syncthing UI runs in browser and is used for all configuration
What the UI looks like (Put an image here).
Step 4 — Secure the UI (IMPORTANT!!!)
In Web UI:
– Click Actions → Settings
– Go to GUI tab
Set:
– Username
– Password
– Save
Step 5 — Connect Devices
On Server A:
– Click Actions → Show ID
– Copy Device ID
On Server B:
– Click Add Remote Device
– Paste Device ID
– Name it (e.g., “Backup Server”)
note: Accept on both sides
Step 6 — Create Shared Folder
On source server:
– Click Add Folder
– Configure:
– Folder Label: data-sync
– Folder Path: /data/source
– Under Sharing tab
– Select destination device
On destination:
– Accept folder
Step 7 — Configure One-Way Sync (Unidirectional)
note: This is the critical part.
Goal: From Source to Remote
– Server A → Server B (backup only)
– No changes from B → A
On Destination (Server B):
– Edit the shared folder
Set Folder Type:
– Receive Only
On Source (Server A):
– Edit Folder
Set Folder Type:
– Send Only
Behavior:
Action Result
– Change on A Syncs to B
– Change on B Ignored / flagged
– Delete on A Deletes on B
This is how Syncthing enforces unidirectional sync.
Step 8 — Optional: Ignore Changes on Destination
On destination:
– Click Revert Local Changes (if needed)
Enable:
– “Ignore Permissions” (optional)
– “Watch for changes” (recommended)
Step 9 — Firewall Configuration
Ubuntu/Debian (UFW)
– sudo ufw allow 22000/tcp
– sudo ufw allow 21027/udp
– sudo ufw allow 8384/tcp
RHEL/CentOS/Alma/Rocky
– sudo firewall-cmd –permanent –add-port=22000/tcp
– sudo firewall-cmd –permanent –add-port=21027/udp
– sudo firewall-cmd –permanent –add-port=8384/tcp
– sudo firewall-cmd –reload
Step 10 — Integrating with Webmin
Webmin doesn’t natively manage Syncthing, but you can:
Option A — Use Webmin “Command Shell”
– Run Syncthing commands directly
Option B — Add Custom Command
– Webmin → Custom Commands
Add:
– Start: systemctl start syncthing@user
– Stop: systemctl stop syncthing@user
Option C — Reverse Proxy (Advanced)
– Use Webmin’s Apache/Nginx module
Proxy:
http://localhost:8384
Best Practices
- Run Syncthing as non-root user
- Store data outside /home if server-based (/srv or /data)
- Use Send Only / Receive Only for backups
- Enable versioning (trash can or staggered)
Verification
On both servers:
– Check status in UI:
– “Up to Date” = success
Test:
– touch /data/source/testfile.txt
Result:
Should appear on destination
Summary
You now have:
Syncthing installed across Linux distros
Integrated alongside Webmin
Secure web UI access
Device pairing
One-way sync (Send Only → Receive Only)
If you want the next step
– Add multi-node cluster sync
– Build a Webmin module for Syncthing
– Set up TLS + reverse proxy (HTTPS + domain)
Or
– generate a fully automated install script (Ansible/bash)
There is an article from 5 years ago on WikiSuite called “How to install Syncthing on Virtualmin“
Let me know if it works for you. Also let me know if there is anything you would like me to write about and I will do my best to add an article here on the blog.
Thank you for reading.