Syncthing — синхронизация файлов Windows, Linux, MacOS и Android


Getting Started¶

For this guide let’s assume you have two machines between which you want to synchronise files. In keeping with Syncthing terminology they are going to be called “devices” in the rest of the documentation. The “local device” is the one you are configuring, viewing status for, etc., while the “remote device” is the other machine.

The best way to follow this guide is to do the install on both machines and configure them in parallel. If both machines aren’t accessible simultaneously that’s fine, the results will just be a little less immediately obvious.

A film version of this transcript is available on YouTube (contributed by @theincogtion). This video shows how to install Syncthing on Ubuntu/Debian/Mint using PPA, also available in German. This video shows how to install Syncthing on Windows, also available in German.

Installing¶

We suggest you have a look at the Community Contributions which let you pick a flavor of Syncthing that best fits your scenario. For example, if you are interested in a cross-platform GUI application you can check out Syncthing-GTK. The community has also developed Windows, Android and many more specific flavors that help you run Syncthing on your devices. Currently all community flavors run the same Syncthing core underneath, so don’t worry about changing your flavor at a later point in time. The remainder of this page will explain how to set up two devices with the core Syncthing flavor.

Syncthing¶

Grab the latest release of Syncthing for your operating system and unpack it (if you use Debian/Ubuntu you may want to use the Debian repository). There will be a binary called syncthing (or syncthing.exe on Windows). Start this in whatever way you are most comfortable with; double-clicking should work in any graphical environment, but I’ll use the command line to better illustrate what happens. At first start Syncthing will generate a configuration file, some encryption keys and then start the admin GUI in your browser. Something like the following will be printed in the command line:

> syncthing [monitor] 22:56:32 INFO: Log output saved to file "C:\Users\User\AppData\Local\Syncthing\syncthing.log" [monitor] 22:56:32 INFO: Default folder created and/or linked to new config [start] 22:56:32 INFO: syncthing v1.7.1 "Fermium Flea" (go1.14.4 windows-386) [email protected] 2020-07-11 18:17:41 UTC [start] 22:56:32 INFO: Default folder created and/or linked to new config [start] 22:56:32 INFO: Default config saved. Edit C:\Users\User\AppData\Local\Syncthing\config.xml to taste (with Syncthing stopped) or use the GUI [6FOKX] 22:56:33 INFO: My ID: 6FOKXKK-SKUBWFW-GSKX6IQ-ZC4SYUZ-5IEVZKE-TC42AAX-HW7IBW4-GAZFAQ7 [6FOKX] 22:56:34 INFO: Single thread SHA256 performance is 123 MB/s using crypto/sha256 (108 MB/s using minio/sha256-simd). [6FOKX] 22:56:34 INFO: Hashing performance is 106.31 MB/s [6FOKX] 22:56:34 INFO: Overall send rate is unlimited, receive rate is unlimited [6FOKX] 22:56:34 INFO: Using discovery server https://discovery.syncthing.net/v2/?noannounce&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW [6FOKX] 22:56:34 INFO: Using discovery server https://discovery-v4.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW [6FOKX] 22:56:34 INFO: Using discovery server https://discovery-v6.syncthing.net/v2/?nolookup&id=LYXKCHX-VI3NYZR-ALCJBHF-WMZYSPK-QG6QJA3-MPFYMSO-U56GTUK-NA2MIAW [6FOKX] 22:56:34 INFO: Ready to synchronize "Default Folder" (default) (sendreceive) [6FOKX] 22:56:34 INFO: QUIC listener ([::]:22000) starting [6FOKX] 22:56:34 INFO: TCP listener ([::]:22000) starting [6FOKX] 22:56:34 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting [6FOKX] 22:56:34 INFO: Completed initial scan of sendreceive folder "Default Folder" (default) [6FOKX] 22:56:34 INFO: GUI and API listening on 127.0.0.1:8384 [6FOKX] 22:56:34 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/ [6FOKX] 22:56:34 INFO: My name is "This computer" [6FOKX] 22:56:45 INFO: quic://0.0.0.0:22000 detected NAT type: Symmetric NAT [6FOKX] 22:56:45 INFO: quic://0.0.0.0:22000 resolved external address quic://125.190.151.7:59296 (via stun.syncthing.net:3478) [6FOKX] 22:56:46 INFO: Detected 0 NAT services

At this point Syncthing will also have set up a folder called Default Folder for you, in a directory called Sync in your home directory ( %USERPROFILE% on Windows). You can use this as a starting point, then remove it or add more folders later.

Configuring¶

The admin GUI starts automatically and remains available on http://localhost:8384/ . Cookies are essential to the correct functioning of the GUI; please ensure your browser accepts them. It should look something like this:

../_images/gs1.jpg

On the left is the list of “folders”, or directories to synchronize. You can see the Default Folder was created for you, and it’s currently marked “Unshared” since it’s not yet shared with any other device. On the right is the list of devices. Currently there is only one device: the computer you are running this on.

