Cloud storage is convenient, but your files live on someone else’s servers, under someone else’s rules and prices. Syncthing is a free, open-source tool that keeps folders in sync between your own devices, such as your phone, your laptop, and a mini PC at home, with no account and no middleman storing your files. A mini PC that’s always on is the perfect always-available member of that group.
This guide shows you how to run Syncthing on a mini PC with Docker Compose, connect your first device, and share a folder. It also explains the most important thing to understand about sync tools: syncing is not the same as backing up. If you’re new to Docker, read our Docker Compose tutorial for beginners first.
What Syncthing does
Syncthing connects your devices directly to each other. When you change a file in a shared folder on one device, the change is sent to the other devices that share that folder. Each device is identified by a long Device ID, and two devices only exchange files after you approve each other.
Typical home uses include:
- Copying phone photos to the mini PC automatically.
- Keeping a documents folder identical on a laptop and a desktop.
- Keeping a notes folder in sync across all your devices.
Sync is not a backup
This catches many beginners out. If you delete a file in a synced folder, the deletion is sent to every other device too. If ransomware encrypts files on your laptop, the encrypted versions can sync everywhere. Syncthing offers file versioning, which keeps older copies, and that helps, but it isn’t a substitute for real backups. Keep a separate backup, as described in our homelab backup strategy for beginners.
What you need
- A Linux mini PC with Docker and the Compose plugin. If you’re starting fresh, see our guide to installing Ubuntu Server on a mini PC.
- A reserved IP address for the mini PC. Our home network basics guide explains how.
- A second device to sync with, such as a laptop or an Android phone. Syncthing offers downloads for common platforms on its website, so check there for yours.
Step 1: Create the folders
sudo mkdir -p /srv/docker/syncthing/st-sync
sudo chown -R $USER:$USER /srv/docker
cd /srv/docker/syncthingEverything Syncthing stores will live in the st-sync folder, including its configuration and the folders you share.
Step 2: Write the Compose file
nano compose.yamlThis is based on the example in Syncthing’s own Docker instructions, with the GUI address set so you can reach it from another computer on your network:
services:
syncthing:
image: syncthing/syncthing
container_name: syncthing
hostname: minilab-syncthing
environment:
- PUID=1000
- PGID=1000
- STGUIADDRESS=0.0.0.0:8384
volumes:
- ./st-sync:/var/syncthing
network_mode: host
restart: unless-stoppedWhat the important lines do
- network_mode: host is what Syncthing’s documentation recommends. With Docker’s normal bridge network, your local network addresses are hidden, which can stop devices connecting directly and slow transfers.
- PUID and PGID are the user and group Syncthing runs as. The default of 1000 matches the first user on most Ubuntu systems. Run
idto check yours. - STGUIADDRESS sets where the web dashboard listens. Syncthing’s official example leaves it empty, which keeps the dashboard reachable only from the mini PC itself. Setting it to
0.0.0.0:8384lets you open it from another computer, but then you must set a password straight away. - The volume keeps your settings and synced files on the mini PC.
Step 3: Start it
docker compose up -dBecause the container uses host networking, there are no port lines to set. Syncthing uses port 8384 for the dashboard, port 22000 for syncing, and port 21027 (UDP) for finding devices on your local network.
If you use the ufw firewall
If you turned on ufw as in our Ubuntu guide, it may block these ports. Allow them from your home network only, replacing the range with your own:
sudo ufw allow from 192.168.1.0/24 to any port 8384 proto tcp
sudo ufw allow from 192.168.1.0/24 to any port 22000
sudo ufw allow from 192.168.1.0/24 to any port 21027 proto udpStep 4: Secure the dashboard
Open http://YOUR-SERVER-IP:8384 in a browser on another device. Syncthing’s developers strongly recommend setting a password, and you should do it before anything else:
- Click Actions, then Settings.
- Open the GUI tab.
- Enter a username and a long, unique password, and save.
You can also turn on HTTPS for the dashboard on that tab. If you’d rather not expose the dashboard to your network at all, remove the STGUIADDRESS line and reach it through an SSH tunnel instead, which opens it only on your own computer.
Step 5: Connect a second device
- Install Syncthing on your laptop or phone and open it.
- On the mini PC dashboard, click Actions, then Show ID, and copy the Device ID.
- On your other device, choose to add a remote device and paste the ID.
- Back on the mini PC dashboard, a request will appear. Accept it.
Step 6: Share a folder
On the device that has the files, add a folder, give it a label, choose its path, and share it with the mini PC. When the request appears on the mini PC dashboard, accept it and choose where to store it. On the mini PC, folders should sit under /var/syncthing inside the container, which maps to your st-sync folder.
Choose the right folder type
- Send & Receive: changes flow both ways. Good for a laptop and desktop.
- Send Only: this device shares its changes but ignores changes from others.
- Receive Only: this device receives files but never sends its own edits. Good for a copy on the mini PC.
Turn on versioning
When you set up a shared folder, choose a versioning option so deleted or overwritten files are kept for a while. Common choices are Trash Can, which moves deleted files into a hidden folder, Simple, which keeps a set number of old versions, and Staggered, which keeps versions at gradually wider gaps. Trash Can is the easiest to understand for a beginner.
Remote access and safety
- Don’t forward the dashboard port on your router. If you need to reach the dashboard while away, use a private network, such as the one in our Tailscale remote access guide.
- Only approve devices you recognize. A shared folder is only as safe as the devices that can join it.
- Keep it updated: run
docker compose pullanddocker compose up -dnow and then.
Troubleshooting common problems
The dashboard won’t load
Check that the container is running with docker compose ps. If you left STGUIADDRESS empty, the dashboard is only available on the mini PC itself. If you use ufw, check that port 8384 is allowed.
Devices won’t connect
Make sure both devices have added each other’s ID and both accepted the request. On a local network, check that ports 22000 and 21027 aren’t blocked. Look at each device’s status in the dashboard.
Permission errors on synced files
The user ID that Syncthing runs as needs write access to the folders. Match PUID and PGID to the owner of the folders, or fix the ownership with chown.
Conflict files appear
If the same file is changed on two devices before they sync, Syncthing keeps both and marks one as a conflict. Open both, keep the right one, and delete the other.
Frequently asked questions
Is Syncthing free?
Yes. It’s free and open source.
Is Syncthing a good backup tool?
No, not on its own. It copies changes, including deletions, to every device. Use it for sync and use a real backup tool for protection.
Does Syncthing need a cloud account?
No. Devices identify each other by Device ID, and you approve each connection.
Can I sync my phone photos to my mini PC?
Yes, with the Syncthing app on a phone that supports it. Use a Receive Only folder on the mini PC if you want a copy that can’t be changed by accident.
Wrapping up
Syncthing lets you keep your files in sync across your devices without handing them to a cloud company. Run it with a short Compose file using host networking, set a dashboard password immediately, connect your devices by ID, and share one folder to start. Turn on versioning, keep the dashboard off the open internet, and remember that syncing is not backing up.