Home » CloudZat UK » Syncthing in Docker: persistent folders and a verified first sync

Syncthing in Docker: persistent folders and a verified first sync

CLOUD BACKUP & PHOTO LIBRARIES

A Syncthing container can look healthy while its files live in the wrong place. Start with persistent configuration and explicit data mounts so a container replacement does not create a new device identity or lose the folder mapping.

Editorial review: 15 November 2026 · UK

Quick answer

Use the project’s current Docker example, persist its configuration and mount each intended host data directory. Pair a second device by its device ID, then share a small test folder before introducing an existing library.

Steps to follow

  1. Before you start

    Record the exact image, configuration volume and host-to-container folder mappings. Prepare a small independent test folder and inspect the intended user/group settings. Keep the management address restricted while planning peer connectivity.

  2. Set up the right scope

    Read the official image example for the installed release. Map configuration and data to separate persistent host locations, record container paths and give the container user only the required read/write permissions. Keep the management interface reachable only by trusted users.

  3. Apply the relevant settings

    Open the web interface, set its access protection and pair the second device by checking its full device ID. Add a test folder using the container path, accept its share on the other device and choose the destination explicitly.

  4. Complete the first run

    Create and edit a sample file at each end, wait for both devices to report completion and compare its contents. Restart the container and verify that the same device identity and folder survive before adding more data.

Decisions and checks

The limitation that matters

Docker bridge networking can affect local discovery. A reachable sync address or another documented discovery route may be needed; publishing the management interface to the internet is not a discovery fix. Synchronised deletions still reach peers unless a separate recovery system protects them.

How to verify the result

Test a remote edit and a restart, then recover a deliberately changed sample through versioning or an independent backup. A green status proves agreement between devices, not protection from a mistaken deletion.

Keep the result reliable

After container recreation, verify the same identity and mapped files. Recheck interface bindings after network changes and file ownership after image or user changes. Test recovery from a peer-originated edit and maintain independent storage protection.

Keep identity, mapped folders and recovery outside the container lifecycle

Start with the documentation for the actual image

The project's Syncthing image and other maintained image packages can use different environment settings and directory conventions. Identify the exact image and version before copying a Compose example. The official image documents its persistent volume, user and group options and networking considerations. Keep those choices with your deployment description. Do not assume an option from another image has the same effect merely because the application is identical. For an existing installation, inspect the actual mounted configuration before replacing the container. A fresh configuration can create a different device identity, leaving existing peers waiting for the old device even though the new web interface looks healthy.

Make host paths and container paths explicit

The path selected inside Syncthing must be visible inside the container. A host folder is available there only through the configured mapping, and the internal name can differ from its host name. Write down both sides for configuration and each data folder. Confirm the expected contents before accepting a share. Avoid placing the only synchronized files in the container's disposable writable layer. Test replacement or recreation using the documented deployment controls after a small first sync, without removing the persistent host data. The same device identity, folder configuration and files should remain. A normal restart is useful but does not by itself prove that an incorrectly stored configuration survives container replacement.

Align file permissions with the intended writer

Check the image's configured user and group and the permissions on every host directory it needs. Test creation of a small file through Syncthing and inspect its ownership from the host. If another application or network-share user also needs access, test that identity independently. A file writable by the container is not necessarily writable by the person opening it through another service. Correct the specific directory and ownership arrangement rather than making the whole host filesystem accessible. Keep configuration and administrative secrets more restricted than ordinary shared documents. Do not run a broader privileged deployment solely to avoid understanding a single permission error in the test folder.

Separate peer connectivity from web-interface exposure

The official Docker guide explains that bridge networking can interfere with local address discovery. Follow its supported network arrangement for your host, or configure a documented reachable peer address when appropriate. Inspect the connection type and device status rather than treating a slow transfer as proof of damaged files. Opening the management interface to the internet is not a discovery solution. Keep it on a controlled access path with the documented authentication and transport protection where needed. Remember that host networking changes which interfaces the application itself listens on. Check the actual bind addresses after changing network mode instead of assuming old Docker port mappings still provide the same boundary.

Pair known devices and choose folder direction deliberately

Compare the full device IDs and share a new test folder first. Accept the share on the second device with an explicit local destination. Choose whether both sides may edit or whether one side is the reference. Send Only and Receive Only have specific reconciliation behavior; they are not simple promises that deletions cannot happen. Create, edit and delete only disposable samples while learning that behavior. Preserve unique existing files before connecting a populated folder. If a device was offline, examine conflicts when it reconnects rather than choosing the newest timestamp automatically. Each copy may contain useful work that needs a deliberate content comparison.

Test version recovery where remote changes arrive

Syncthing versioning is configured per folder and per device and applies to changes received from other devices. It does not archive every local edit on the same machine. Enable the chosen strategy on the receiver where it should preserve older content, then modify a disposable sample on its peer. Confirm the received change and use the documented recovery route to examine the earlier content. Keep an independent backup for loss of the host or its storage. A synchronized folder can faithfully replicate an accidental deletion, so agreement between peers is not the same as historical protection. Check version-storage capacity and retention along with ordinary synchronization status.

Example: a replacement container has a new device ID

Suppose the peer reports the previous device offline after a container rebuild, while the replacement shows a new ID. Stop before pairing it broadly with all existing folders. Compare the configuration volume mapping with the saved deployment description and locate the previous persistent configuration if it remains available. Do not run two copies of the same imported identity simultaneously. Recover the intended configuration through the supported process, or deliberately introduce a new identity after preserving the data and documenting the change. Test one folder first. This makes the identity transition explicit rather than hiding a missing configuration behind another round of pairing.

Compare the options

Situation / component Purpose / action What to check
Container rebuild changes identity Inspect persistent configuration mapping Do not run duplicate copies of an imported identity
Host folder is missing inside the app Trace both sides of the mount Select the container-visible path
LAN peer is slow or undiscovered Inspect documented Docker networking Exposing the management UI is not a fix

Frequently asked questions

Does a healthy container prove my data is persistent?

No. Inspect configuration and data mounts, then verify the identity and files after a controlled container recreation. Data in a disposable container layer can disappear when that layer is replaced.

Does receiver versioning protect edits made locally there?

Its documented versioning applies to received remote changes. Local edits on that same device need an appropriate independent backup or another designed recovery arrangement.

Official documentation

This guide combines current official documentation with practical recovery checks. It does not claim hands-on testing of your installation. Menu labels and supported procedures can vary by release; follow the documentation for your installed version.

Scroll to Top