syncthing.1 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. .\" Man page generated from reStructuredText.
  2. .
  3. .
  4. .nr rst2man-indent-level 0
  5. .
  6. .de1 rstReportMargin
  7. \\$1 \\n[an-margin]
  8. level \\n[rst2man-indent-level]
  9. level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
  10. -
  11. \\n[rst2man-indent0]
  12. \\n[rst2man-indent1]
  13. \\n[rst2man-indent2]
  14. ..
  15. .de1 INDENT
  16. .\" .rstReportMargin pre:
  17. . RS \\$1
  18. . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
  19. . nr rst2man-indent-level +1
  20. .\" .rstReportMargin post:
  21. ..
  22. .de UNINDENT
  23. . RE
  24. .\" indent \\n[an-margin]
  25. .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
  26. .nr rst2man-indent-level -1
  27. .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
  28. .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
  29. ..
  30. .TH "SYNCTHING" "1" "Aug 14, 2025" "v2.0.0" "Syncthing"
  31. .SH NAME
  32. syncthing \- Syncthing
  33. .SH SYNOPSIS
  34. .INDENT 0.0
  35. .INDENT 3.5
  36. .sp
  37. .EX
  38. syncthing [serve]
  39. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  40. [\-\-allow\-newer\-config] [\-\-audit] [\-\-auditfile=<file|\-|\-\->]
  41. [\-\-db\-maintenance\-interval=<interval>]
  42. [\-\-db\-delete\-retention\-interval=<interval>]
  43. [\-\-gui\-address=<address>] [\-\-gui\-apikey=<key>]
  44. [\-\-log\-level=<level>] [\-\-log\-file=<filename>]
  45. [\-\-log\-max\-old\-files=<num>] [\-\-log\-max\-size=<num>]
  46. [\-\-no\-browser] [\-\-no\-console]
  47. [\-\-no\-port\-probing] [\-\-no\-restart] [\-\-no\-upgrade]
  48. [\-\-paused] [\-\-unpaused]
  49. [\-\-verbose] [\-\-version] [\-\-help] [\-\-debug\-*]
  50. syncthing cli
  51. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  52. [\-\-gui\-address=<address>] [\-\-gui\-apikey=<key>]
  53. [\-\-help]
  54. <command> [command options...] [arguments...]
  55. syncthing browser
  56. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  57. [\-\-help]
  58. syncthing decrypt (\-\-to=<dir> | \-\-verify\-only)
  59. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  60. [\-\-password=<pw>] [\-\-folder\-id=<id>] [\-\-token\-path=<file>]
  61. [\-\-continue] [\-\-verbose] [\-\-help]
  62. <path>
  63. syncthing device\-id
  64. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  65. [\-\-help]
  66. syncthing generate
  67. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  68. [\-\-gui\-user=<username>] [\-\-gui\-password=<password|\->]
  69. [\-\-no\-port\-probing]
  70. [\-\-help]
  71. syncthing paths
  72. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  73. [\-\-help]
  74. syncthing upgrade
  75. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  76. [\-\-check\-only] [\-\-from=<url>]
  77. [\-\-help]
  78. syncthing version
  79. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  80. [\-\-help]
  81. syncthing debug <command>
  82. [\-\-home=<dir> | \-\-config=<dir> \-\-data=<dir>]
  83. [\-\-help]
  84. .EE
  85. .UNINDENT
  86. .UNINDENT
  87. .SH DESCRIPTION
  88. .sp
  89. Syncthing lets you synchronize your files bidirectionally across multiple
  90. devices. This means the creation, modification or deletion of files on one
  91. machine will automatically be replicated to your other devices. We believe your
  92. data is your data alone and you deserve to choose where it is stored. Therefore
  93. Syncthing does not upload your data to the cloud but exchanges your data across
  94. your machines as soon as they are online at the same time.
  95. .sp
  96. The \fBsyncthing\fP core application is a command\-line program which usually runs
  97. in the background and handles the synchronization. It provides a built\-in, HTML
  98. and JavaScript based user interface to be controlled from a web browser. This
  99. frontend communicates with the core application through some HTTP APIs, which
  100. other apps like graphical system integration helpers can use as well, for
  101. greatest flexibility. A link to reach the GUI and API is printed among the first
  102. few log messages.
  103. .SH COMMON OPTIONS
  104. .INDENT 0.0
  105. .TP
  106. .B \-\-home=<dir>, \-H <dir>
  107. Set common configuration and data directory. The default configuration
  108. directory is \fB$XDG_STATE_HOME/syncthing\fP or
  109. \fB$HOME/.local/state/syncthing\fP (Unix\-like),
  110. \fB$HOME/Library/Application Support/Syncthing\fP (Mac) and
  111. \fB%LOCALAPPDATA%\eSyncthing\fP (Windows).
  112. .UNINDENT
  113. .INDENT 0.0
  114. .TP
  115. .B \-\-config=<dir>, \-C <dir>
  116. Set configuration directory. Alternative to \fB\-\-home\fP and must be used
  117. together with \fB\-\-data\fP\&.
  118. .UNINDENT
  119. .INDENT 0.0
  120. .TP
  121. .B \-\-data=<dir>, \-D <dir>
  122. Set data (e.g. database) directory. Alternative to \fB\-\-home\fP and must be used
  123. together with \fB\-\-config\fP\&.
  124. .UNINDENT
  125. .INDENT 0.0
  126. .TP
  127. .B \-\-help, \-h
  128. Show help text about command line usage. Context\-sensitive depending on the
  129. given subcommand.
  130. .UNINDENT
  131. .SH SERVE OPTIONS
  132. .INDENT 0.0
  133. .TP
  134. .B \-\-allow\-newer\-config
  135. Try loading a config file written by a newer program version, instead of
  136. failing immediately.
  137. .UNINDENT
  138. .INDENT 0.0
  139. .TP
  140. .B \-\-audit
  141. Write events to timestamped file \fBaudit\-YYYYMMDD\-HHMMSS.log\fP\&.
  142. .UNINDENT
  143. .INDENT 0.0
  144. .TP
  145. .B \-\-auditfile=<file|\-|\-\->
  146. Use specified file or stream (\fB\(dq\-\(dq\fP for stdout, \fB\(dq\-\-\(dq\fP for stderr) for
  147. audit events, rather than the timestamped default file name.
  148. .UNINDENT
  149. .INDENT 0.0
  150. .TP
  151. .B \-\-db\-maintenance\-interval=<interval>
  152. Database maintenance interval – internal database maintenance routines
  153. run this often.
  154. .UNINDENT
  155. .INDENT 0.0
  156. .TP
  157. .B \-\-db\-delete\-retention\-interval=<interval>
  158. Database deleted item retention interval – deleted items are forgotten
  159. from the database after this interval.
  160. .UNINDENT
  161. .INDENT 0.0
  162. .TP
  163. .B \-\-gui\-address=<address>
  164. Override GUI listen address. Set this to an address (\fB0.0.0.0:8384\fP)
  165. or a URL (\fBhttp://0.0.0.0:8384\fP). Supported schemes are \fBhttp\fP for
  166. plain HTTP, \fBhttps\fP for HTTP over TLS, \fBunix\fP for plain Unix sockets
  167. or \fBunixs\fP for TLS over Unix sockets. A Unix socket could look like this:
  168. \fBunix:///run/syncthing/syncthing.socket\fP (notice the three slashes: two
  169. as part of the URL structure, one to specify an absolute path).
  170. .UNINDENT
  171. .INDENT 0.0
  172. .TP
  173. .B \-\-gui\-apikey=<string>
  174. Override the API key needed to access the GUI / REST API.
  175. .UNINDENT
  176. .INDENT 0.0
  177. .TP
  178. .B \-\-log\-level=<level>
  179. Set the log level for all packages. Valid levels are DEBUG, INFO, WARN,
  180. and ERROR.
  181. .UNINDENT
  182. .INDENT 0.0
  183. .TP
  184. .B \-\-log\-file=<filename>
  185. Set destination filename for logging (use \fB\(dq\-\(dq\fP for stdout, which is the
  186. default option).
  187. .UNINDENT
  188. .INDENT 0.0
  189. .TP
  190. .B \-\-log\-max\-old\-files=<num>
  191. Number of old files to keep (zero to keep only current). Applies only when
  192. log rotation is enabled through \fB\-\-log\-max\-size\fP\&.
  193. .UNINDENT
  194. .INDENT 0.0
  195. .TP
  196. .B \-\-log\-max\-size=<num>
  197. Maximum size of any log file (zero to disable log rotation).
  198. .UNINDENT
  199. .INDENT 0.0
  200. .TP
  201. .B \-\-no\-browser
  202. Do not start a browser.
  203. .UNINDENT
  204. .INDENT 0.0
  205. .TP
  206. .B \-\-no\-console
  207. Hide the console window. (On Windows only)
  208. .UNINDENT
  209. .INDENT 0.0
  210. .TP
  211. .B \-\-no\-port\-probing
  212. Don’t try to find unused random ports for the GUI and listen address when
  213. generating an initial configuration / starting for the first time.
  214. .UNINDENT
  215. .INDENT 0.0
  216. .TP
  217. .B \-\-no\-restart
  218. Do not restart Syncthing when it exits. The monitor process will still run
  219. to handle crashes and writing to logfiles (if configured to).
  220. .UNINDENT
  221. .INDENT 0.0
  222. .TP
  223. .B \-\-no\-upgrade
  224. Disable automatic upgrades. Equivalent to the \fBSTNOUPGRADE\fP environment
  225. variable, see below.
  226. .UNINDENT
  227. .INDENT 0.0
  228. .TP
  229. .B \-\-paused
  230. Start with all devices and folders paused.
  231. .UNINDENT
  232. .INDENT 0.0
  233. .TP
  234. .B \-\-unpaused
  235. Start with all devices and folders unpaused.
  236. .UNINDENT
  237. .INDENT 0.0
  238. .TP
  239. .B \-\-upgrade
  240. Perform upgrade.
  241. .UNINDENT
  242. .INDENT 0.0
  243. .TP
  244. .B \-\-verbose
  245. Print verbose log output.
  246. .UNINDENT
  247. .SH DECRYPT OPTIONS
  248. .INDENT 0.0
  249. .TP
  250. .B \-\-to=<dir>
  251. Destination directory where files should be stored after decryption.
  252. .UNINDENT
  253. .INDENT 0.0
  254. .TP
  255. .B \-\-verify\-only
  256. Don’t write decrypted files to disk (but verify plaintext hashes).
  257. .UNINDENT
  258. .INDENT 0.0
  259. .TP
  260. .B \-\-password=<pw>
  261. Folder password for decryption / verification. Can be passed through the
  262. \fBFOLDER_PASSWORD\fP environment variable instead to avoid recording in a
  263. shell’s history buffer or sniffing from the running processes list.
  264. .UNINDENT
  265. .INDENT 0.0
  266. .TP
  267. .B \-\-folder\-id=<id>
  268. Folder ID of the encrypted folder, if it cannot be determined automatically.
  269. .UNINDENT
  270. .INDENT 0.0
  271. .TP
  272. .B \-\-token\-path=<file>
  273. Path to the token file within the folder (used to determine folder ID).
  274. .UNINDENT
  275. .INDENT 0.0
  276. .TP
  277. .B \-\-continue
  278. Continue processing next file in case of error, instead of aborting.
  279. .UNINDENT
  280. .SH GENERATE OPTIONS
  281. .INDENT 0.0
  282. .TP
  283. .B \-\-gui\-password=<password|\->
  284. Specify new GUI authentication password, to update the config file. Read
  285. from the standard input stream if only a single dash (\fB\-\fP) is given. A
  286. plaintext password is hashed before writing to the config file, but an
  287. already bcrypt\-hashed input is stored verbatim. As a special case, giving
  288. the existing password hash as password will leave it untouched.
  289. .UNINDENT
  290. .INDENT 0.0
  291. .TP
  292. .B \-\-gui\-user=<username>
  293. Specify new GUI authentication user name, to update the config file.
  294. .UNINDENT
  295. .SH UPGRADE OPTIONS
  296. .INDENT 0.0
  297. .TP
  298. .B \-\-check\-only
  299. Do not upgrade, only indicate whether an upgrade is available.
  300. .UNINDENT
  301. .INDENT 0.0
  302. .TP
  303. .B \-\-from=<url>
  304. Upgrade to the Syncthing version available from loading the package at
  305. the given URL.
  306. .UNINDENT
  307. .SH EXIT CODES
  308. .INDENT 0.0
  309. .TP
  310. .B 0
  311. Success / Shutdown
  312. .TP
  313. .B 1
  314. Error
  315. .TP
  316. .B 2
  317. Upgrade not available
  318. .TP
  319. .B 3
  320. Restarting
  321. .TP
  322. .B 4
  323. Upgrading
  324. .UNINDENT
  325. .sp
  326. Exit codes over 125 are usually returned by the shell/binary loader/default
  327. signal handler. Exit codes over 128+N on Unix usually represent the signal which
  328. caused the process to exit. For example, \fB128 + 9 (SIGKILL) = 137\fP\&.
  329. .SH SUBCOMMANDS
  330. .sp
  331. The command line syntax actually supports different modes of operation through
  332. several subcommands, specified as the first argument. If omitted, the default
  333. \fBserve\fP is assumed.
  334. .sp
  335. The initial setup of a device ID and default configuration can be called
  336. explicitly with the \fBgenerate\fP subcommand. It can also update the configured
  337. GUI authentication credentials, without going through the REST API. An existing
  338. device certificate is left untouched. If the configuration file already exists,
  339. it is validated and updated to the latest configuration schema, including adding
  340. default values for any new options.
  341. .sp
  342. The \fBdecrypt\fP subcommand is used in conjunction with untrusted (encrypted)
  343. devices, see the relevant section on \fI\%decryption\fP for
  344. details. It does not depend on Syncthing to be running, but works on offline
  345. data.
  346. .sp
  347. To work with the REST API for debugging or automating things in Syncthing, the
  348. \fBcli\fP subcommand provides easy access to individual features. It basically
  349. saves the hassle of handling HTTP connections and API authentication.
  350. .sp
  351. The available subcommands are grouped into several nested hierarchies and some
  352. parts dynamically generated from the running Syncthing instance. On every
  353. level, the \fB\-\-help\fP option lists the available properties, actions and
  354. commands for the user to discover interactively. The top\-level groups are:
  355. .INDENT 0.0
  356. .TP
  357. .B config
  358. Access the live configuration in a running instance over the REST API to
  359. retrieve (get) or update (set) values in a fine\-grained way. The hierarchy
  360. is based on the same structure as used in the JSON / XML representations.
  361. .TP
  362. .B show
  363. Show system properties and status of a running instance. The output is
  364. passed on directly from the REST API response and therefore requires parsing
  365. JSON format.
  366. .TP
  367. .B operations
  368. Control the overall program operation such as restarting or handling
  369. upgrades, as well as triggering some actions on a per\-folder basis. Can
  370. also configure the default ignore patterns from a plain text ignore file.
  371. .TP
  372. .B errors
  373. Examine pending error conditions that need attention from the user, or
  374. acknowledge (clear) them.
  375. .TP
  376. .B debug
  377. Various tools to aid in diagnosing problems or collection information for
  378. bug reports. Some of these commands access the database directly and can
  379. therefore only work when Syncthing is not running.
  380. .TP
  381. .B \fB\-\fP (a single dash)
  382. Reads subsequent commands from the standard input stream, without needing to
  383. call the \fBsyncthing cli\fP command over and over. Exits on any invalid
  384. command or when EOF (end\-of\-file) is received.
  385. .UNINDENT
  386. .SH PROXIES
  387. .sp
  388. Syncthing can use a SOCKS, HTTP, or HTTPS proxy to talk to the outside
  389. world. The proxy is used for outgoing connections only \- it is not possible
  390. to accept incoming connections through the proxy. The proxy is configured
  391. through the environment variable \fBall_proxy\fP\&. Somewhat unusually, this
  392. variable must be named in lower case \- it is not “ALL_PROXY”. For
  393. example:
  394. .INDENT 0.0
  395. .INDENT 3.5
  396. .sp
  397. .EX
  398. $ export all_proxy=socks://192.0.2.42:8081
  399. .EE
  400. .UNINDENT
  401. .UNINDENT
  402. .SH DEVELOPMENT SETTINGS
  403. .sp
  404. The following environment variables modify Syncthing’s behavior in ways that
  405. are mostly useful for developers. Use with care.
  406. If you start Syncthing from within service managers like systemd or supervisor,
  407. path expansion may not be supported.
  408. .INDENT 0.0
  409. .TP
  410. .B STTRACE
  411. Used to increase the debugging verbosity in specific facilities,
  412. generally mapping to a Go package. Enter a comma\-separated string of
  413. facilities to trace: \fBapi,beacon\fP\&. Optionally, a log level can be
  414. given per facility to specify something other than DEBUG:
  415. \fBapi:WARN,beacon:ERR\fP, potentially overriding a global \fB\-\-log\-level\fP
  416. adjustment.
  417. .INDENT 7.0
  418. .INDENT 3.5
  419. The valid facility strings are listed below; additionally, \fBsyncthing
  420. serve \-\-help\fP always outputs the most up\-to\-date list.
  421. .INDENT 0.0
  422. .INDENT 3.5
  423. api \- REST API
  424. beacon \- Multicast and broadcast discovery
  425. config \- Configuration loading and saving
  426. connections \- Connection handling
  427. db/sqlite \- SQLite database
  428. dialer \- Dialing connections
  429. discover \- Remote device discovery
  430. events \- Event generation and logging
  431. fs \- Filesystem access
  432. main \- Main package
  433. model \- The root hub
  434. nat \- NAT discovery and port mapping
  435. pmp \- NAT\-PMP discovery and port mapping
  436. protocol \- The BEP protocol
  437. relay/client \- Relay client
  438. scanner \- File change detection and hashing
  439. stun \- STUN functionality
  440. syncthing \- Main run facility
  441. upgrade \- Binary upgrades
  442. upnp \- UPnP discovery and port mapping
  443. ur \- Usage reporting
  444. versioner \- File versioning
  445. watchaggregator \- Filesystem event watcher
  446. .UNINDENT
  447. .UNINDENT
  448. .UNINDENT
  449. .UNINDENT
  450. .TP
  451. .B STLOCKTHRESHOLD
  452. Used for debugging internal deadlocks; sets debug sensitivity. Use only
  453. under direction of a developer.
  454. .TP
  455. .B STVERSIONEXTRA
  456. Add extra information to the version string in logs and the version line
  457. in the GUI. Can be set to the name of a wrapper or tool controlling
  458. syncthing to communicate this to the end user.
  459. .TP
  460. .B GOMAXPROCS
  461. Set the maximum number of CPU cores to use. Defaults to all available CPU
  462. cores.
  463. .TP
  464. .B GOGC
  465. Percentage of heap growth at which to trigger GC. Default is 100. Lower
  466. numbers keep peak memory usage down, at the price of CPU usage
  467. (i.e. performance).
  468. .TP
  469. .B LOGGER_DISCARD
  470. Hack to completely disable logging, for example when running benchmarks.
  471. Set to any nonempty value to use it.
  472. .UNINDENT
  473. .SH SEE ALSO
  474. .sp
  475. \fBsyncthing\-config(5)\fP, \fBsyncthing\-stignore(5)\fP,
  476. \fBsyncthing\-device\-ids(7)\fP, \fBsyncthing\-security(7)\fP,
  477. \fBsyncthing\-networking(7)\fP, \fBsyncthing\-versioning(7)\fP,
  478. \fBsyncthing\-faq(7)\fP
  479. .SH AUTHOR
  480. The Syncthing Authors
  481. .SH COPYRIGHT
  482. 2014-2025, The Syncthing Authors
  483. .\" Generated by docutils manpage writer.
  484. .