syncthing.1 17 KB

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