For Syncthing to be able to synchronize files with another device, it must be told about that device. This is accomplished by exchanging “device IDs”. A device ID is a unique, cryptographically-secure identifier that is generated as part of the key generation the first time you start Syncthing. It is printed in the log above, and you can see it in the web GUI by selecting “Actions” (top right) and “Show ID”.

Two devices will only connect and talk to each other if they are both configured with each other’s device ID. Since the configuration must be mutual for a connection to happen, device IDs don’t need to be kept secret. They are essentially part of the public key.

To get your two devices to talk to each other click “Add Remote Device” at the bottom right on both devices, and enter the device ID of the other side. You should also select the folder(s) that you want to share. The device name is optional and purely cosmetic. You can change it later if desired.

../_images/gs2.jpg ../_images/gs3.jpg

Once you click “Save” the new device will appear on the right side of the GUI (although disconnected) and then connect to the new device after a minute or so. Remember to repeat this step for the other device.

../_images/gs5.jpg

At this point the two devices share an empty directory. Adding files to the shared directory on either device will synchronize those files to the other side.

If you are using a Syncthing flavor that adds OS specific functionality (e.g. the Android app), you may need to access the Web GUI to enable syncing folders, and other configuration options.

Good luck and have fun! There is more documentation and if you run into trouble feel free to post a question in the support forum. If you have problems getting devices to connect, first take a look at Firewall Setup , then look at any error messages in the GUI or on the console. Don’t forget that configuration changes will not be reflected instantly — give Syncthing a little time, especially after a restart.

Syncthing — синхронизация файлов Windows, Linux, MacOS и Android

Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers in real time, safely protected from prying eyes. Your data is your data alone and you deserve to choose where it is stored, whether it is shared with some third party, and how it’s transmitted over the internet.

Get Started

Grab one of the downloads and start syncing!
Check out the getting started guide for some tips along the way.

Private & Secure

  • Private. None of your data is ever stored anywhere else other than on your computers. There is no central server that might be compromised, legally or illegally.
  • Encrypted. All communication is secured using TLS. The encryption used includes perfect forward secrecy to prevent any eavesdropper from ever gaining access to your data.
  • Authenticated. Every device is identified by a strong cryptographic certificate. Only devices you have explicitly allowed can connect to your other devices. If you have a security concern, please see the security page for details and contact information.

Open

  • Open Protocol. The protocol is a documented specification — no hidden magic.
  • Open Source. All source code is available on GitHub — what you see is what you get, there is no hidden funny business.
  • Open Development. Any bugs found are immediately visible for anyone to browse — no hidden flaws.
  • Open Discourse. Development and usage is always open for discussion.

Easy to Use

  • Powerful. Synchronize as many folders as you need with different people or just between your own devices.
  • Portable. Configure and monitor Syncthing via a responsive and powerful interface accessible via your browser. Works on Mac OS X, Windows, Linux, FreeBSD, Solaris, OpenBSD, and many others. Run it on your desktop computers and synchronize them with your server for backup.
  • Simple. Syncthing doesn’t need IP addresses or advanced configuration: it just works, over LAN and over the Internet. Every machine is identified by an ID. Give your ID to your friends, share a folder and watch: UPnP will do if you don’t want to port forward or you don’t know how.

Kastelo provides commercial support for Syncthing and sponsors Syncthing with development resources.

Syncthing — синхронизация файлов Windows, Linux, MacOS и Android

Если среди ваших задач есть синхронизация файлов между разными компьютерами, при этом полагаться на облачные сервисы крупных Интернет-компаний вы не хотите, а вместо этого предпочитаете полностью контролировать процесс синхронизации, бесплатное решение Syncthing с открытым исходным кодом, возможно, именно то, что вам требуется.

В этом обзоре о том, как начать использовать Syncthing для синхронизации файлов между компьютерами и мобильными устройствами в локальной сети и через Интернет с использованием безопасного протокола TLS, базовых настройках и возможностях инструмента.

Загрузка и установка

Все файлы для загрузки Syncthing для разных платформ, а также ссылки на Google Play и F-Droid доступны на официальном сайте https://syncthing.net. Все консольные версии можно также загрузить со страницы GitHub. Если требуется версия для iPhone или iPad, можно использовать стороннее приложение Möbius Sync, доступное в App Store — оно сделано специально для Syncthing, но не полностью бесплатное.

Учитывайте, что в базовом варианте Syncthing для Windows и Mac — консольный инструмент, доступ к параметрам которого осуществляется через веб-интерфейс.

Если вы не готовы вручную настраивать автоматический запуск консольного приложения и работать с ним через браузер, можно загрузить готовые сборки с графическим интерфейсом и собственными параметрами — SyncTrayzor и syncthing-macos, предлагаемые в разделе «Integrations» на официальном сайте: эти варианты больше похожи на привычные программы и могут быть более удобными для начинающих пользователей.

Использование Syncthing

