Configure Server for Sync Gateway


      Assuming you have an operational Couchbase Server deployment then:

      STEP 1 — Create a bucket

      We will use this bucket to test the deployment of Sync Gateway, later in the Getting Started section.

      1. Login to Couchbase Server’s Admin Console

        1. Go to http://localhost:8091

        2. Enter your administrator credentials

      2. Within the Admin Console’s toolbar,

        1. Select the Buckets tab

        2. Add Bucket to continue

          cb create bucket
        3. In the pop-up window, enter getting-started-bucket for the name and click Add Bucket. You can leave the other options to their defaults.

          cb create bucket popup

      STEP 2 — Create RBAC user

      To connect to Couchbase Server, you must create an RBAC user. These user credentials are used in a later section to start Sync Gateway.

      1. Open the Security tab and click the Add User button.

        create user

        Couchbase Server opens the Add New User dialog.

      2. Create the RBAC user with appropriate access roles.

        In the Add New User window, provide a Username and Password; the credentials to be used by Sync Gateway to connect.

        Note that the role details differ, depending on your Couchbase Server version — see Example 1.

        Example 1. Select RBAC roles
        • Couchbase Server 6.6+

        • Couchbase Server 5.5 - 6.5

        • Couchbase Server 5.1

        1. In the pop-up window, provide

          • A Username (sync_gateway)

          • A Password (password).

        2. Assign the Sync Gateway role to the user

          user settings 6 6
          Users are encouraged to move away from using the Application Access and Read-Only Admin roles for this purpose.
        1. In the pop-up window, provide:

          • A Username (sync_gateway)

          • A Password (password).

        2. Assign these RBAC roles to the user(as shown on the image below):

          • Application Access

          • Read Only Admin

            user settings 5 5
        1. In the pop-up window, provide:

          • A Username (sync_gateway)

          • A Password* (password).

        2. Assign these RBAC roles to the user:

          • Bucket Full Access

          • Read Only Admin

        user settings

      STEP 3 — Set-up Network access

      When installing Couchbase Server on the cloud, ensure that network permissions (or firewall settings) allow incoming connections to Couchbase Server ports.

      For mobile deployment on premise or in the cloud (for example, AWS or Red Hat) open the following ports on the host to enable Couchbase Server to operate correctly:

      • 8091 to 8094 inclusive

      • 11207, 11210 and 11211

      • 18091 to 18093 inclusive.

      Check that any firewall configuration allows communication on the specified ports.

      If this is not done, the Couchbase Server node can experience difficulty joining a cluster.

      You can refer to the Couchbase Server Network Configuration guide to see the full list of available ports and their associated services.

      Do more:
      • Import Filters: To use Sync Gateway on clusters with a large amount of data you can configure an import filter (see: Configure import filter).

      • Sync Functions: For finer gained control of document access, you can Configure Sync Function.