Unleashing the Power of a Cloud-Based IDE

Tait Hoglund
Nerd For Tech
Published in
7 min readApr 1, 2023

A Step-by-Step Guide for Setting Up Your Own Cloud-Based Development Environment on Cloud 9

In today’s fast-paced business environment, software development teams need to be agile and efficient to keep up with customer demands.

A common challenge for such teams is coordinating the work of multiple developers on a project, while ensuring that everyone has access to the latest codebase and can collaborate effectively. This is where a Cloud9 IDE on AWS, coupled with a central GitHub repo hosted on a Linux EC2 instance, can come in handy.

By launching a Cloud9 IDE on AWS, teams can create a centralized development environment that is accessible to all members of the team, regardless of their location. This allows developers to collaborate in real-time, sharing code and debugging issues together. Additionally, the Cloud9 IDE comes with built-in tools for testing, debugging, and deploying code, which can help teams to streamline their development process and speed up time-to-market.

Using a central GitHub repo hosted on a Linux EC2 instance can further enhance the team’s efficiency by providing a centralized location for storing and versioning code. This makes it easy for developers to access and modify the codebase, while also allowing for easy tracking of changes and rollbacks in case of issues. Additionally, by hosting the repo on an EC2 instance, the team can easily scale up the infrastructure as needed to support their growing needs.

Together, a Cloud9 IDE on AWS and a central GitHub repo on an EC2 instance can enable a high-performing and collaborative development team that is able to deliver high-quality software quickly and efficiently.

In this tutorial, I will walk you thru how to create this IDE set-up.

Pre-Requisite Knowledge

  • A good understanding of the basics of Amazon Web Services, including services like EC2, VPC, and IAM.
  • Knowable in Linux OS and commands including installing and configuring packages, managing users & permissions
  • Basic knowledge of Git commands and principals
  • Software development concepts and practices, including coding, debugging, testing, and deploying code.

Let’s Begin.

Step 1 — Configuring & Launching our IDE

Start by signing in to your AWS Management Console and select the AWS region you want to use. Navigate to the Cloud9 service by either searching for it in the search bar or selecting it from the list of services.

Click on the “Create Environment” button. Give your environment a name and description. Choose the type of instance you want to use.

Select the VPC and subnet you want to use for your environment. Choose the permissions for your environment, including whether you want to allow public access, whether you want to use an existing IAM role, and what permissions that role should have.

Click on the “Create” button to start creating your environment.

Wait for the environment to be created. This may take a few minutes. Once the environment is created, click on the “Open” button to launch your Cloud9 IDE.

Step 2 — Protecting our Environment

Enabling instance configuration and protections on your environment is a best practice that helps to prevent accidental termination. Another benefit is cost control management of your infrastructure.

Cloud9 environments can incur costs based on the size and type of instance used. If the development environment is left running it may lead to unnecessary costs. Enabling instance termination protection can help to prevent such costs by ensuring that the environment remains operational.

Now that our IDE has been launched, let’s configure a termination protection on our instance. Start by navigating to your EC2 Instance dashboard, selecting your EC2 Cloud9 instance and in the submenus, navigate to “Change termination protection”.

Now enable termination protection and click “Save”.

You will receive a confirmation prompt. This will prevent even in an explicit case any user from being about to terminate the instance via the AWS console or via a CLI command. The only way to terminate this instance is to reverse this process.

Step 3 — Setting up our GitHub Repository on our Instance

Next, we head back to our Cloud9 dashboard, select our “terraform” environment and click, “Open in Cloud9”.

Next we need to confiure git on our local environment. We do this by running the following two commands:

git config --global user.name "<YOUR NAME>"
git config --global user.email "<YOUR EMAIL>"

From within the environment on the left side, Click the “Git” icon, and click “Clone Repository”.

Copy the GitHub public URL from the repo you want to clone and paste the URL into the menu box. Hit ‘ENTER’.

You should now see that GitHub repo under yoru “Source Control” menu.

Now to get started on your coding, you will want to make a development branch from your Production branch. Best practice convention would say that You ALWAYS branch from Production to ensure that you are coding to avoid errors. There are obviously exceptions to this, but for our purposes here, that is what we are going to do.

Depending on your project, your production branch usually is called “main.

To create a branch from production, click the “Main” icon located on the bottom left side of your Cloud 9 submenu. Then click “Create new branch”.

Give your development branch a name. I like to use my first initial, then full last name and the date MMDDYY.

This naming convention allows me and my team to quickly identify my code and also help keep me accountable to my daily work.

Your organization might have a different standard on how to name your branches. Once you type in your branch name, hit “ENTER”.

Now your development branch should have replaced your “main” branch in the menu below.

Step 4 — Establishing GitHub Credentials in Local Environment & Verifing Results

Let’s make a test file using NANO. Using the CLI, navigate to a new directory within your repository, create a new file, and save the file.

Notice that Git immediate tracks that we have a new file that isn’t being staged. In order to stage a file for commit, click the “+” to move the file from the “Changes” git submenu to the “Staged Changes”.

This file will now be committed when we push all of our changes to the GitHub repo in the cloud.

Next we need to set our upstream origin for git using the following command. We will then be prompted to give our username and personal access token.

git push --set-upstream origin thoglund-032623

Now our IDE is configured with our GitHub repo!

Let’s say our work is done for the day and we are ready to push our code back to the cloud, all we have to do is once all of our files are staged, click the “Cloud” icon at the bottom of our screen.

We will be prompted to enter our GItHub username

Then prompted for our GitHub password. NOTE: GitHub no longer allows the use of passwords for remote repo access. You must instead generate a Personal Access Token in your GitHub account and use your personal access token to authenticate for your pushes.

Once you have your personal access token, paste it into the password field

Enter your commit message, then hit [CTRL + ENTER]

You can verify your push was successful by visiting the repo via a browser in GitHub. If you are logged into your GitHub and visit the page, you will see your branch and your push request.

If you found my content helpful. then please follow me so that you don’t don’t miss it when I drop another tutorial. You might also like a previous article I wrote about How to Deploy Cloud-Agnostic CI/CD Pipelines using Jenkins and Terraform.

Until next time, Onward!

--

--

Tait Hoglund
Nerd For Tech

🖥 Cloud Engineer | ☁Certified in AWS, Terraform, & Linux | I help organizations deliver CI/CD automation solutions 🐍 Python | GitHub | ⚓Docker | 🐳 Kubernetes