В первую очередь поговорим о работе Syncthing в Windows. Вне зависимости от того, какой из вариантов Syncthing вы загрузили (консольную утилиту или приложение-сборку), при первом запуске вам потребуется дать ему необходимые разрешения в брандмауэре.

При запуске консольного инструмента будет запущена консоль и браузер с веб-интерфейсом управления (по умолчанию доступен по адресу 127.0.0.1:8384).

Веб-интерфейс Syncthing

Примечание: если вам потребуется настроить автоматический запуск консольного Syncthing при входе в Windows без появления окна консоли и автоматического открытия браузера, используйте планировщик заданий (или создание своей службы) и запуск syncthing.exe с параметрами

--no-console --no-browser

При запуске SyncTrayzor — в области уведомлений появится значок быстрого доступа, а также откроется окно приложения: тот же веб-интерфейс, но в «обертке» с собственными дополнительными настройками приложения.

Главное окно SyncTrayzor

Вверху окна будет предложено настроить аутентификацию (имя пользователя и пароль) для входа в веб-интерфейс в будущем: сделайте это, если есть опасения, что кто-то с доступом к компьютеру может изменить параметры синхронизации.

Далее — о базовых действиях для первоначальной настройки синхронизации, если какие-то шаги будут не до конца ясными, ниже также есть видео, где процесс показан наглядно:

  1. Установите/запустите Syncthing (или SyncTrayzor) на другом устройстве. При нахождении двух устройств в одной локальной сети, они «увидят» друг друга и можно будет просто нажать кнопку «Добавить устройство» и нажать по нужному ID устройства «рядом» в локальной сети, а также подтвердить добавление на добавляемом устройстве. Добавить новое устройство в SyncThing
  2. Если уведомлений о новом устройстве не появляется, или для добавления устройства в сети Интернет используйте кнопку «Добавить устройство» и ID или QR-код (в случае подключения Android смартфона). Получить ID текущего компьютера можно в меню настроек, пункт «Показать ID». Посмотреть ID Syncthing
  3. По умолчанию приложение работает лишь с одной папкой по умолчанию в

C:\Users\Имя_пользователя\Sync

к которой нет доступа у других устройств. Вы можете добавить собственные папки с помощью кнопки «Добавить папку» в веб-интерфейсе. При добавлении рекомендую задать «Ярлык папки», иначе в списке папок для неё будет отображаться уникальный, но не очень читаемый ID. Добавление папки в Syncthing

  • Для предоставления доступа к папке другим подключенным устройствам, нажмите откройте вкладку «Предоставление доступа» окне редактирования свойств нужной папки и включите доступ для нужных устройств. Если синхронизация выполняется через Интернет и требуется шифрование данных, задайте пароль шифрования. Поделиться папкой с другими устройствами в Syncthing
  • На компьютере, которому был предоставлен доступ, появится уведомление о новой общей папке, которое нужно принять. Если был предоставлен доступ к папке Default Folder (По умолчанию), то синхронизация будет автоматически производиться с аналогичной папкой по умолчанию на удаленном компьютере, если к другой папке — потребуется указать путь к локальной папке на нем, данные из которой будут синхронизированы (он может отличаться от пути на исходном компьютере). Подтвердить доступ к новой папке в Syncthing
  • Аналогичным образом можно подключить больше устройств и предоставить доступ к нужным папкам им: не только для компьютеров и ноутбуков, но и для мобильных устройств Android: Syncthing на Android
  • На этом основные необходимые действия для выполнения синхронизации ваших данных выполнены: файлы будут автоматически обновляться до последней версии на всех устройствах, которым предоставлен доступ к соответствующим папкам. Если устройство выключено или отключено от локальной сети или Интернета, данные будут синхронизированы при очередном его включении.

    Возможности синхронизации и её настройки не ограничиваются простым сценарием использования, который был предложен выше, вы также можете:

    Настройки SyncTrayzor

    • Настроить управление версиями файлов в свойствах общей папки (кнопка «Редактирование папки» — «Управление версиями»).
    • На вкладке «Дополнительно» в окне редактирования папки настроить интервалы сканирования, необходимость синхронизации прав доступа и владельцев NTFS, отправку расширенных атрибутов.
    • В настройках (в веб-интерфейсе) настроить ограничения пропускной способности и другие параметры сети.
    • При использовании SyncTrayzor использовать дополнительные настройки самого приложения, такие как автоматический запуск при входе в Windows, отключение синхронизации при лимитных подключениях, уведомления об измененных и синхронизированных файлах, а также настройки Syncthing — изменение адреса доступа к веб-интерфейсу, приоритет исполняемого процесса и другие.

    Видео инструкция

    Полная документация по использованию и настройке Syncthing (на английском языке) доступна на сайте https://docs.syncthing.net/. В ней вы найдете информацию по параметрам командной строки, доступным настройкам сети, расширенным возможностям настройки синхронизации файлов и другие сведения.

    А вдруг и это будет интересно:


    Оставьте комментарий