There is no better time to get started with Couchbase Server and Couchbase Mobile especially with Amazon’s AWS Free Tier program that provides 12 months of AWS access.  In this blog, we will explore how to get started with installing the Couchbase AMI (Amazon Machine Image) to get up and running with Amazon EC2 in the cloud.  The Amazon Machine Image (AMI) is an encrypted machine image of a specific computer running a base operating system that is configured a specific way.  The AMI contains all the information necessary to start up and run the Couchbase softeware suite on the image.  For this example we will be using Amazon Web Services (AWS) where it is the computing environment for running instances of an AMI.

In the follow-up blog post we will explore how to get a Couchbase Mobile application running against the Couchbase Sync Gateway and Couchbase Server on AWS.

[1]  Create New AWS Account

The first part is registering for a new AWS account.  The Free Tier is only available for new accounts on AWS.  Click on the ‘Create an AWS Account’ on the top right hand corner and fill in the credentials.

Once you go through the “Payment Information” setup and “Identity Verification” process with your phone, you will be brought to the support page plan.

Choose the ‘Basic (Free)‘ plan to get started in the “Support Plan” page.  Then continue to confirm your signup in the email address that you provided to verify that you are signed up to Amazon Web Services and that you have the Basic AWS Support plan.

[2]  Install Couchbase AMI

Next we will login into our AWS account and then select “AWS Marketplace” on the bottom right which is highlighted in green below.

You will be brought over to the AWS Marketplace page where in the search field you would enter “Couchbase” like below and then click ‘GO‘.

A couple different Couchbase Images would surface from the search result and for this blog post, as well as the follow up one, we will be referencing the “Couchbase Server & Couchbase Sync Gateway Community Edition” AMI.  This particular AMI contains both the Couchbase Server and Couchbase Sync Gateway software that we will have our Couchbase Mobile application connect to eventually.

Click on the particular image and you will be guided to the image information page.  Below you will see the details on what you will be installing and the hourly fees associated.  For Couchbase, the software is part of the Amazon AWS Free Tier Eligible Software program and will not cost you anything while you are on the program though EC2 Instance usage fees may apply.  Click on ‘Continue‘:

Once you clicked on ‘Continue’ the next step is to set the parameters for the ‘1-Click Launch’ where the EC2 Instance Type that is running for this blog is set to be ‘m3.medium‘ and where the Region selected is ‘US East (N.  Virginia)‘.  Scroll down to the bottom of the configuration page to create a ‘Key Pair‘.  You may leave the ‘VPC Settings‘ as the default  You may reference below the setup configurations and costs associated with the selections at the time of this blog’s publication.  Click on the arrow pointing to the Key Pair that is highlighted:

You will be presented with a couple of steps to follow through.  Click on the link that is presented in step one below, ‘Visit the Amazon EC2 Console‘ and you will be brought over to the EC2 Console.

Now within the EC2 Console, click on ‘Create Key Pair‘ and then enter a name of your choice for the key pair.  For this example, the key pair name ‘couchbase_aws’ is used.  When ready, click ‘Create‘ and your key pair will automatically download.

Once you have your key created, you will see the ‘Fingerprint’ field fill up with the key name and value within the EC2 Console.  The downloaded key pair file is a .pem extension and you would need to store that safely in a folder on your local drive.  You will need this in the follow up blog to SSH into your Couchbase instance.

Return back to the previous Couchbase AMI page and your key pair will be shown along with the other AMI configuration details as shown below:

When you are ready, click on the ‘Accept Terms & Launch with 1-Click‘ button to launch your Couchbase AMI on EC2.

You will see the sequence of screens below when your AMI is being prepared.  And the last screen will show the Couchbase Server and Couchbase Sync Gateway Community Edition with the ‘running’ status when the instance is ready in EC2.

To see the Couchbase instance running in the Couchbase web console, click on the ‘Access Software‘ link highlighted below to launch the console in the browser.

[4]  Couchbase Web Console

Upon clicking the ‘Access Software’ link, you will be guided to the Couchbase web console in the browser for the Couchbase instance as seen below.  You may access this also directly in the browser by appending the ‘Public DNS‘ address that is obtained from the AWS console with ‘:8091/index.html‘ shown below.

The Couchbase web console URL address is composed by:

URL:  ‘Public DNS’ + :8091/index.html

To log into the web console you would enter the credentials below where the password is found within your EC2 Console:

Username:  Administrator

Password:  ‘Instance ID’

Once you have logged into the Couchbase web console, you will be presented with the ‘Cluster Overview’ page for your Couchbase Server instance on EC2.

[5]  Next Steps

Congratulations!  You have successfully deployed the Couchbase Server and Couchbase Sync Gateway AMI on Amazon EC2 and the next step in the follow up blog, we will explore how to connect Sync Gateway to the Couchbase Server instance.  From there we will have a Couchbase Mobile application replicate data via the Sync Gateway that we just created and store the data on Couchbase Server in  EC2.  Let us now see Couchbase Server and Couchbase Mobile in action!

Author

Posted by William Hoang, Mobile Developer Advocate, Couchbase

William was a Developer Advocate on the Mobile Engineering/Developer Experience team at Couchbase. His love for coffee and code has transcended him into the world of mobile while appreciating the offline in-person experiences. Prior, William worked on the Developer Relations team over at Twitter, BlackBerry, and Microsoft while also having been a Software Embedded GPS engineer at Research In Motion. William graduated from McGill University in Electrical Software Engineering

Leave a reply