Prepare to Install Sync Gateway
Prerequisites for installing Sync Gateway; to synchronize your data from cloud to edge.
This is Step 2 in the Start Here! topic group. It introduces the prerequisites for the installation of Sync Gateway
Related Start Here! topics: Introduction | Install | Verify
- Steps in Getting Started
-
Introduction | Prepare | Install | Verify
What You Need
Here’s what you need in order to install Sync Gateway:
-
To know whether your set-up meets the Minimum Requirements and Compatibility Requirements for running Sync Gateway
-
To have access to a working Couchbase Server deployment configured for Sync Gateway, or alternatively, to know how to Deploy Couchbase Server
-
To Configure Server for Sync Gateway, including creating an appropriate set of RBAC users, ready for use in Sync Gateway and in the REST API
-
Have appropriate network credentials and Network Access
Once you have all that covered … go Install Sync Gateway.
Couchbase Server Requirements
To use Sync Gateway you need an operational Couchbase Server installation. Ensure that you use compatible versions of Couchbase Server and Sync Gateway — see: Compatibility Requirements.
You can get Couchbase Server from our Downloads page |
You will then need to configure Couchbase Server by adding a Bucket and an RBAC User for Sync Gateway — see: Configure Server for Sync Gateway.
Users of Couchbase Server 6.0 should ensure they have addressed the known issue (MB-41255) by upgrading to one of the recommended Couchbase Server versions (6.0.5, 6.5.2, or 6.6.1). The known issue can cause re-balance failures and/or failed replica writes of deleted or expired documents that use Xattrs. This impacts Sync Gateway deployments running with shared bucket access enabled, which use Xattrs for metadata storage. |
Network Port Requirements
Sync Gateway uses specific ports for communication with the outside world, mostly Couchbase Lite databases replicating to and from Sync Gateway — see Table 1 for details.
Port | Description |
---|---|
4984 |
Public port. External HTTP port used for replication with Couchbase Lite databases and other applications accessing the REST API on the Internet. The Public REST API is used for client replication. The default port for the Public REST API is 4984. |
4985 |
Admin port. Internal HTTP port for unrestricted access to the database and to run administrative tasks. The Admin REST API is used to administer user accounts and roles. It can also be used to look at the contents of databases in superuser mode. The default port for the Admin REST API is 4985. By default, the Admin REST API is reachable only from localhost for safety reasons. |
4986 |
Metrics port.
By default The Metrics REST API returns Sync Gateway metrics, in JSON and-or Prometheus-compatible formats, for performance monitoring and-or diagnostic purposes, |
Couchbase Server Host 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:
-
Unencrypted: 8091-8093, 11210
-
Encrypted: 18091-18093, 11207
Check that any firewall configuration allows communication on the specified ports.
Compatibility with Couchbase Server
Users of Couchbase Server 6.0 should ensure they have addressed the known issue (MB-41255) by upgrading to one of the recommended Couchbase Server versions (6.0.5, 6.5.2, or 6.6.1). The known issue can cause re-balance failures and/or failed replica writes of deleted or expired documents that use Xattrs. This impacts Sync Gateway deployments running with shared bucket access enabled, which use Xattrs for metadata storage. |
Compatibility Matrix
Sync Gateway ↓ |
Couchbase Server → |
|||||||
Version |
Scenario |
5.0 [1] |
5.1 [1] |
5.5-6.0 |
6.5-7.0 |
7.1 |
7.2 |
7.6 |
1.4 [2] |
|
|||||||
1.5 [3] |
|
|||||||
1.5 [3] |
|
|||||||
2.0 |
|
|||||||
2.0 |
|
|||||||
2.1 |
|
|||||||
2.1 |
|
|||||||
2.1 |
|
|||||||
2.5-2.8 |
|
|||||||
2.5-2.8 |
|
|||||||
2.5-2.8 |
|
|||||||
3.0.3 |
||||||||
3.1.0 |
||||||||
3.1.0 |
Using Scopes and Collections |
|||||||
3.2.0 |
||||||||
3.2.0 |
Using Scopes and Collections |
Starting from CBS 7.0, the use_views feature is deprecated.
|
Couchbase Server Bucket Types
Use only Couchbase bucket types in Couchbase Mobile.
We do not support the use of Couchbase Server’s Ephemeral or Memcached bucket types — for more on bucket types see: Couchbase Server bucket types.
|
Compatibility with Couchbase Lite
The table below summarizes the compatible versions of Couchbase Lite with Sync Gateway.
Sync Gateway Versions ↓ |
Couchbase Lite → |
||||||
1.4 [4] |
2.0 |
2.1 |
2.5 - 2.8 |
3.0.3 |
3.1.0 |
3.2.0 |
|
2.0 and 2.1 |
|||||||
2.5 to 2.8 |
|||||||
2.5 to 2.8 |
|||||||
3.0.3 |
|||||||
3.1.0 |
|||||||
3.2.0 |
Supported Operating Systems
Operating System | Supported Versions |
---|---|
Red Hat Enterprise Linux (RHEL) |
9.x |
8.x — Deprecated at 3.2.0 |
|
Alma Linux |
9.x |
Rocky Linux |
9.x |
Ubuntu |
24.04 LTS ARM, 24.04 LTS x86 |
22.04 LTS ARM, 22.04 LTS x86 |
|
20.04 LTS ARM, 20.04 LTS x86 |
|
Debian |
12.x |
11.x |
|
10.x — Deprecated at 3.2.0 |
|
Windows Server |
2022 |
2019 — Deprecated at 3.2.0 |
Operating System | Supported Versions |
---|---|
macOS |
14 |
13 |
|
12 — Deprecated at 3.2.0 |
|
Windows Desktop |
11 |
10 |
|
Apple M1 ARM64 |
macOS 14 |
macOS 13 |
|
macOS 12 — Deprecated at 3.2.0 |
Platform | Operating System | Supported Versions |
---|---|---|
AWS |
Amazon Linux 2023 (ARM, x86), Amazon Linux 2 (ARM, x86) |
LTS |
Azure |
Ubuntu |
24.04 LTS (ARM, x86), 22.04 LTS (ARM, x86), 20.04 LTS (ARM, x86) |
Google Cloud |
Ubuntu |
24.04 LTS (ARM, x86) 22.04 LTS (ARM, x86), 20.04 LTS (ARM, x86) |
OpenShift (RedHat Portal) |
RHEL |
9 |
RHEL |
8 — Deprecated at 3.2.0 |
|
Ubuntu |
24.04 LTS, 22.04 LTS, 20.04 LTS |
Cluster Configuration for Sync Gateway
We will create a new cluster on a fresh Couchbase Server installation.
-
Access the Admin Console at
http://localhost:8091
-
Click Setup New Cluster
-
Fill in the details for the new cluster on the
New Cluster
screen: -
Then press Next: Accept Terms
-
On the
Terms and Conditions
screen, accept the terms and conditions, then click on Configure Disk, Memory, Services to configure the cluster. -
Ensure that you have selected
Data
,Query
, andIndex
before clicking on Save & Finish
Configure Server for Sync Gateway
Step 1 — Create a Bucket
We will use this bucket to test the deployment of Sync Gateway, later in the Getting Started section.
-
Login to Couchbase Server’s Admin Console
-
Go to
http://localhost:8091
-
Enter your administrator credentials.
-
-
Within the Admin Console’s toolbar,
-
Select the Buckets tab
-
Add Bucket to continue
-
In the pop-up window, enter get-started-bucket for the name and click Add Bucket. You can leave the other options to their defaults.
Couchbase Server Bucket TypesUse only Couchbase bucket types in Couchbase Mobile. We do not support the use of Couchbase Server’s Ephemeral or Memcached bucket types — for more on bucket types see: Couchbase Server bucket types.
-
Step 2 — Create RBAC User
You will need to create at least one RBAC user in Couchbase Server as sync gateway requires RBAC user credentials to authenticate and authorize access not only to Couchbase Server buckets, but also to its Admin and Metrics API. If you plan to use these API then you are advised to create at least one user for each of:
-
Couchbase Server Access
Add an RBAC user that Sync Gateway uses to authenticate and authorize access to Couchbase Server. Use the sync_gateway role. -
Admin API
Add an RBAC user that administrators can use to authenticate and authorize access to the sync gateway Admin REST API Use the Full Admin role. -
Metrics API
Add an RBAC user that devops can use to authenticate and authorize access to the sync gateway Metrics REST API Use the Read-Only Admin or Application Access roles.
Enterprise edition users can exert a finer-grained control using additional roles appropriate to the functionality required for the specific user.
For more on creating Couchbase Server users see: Server — Manage Users and Roles.
-
Within Couchbase Server’s Dashboard, Open the Security tab and click the Add User button.
-
Create the RBAC user with appropriate access roles, this will differ for each of the user types.
The steps for this are shown in Example 1. Note that they differ, depending on your Couchbase Server version.
Example 1. Select RBAC roles-
Couchbase Server 6.6+ (Enterprise)
-
Couchbase Server 5.5 - 7.x
-
Couchbase Server 5.1
This content relates only to ENTERPRISE EDITION -
In the pop-up window, provide
-
A Username (
sync_gateway
) -
A Password (
password
).
-
-
Assign the Sync Gateway role to the user
Users are encouraged to move away from using the Application Access and Read-Only Admin roles for this purpose.
-
In the pop-up window, provide:
-
A Username (
sync_gateway
) -
A Password (
password
).
-
-
Assign these RBAC roles to the user(as shown on the image below):
-
Application Access
-
Read Only Admin
-
-
In the pop-up window, provide:
-
A Username (
sync_gateway
) -
A Password* (
password
).
-
-
Assign these RBAC roles to the user:
-
Bucket Full Access
-
Read Only Admin
-
-
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:
-
Unencrypted: 8091-8093, 11210
-
Encrypted: 18091-18093, 11207
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 Ports guide to see the full list of available ports and their associated services.