Scroll to navigation



syncthing - Syncthing


syncthing [-audit] [-auditfile=<file|-|-->] [-browser-only] [device-id]

[-generate=<dir>] [-gui-address=<address>] [-gui-apikey=<key>]
[-home=<dir> | -config=<dir> -data=<dir>]
[-logfile=<filename>] [-logflags=<flags>]
[-no-browser] [-no-console] [-no-restart] [-paths] [-paused]
[-reset-database] [-reset-deltas] [-unpaused] [-upgrade]
[-upgrade-check] [-upgrade-to=<url>] [-verbose] [-version]


Syncthing lets you synchronize your files bidirectionally across multiple devices. This means the creation, modification or deletion of files on one machine will automatically be replicated to your other devices. We believe your data is your data alone and you deserve to choose where it is stored. Therefore Syncthing does not upload your data to the cloud but exchanges your data across your machines as soon as they are online at the same time.

The syncthing core application is a command-line program which usually runs in the background and handles the synchronization. It provides a built-in, HTML and JavaScript based user interface to be controlled from a web browser. This frontend communicates with the core application through some HTTP APIs, which other apps like graphical system integration helpers can use as well, for greatest flexibility. A link to reach the GUI and API is printed among the first few log messages.


Write events to timestamped file audit-YYYYMMDD-HHMMSS.log.

Use specified file or stream ("-" for stdout, "--" for stderr) for audit events, rather than the timestamped default file name.

Open the web UI in a browser for an already running Syncthing instance.

Print device ID to command line.

Generate key and config in specified dir, then exit.

Override GUI listen address. Set this to an address ( or file path (/var/run/st.sock, for UNIX sockets).

Set common configuration and data directory. The default configuration directory is $HOME/.config/syncthing (Unix-like), $HOME/Library/Application Support/Syncthing (Mac) and %LOCALAPPDATA%\Syncthing (Windows).

Set configuration directory. Alternative to -home and must be used together with -data.

Set data (e.g. database) directory. Alternative to -home and must be used together with -config.

Set destination filename for logging (use "-" for stdout, which is the default option).

Select information in log line prefix. The -logflags value is a sum of the following:
  • 1: Date
  • 2: Time
  • 4: Microsecond time
  • 8: Long filename
  • 16: Short filename

To prefix each log line with date and time, set -logflags=3 (1 + 2 from above). The value 0 is used to disable all of the above. The default is to show time only (2).

Do not start a browser.

Hide the console window. (On Windows only)

Do not restart Syncthing when it exits. The monitor process will still run to handle crashes and writing to logfiles (if configured to).

Print the paths used for configuration, keys, database, GUI overrides, default sync folder and the log file.

Start with all devices and folders paused.

Reset the database, forcing a full rescan and resync. Create .stfolder folders in each sync folder if they do not already exist. Caution: Ensure that all sync folders which are mountpoints are already mounted. Inconsistent versions may result if the mountpoint is later mounted and contains older versions.

Reset delta index IDs, forcing a full index exchange.

Start with all devices and folders unpaused.

Perform upgrade.

Check for available upgrade.

Force upgrade directly from specified URL.

Print verbose log output.

Show version.


Success / Shutdown
Upgrade not available

Exit codes over 125 are usually returned by the shell/binary loader/default signal handler. Exit codes over 128+N on Unix usually represent the signal which caused the process to exit. For example, 128 + 9 (SIGKILL) = 137.


Syncthing can use a SOCKS, HTTP, or HTTPS proxy to talk to the outside world. The proxy is used for outgoing connections only - it is not possible to accept incoming connections through the proxy. The proxy is configured through the environment variable all_proxy. Somewhat unusually, this variable must be named in lower case - it is not “ALL_PROXY”. For example:

$ export all_proxy=socks://


The following environment variables modify Syncthing’s behavior in ways that are mostly useful for developers. Use with care. If you start Syncthing from within service managers like systemd or supervisor, path expansion may not be supported.

Used to increase the debugging verbosity in specific or all facilities, generally mapping to a Go package. Enabling any of these also enables microsecond timestamps, file names plus line numbers. Enter a comma-separated string of facilities to trace. syncthing -help always outputs an up-to-date list. The valid facility strings are:
Configuration loading and saving.
The database layer.
Main package.
The root hub; the largest chunk of the system. File pulling, index transmission and requests for chunks.
File change detection and hashing.
File versioning.

Multicast and broadcast UDP discovery packets: Selected interfaces and addresses.
Connection handling.
Dialing connections.
Remote device discovery requests, replies and registration of devices.
NAT discovery and port mapping.
NAT-PMP discovery and port mapping.
The BEP protocol.
Relay interaction (strelaysrv).
UPnP discovery and port mapping.

Filesystem access.
Event generation and logging.
SHA256 hashing package (this facility currently unused).
Persistent device and folder statistics.
Mutexes. Used for debugging race conditions and deadlocks.
Binary upgrades.
Filesystem access while walking.
All of the above.

Write block profiles to block-$pid-$timestamp.pprof every 20 seconds.
Write a CPU profile to cpu-$pid.pprof on exit.
Used for debugging internal deadlocks; sets debug sensitivity. Use only under direction of a developer.
Used for debugging internal deadlocks; sets debug sensitivity. Use only under direction of a developer.
Directory to load GUI assets from. Overrides compiled in assets. Useful for developing webgui, commonly use STGUIASSETS=gui bin/syncthing.
Specify which hashing package to use. Defaults to automatic based on performance. Specify “minio” (compatibility) or “standard” for the default Go implementation.
Write heap profiles to heap-$pid-$timestamp.pprof each time heap usage increases.
Don’t create a default folder when starting for the first time. This variable will be ignored anytime after the first run.
Equivalent to the -no-restart flag
Disable automatic upgrades.
Set to a listen address such as “” to start the profiler with HTTP access, which then can be reached at http://localhost:9090/debug/pprof. See go tool pprof for more information.
Write running performance statistics to perf-$pid.csv. Not supported on Windows.
Time before folder statistics (file, dir, … counts) are recalculated from scratch. The given duration must be parseable by Go’s time.ParseDuration. If missing or not parseable, the default value of 1 month is used. To force recalculation on every startup, set it to 1s.
Set the maximum number of CPU cores to use. Defaults to all available CPU cores.
Percentage of heap growth at which to trigger GC. Default is 100. Lower numbers keep peak memory usage down, at the price of CPU usage (i.e. performance).


syncthing-config(5), syncthing-stignore(5), syncthing-device-ids(7), syncthing-security(7), syncthing-networking(7), syncthing-versioning(7), syncthing-faq(7)


The Syncthing Authors


2014-2019, The Syncthing Authors

October 17, 2021 v1