# C9

[Cloud9](https://aws.amazon.com/cloud9/) is an integrated development environment that runs on a virtual machine. It includes a text editor, file manager, and Linux terminal that you can access directly from the browser.

To access the development environment you will need an account on Amazon Web Services (AWS). You can create the account [here](https://aws.amazon.com/cloud9/).

The free tier has all the resources needed for the activities proposed in the labs. Before using a resource make sure is included in the package so it won't generate extra costs. Details are availabel [here](https://aws.amazon.com/free/).

## Configure a Cloud9 environment

The detailed documentation is available at the following address <https://docs.aws.amazon.com/cloud9/latest/user-guide/welcome.html>

Follow this instructuions to create a new environment

1. Navigate in the Cloud9 console

<https://console.aws.amazon.com/cloud9/>

1. Press "Create environment"

![create environment](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWC9b2nAV-_w-hF%2F001-step-create-environment.png?generation=1570460132116759\&alt=media)

1. Step 1 - Provide a name

![environment name](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWEynrvLjBQc0zg%2F002-step-environment-name.png?generation=1570460131944915\&alt=media)

1. Step 2 - Configure the desired settings&#x20;

**Important!** Choose a ***t1.micro*** instance type to stay in the free tier. Choose ***Ubuntu Server 18.04***.

![environment setting](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWIVBazy3uBPjEN%2F003-step-environment-setting.png?generation=1570460131955825\&alt=media)

1. Step 3 - Confirm the settings and press "Create environment"

You will get redirected to a new page. In a few minutes the setup will be finished.

![cloud9](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWKSuP-I7eMbWfl%2F004-c9-screen.png?generation=1570460130806588\&alt=media)

## Getting familiar with the development environment

A complete tour is available at the following address <https://docs.aws.amazon.com/cloud9/latest/user-guide/tour-ide.html>

The most used functions are:

1. The file manager
2. The bash terminal
3. The text editor

![c9 ide](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWMcQSeRnbbbARO%2F005-ide-components.png?generation=1570460131219495\&alt=media)

**The file manager** is located on the left side. Here you will find all the files and directories form `/home/ubuntu/environment`.

**The bash terminal** is located on the right side bottom.

Test it with some linux commands

List the contents of the current directory:

```bash
ls
```

Show the path to the current directory:

```bash
pwd
```

![bash terminal](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWORLPdBrddmU_R%2F006-bash-terminal.png?generation=1570460130611605\&alt=media)

**Editorul de text** este localizat în partea dreaptă sus.

## Firewall settings

Next we need to configure firewall settings so that we can allow access to the ports that will be used frequently.

1. Navigate in the AWS console - <https://console.aws.amazon.com/ec2/>

![aws console](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWQ4iKz1Gm8dsqf%2F007-navigate-to-ec2.png?generation=1570460132343545\&alt=media)

1. List EC2 instances

![ec2 instances](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWSxlkp_vYOBYgz%2F008-view-ec2-instances.png?generation=1570460132522551\&alt=media)

1. Find the Security Groups column and click on it

![security groups](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWUnpRENT_sk-y7%2F009-security-groups.png?generation=1570460132282023\&alt=media)

1. Navigate in the Inbound tab and press eddit Edit

![edit inbound rules](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWWFqu8iNAgUqoL%2F010-edit-inbound.png?generation=1570460130682855\&alt=media)

1. Add ports `8080, 3000, 3001`

![add inbound rules](https://3518284063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lq-yZpbrdhm6w9dxXCc%2F-LqahwkizU3XNrNq5uSn%2F-LqahxWYSN3rkgV-RiSs%2F011-add-inbound-rules.png?generation=1570460130812845\&alt=media)

1. Press Save
