Help Center

# Running Sync in configuration mode

Running Sync in configuration mode enables you to apply pre-configured parameters at the program start. This can be very helpful if you need to apply the same settings on a number of different machines. The instructions below will guide you through the process of creating and using configuration file on LinuxWindows and OS X.

The config file allows you to adjust a number of different parameters. Note that the parameters from Advanced Preferences can also be added to the list. Click here to see configuration file overview.

Note, that in config mode you can set up only Standard folders, not Advanced

LINUX
1. Get a sample configuration file by executing:

./rslsync --dump-sample-config > sync.conf
Once that is done, file sync.conf will be created in the current directory. Alternatively, you can download a sample config file here

2. Open the file in a text editor and adjust the parameters the way you need.

3. Save the file and run Sync in config mode is as follows:
./rslsync --config sync.conf
(as before, be sure to specify the right path ***)
Now Sync will be launched with the configured settings.

WINDOWS

2. Open the config file in Notepad and set up your preferred values.
3. Save the file as sync.conf in the storage folder
4. Other options is to launch Sync with /config parameter:
- either open Command Line Interface, navigate to the folder where exe is located, and execute the following command:
"Resilio Sync.exe" /config sync.conf

- or add /config C:\path\to\sync.conf parameter into shortcut's preferences.

NOTES:
- If you set up a non-default "storage_path" in config, new setting will be created there.
- To launch Sync Service in config more, just put it to the service's storage. Other options mentioned here will not work with the service.

MAC OS X

2. Open it in a test editor and set up your preferred values. Save the file as sync.conf
3. Open Terminal and run Sync in config mode with the following command:
--config /path/to/sync.conf

Now Sync will be launched with the previously configured settings.

***

Specifying the right path (Linux):

Sync's storage will be created in the current location. If you pick to launch if with config, the command for running Sync in config mode would look as follows:

***

Sample configuration file overview:

While editing path, use double backslash "\\" for configuration files which will be used on Windows, and "/' for Linux and OS X configs.

Wherever there is true/false option, "true" stands for "enable, or ON", "false" stands for "disable, or OFF".

1.
Set device name and listening port.
If the value is set to "0", a random port number will be allocated.

2.
Set storage path directory - the directory where Sync will be storing its settings, debug logs and identity details. If no storage path is entered, .sync storage folder will be created in the same directory from where binary is launched.

3.
Set location of the process id file.

4.
If "true" is selected, Sync will send UPnP and NAT-PMP packets to the router, trying to map ports automatically.

5.
Allows you to limit the bandwidth used by Sync. By default the limits apply only to the internet connections, not to LAN.
"0" stands for "no limit".

6.
Set proxy configuration
"proxy_type": set proxy types. Valid types are "socks4", "socks5", "http_connect", any other value means no proxy.
"proxy_port" - define proxy port.

7.
Directory_root_policy defines how directory_root is used (Linux only).
Valid values are:
"all" accepts directory_root and its subdirectories for 'getdir' and 'adddir' actions
"belowroot" accepts directory_root's subdirectories for 'getdir' and 'adddir' actions
but denies attempts to use 'adddir' to create directories directly within directory_root
Default value is "all".

8.
Webui section
"listen" : <IP: port>
For example, 0.0.0.0:8888 will listen to any interface on the LAN at port 8888.
To disable WebUI, remove this field
"password_hash" - allows you to enter password hash in crypt(3) format. You can use mkpasswd tool for Linux
"force_https" - if "true" is selected, http will be disabled.
"ssl_certificate" - set path to ssl certificate.
"ssl_private_key" - set path to private key.
"dir_whitelist" - defined the directories that can be used to store sync shares. Others will not be visible in folder picker.

9.
Shared folders section:
If you set shared folders in config file WebUI will be DISABLED. Shared directories specified in configuration file override the folders previously added from WebUI.

"secret" - use --generate-secret in command line to create new secret
"dir" - edit path to folder
"use_relay_server" - "true" - relay server will be used when connection fails. False = "use_relay_server" is disabled.
"search_lan" - if "true" is selected, Sync will search your local network for other instances of Sync having the same Keys as yours. The fastest way to discover other peers in LAN. If you choose to disable this option, either make sure that the use of Tracker server is allowed or configure predefined hosts.
"use_sync_trash" - "true" enables SyncArchive to store files deleted on remote devices.
"overwrite changes" - "true" restores modified files to original version (only for read-only version).
"selective_sync" - adding folder in selective sync mode.
"known hosts" - specify hosts to attempt connection without additional search.

Note that parameters from Advanced Preferences can also be added to configuration file.