How to connect to Couchbase Server (AMI) on Amazon?

I installed the Couchbase Server 4.0 AMIs on Amazon Web Services and it looks like its running ok.

I created a Swift iOS 9 iPhone app (I have attached my Couchbase swift code) and I created the database, create a document, save it. I also have the Replication Running for push and pull.

Server URL: (changed some of the ip numbers)

All records are saved fine on the local database but none of them are synced to the Couchbase Server on Amazon.

Any help is greatly appreciated, am I using the wrong server url? Not getting any errors. How do you check if the Sync gateway is running on Amazon, I did not see it on the control panel.

Thank you

Just try an HTTP GET to the server root URL, i.e. using curl, and look for a JSON response something like this:

$ curl
{"couchdb":"Welcome","vendor":{"name":"Couchbase Sync Gateway","version":1},"version":"Couchbase Sync Gateway/()"}

You can also GET the database URL and the JSON should be something like:

$ curl

Tried curl on both server and server/db link with port 4984, 80,11211 but receive Operation timed out.

On port 11215, 11214 it refused connection.

On port 8092

On port 8092

For some reason now it does not find the mylist DB.

Port 8092 is for Couchbase Server view queries; that’s not Sync Gateway.

Make sure that the AMI you installed explicitly says that it includes and runs Sync gateway. I know very little about this area, but I thought that SG still wasn’t part of the default image.

That must be it. I went back and looked at the AMI and it says Couchbase Server 4.0 Community Edition but nothing about Sync Gateway.

I will research to see how to install the Sync Gateway with the current Couchbase Server.

Thanks for the help.

@traun, any advice here?

So far I have not found any information on how to install the Couchbase Sync Gateway on the current Couchbase Server 4.0 hosted on Amazon. Do I need to setup a new Server for the Sync Gateway or?



I have installed a new Amazon Server with Couchbase Sync Gateway. I also still have the other Amazon Server Couchbase Server 4.0.

I connected via ssh into the Couchbase Sync Gateway and I looked at the documentation on Connecting a Sync Gateway to Coucbase Server at

Unfortunately I do not see how you connect the Sync Gateway to the Couchbase Server.


Thanks, that helped.

I logged into the Amazon AMI Couchbase Sync Gateway via ssh and type in the commands at that page but the file is not found. I am wondering if the AMI has something different…

At the terminal I type sync_gateway or ./sync_gateway but error says “No such file or directory”

Below is the results from connecting to sync gateway server via ssh and running the ./sync_gateway command to start it.

   __|  __|_  )
   _|  (     /   Amazon Linux AMI
[ec2-user@ip-275-20-25-00 ~]$ ./sync_gateway
-bash: ./sync_gateway: No such file or directory
[ec2-user@ip-172-31-41-13 ~]$ dir
config.json sync_gateway.rpm

I come from a Windows background some of this still is very new to me and not sure why it does not find the sync_gateway since it shows it there.


What you see there is an RPM package. It’s a redhat package installer. You need to install it.

Yea, I tried it but it says it’s installed and nothing to update.

sudo yum install ./sync_gateway.rpm
Loaded plugins: priorities, update-motd, upgrade-helper
Examining ./sync_gateway.rpm: couchbase-sync-gateway-1.1.0-28.x86_64
./sync_gateway.rpm: does not update installed package.
Error: Nothing to do


In that case sync_gateway should be installed in one of the normal Linux places, like /usr/bin or /usr/local/bin. One more mysterious thing that can cause this error message is if you are trying to run on a 32-bit system (The command uname -m will tell you, a 64-bit OS will output x86_64)

I used the Amazon AMI Couchbase Sync Gateway image and I think it has issues :smile: I am going to delete this server and try to re-create. If that does not work I think I will create a VM and install it manually.


Finally found where the sync_gateway is on the AMI… /opt/couchbase-sync-gateway/bin/sync_gateway

Sync Gateway is now running with below command line, but when my iOS app tries to connect to Sync Gateway Server to start Replication the connection is refused…lol I checked the Ports and they are open on the firewall.

Sync Server but with curl it gives Connection Refused.
Bucket currently has no password

Sync Gateway Command (fyi)
/opt/couchbase-sync-gateway/bin/sync_gateway -url= -interface=:4984 -bucket=sync_gateway -dbname=mylist

Any thoughts on my when I try to reach the sync gateway server it would refuse connection?

If your app is running on iOS 9, the problem is probably on the client side — iOS 9 won’t allow an app to make an insecure (http:) connection by default. In the long run you should use SSL; in the short term you can add a key to the Info.plist to bypass the error. (Look up App Transport Security; Apple has a technote with the details.)

What is the exact output of the curl command that fails?

Hi Marco,

I went through the whole process of getting it working, which was a pretty bumpy ride … (we need to do some serious improvements here!). I wrote up a README here:

I think the main change you need to make is to use -interface= rather than -interface=:4984. In my testing, using -interface=:4984 only listened on localhost.

Let me know if it works!

Thanks Traun! Can you make sure this info gets incorporated into our docs, and/or attached to the AMI image, so future users will find it?

Already on it!