Configuration File

Sync Gateway uses a JSON-like configuration file to define its runtime behavior. The file’s contents include, for example:

  • Details of the connected Couchbase databases

  • How replications are conducted

  • What security is to be used

  • What logging options are to be applied, and

  • Any customization of import filtering and synchronization.

The majority of the configuration is achieved using standard JSON syntax — see Configuration Reference for more.

The sync-gateway-config.json file relies on the use of one relaxed JSON feature; the use of back ticks (`). Text between back ticks is treated as a string. It can span multiple lines and contain double-quotes. Those features make it ideal for the JavaScript used in sync and import_filter functions.

Use the following command to run Sync Gateway with a configuration file:

sync_gateway sync-gateway-config.json

Configuration Reference