AWS Cloud9
User Guide

Creating an Environment in AWS Cloud9

To create an AWS Cloud9 development environment, follow one of these sets of procedures, depending on how you plan to use AWS Cloud9.

If you're not sure what to choose, we recommend creating an EC2 environment.

Creating an EC2 environment is the easiest option. AWS Cloud9 automatically creates and sets up a new Amazon EC2 instance in your AWS account. AWS Cloud9 then automatically connects that new instance to the environment for you.

Source code provided by Development environment host provided by Follow these procedures

You

AWS Cloud9

This topic (create an EC2 environment)

You

You

This topic (create an SSH environment)

Amazon Lightsail or you

You, by using Lightsail

Working with Amazon Lightsail Instances

AWS CodeStar or you

AWS Cloud9, by using AWS CodeStar

Working with AWS CodeStar Projects

You, by using AWS CodePipeline

AWS Cloud9 or you

This topic (create an EC2 or SSH environment), and then see Working with AWS CodePipeline

You, by using AWS CodeCommit

AWS Cloud9 or you

AWS CodeCommit Sample

You, by using GitHub

AWS Cloud9 or you

This topic (create an EC2 or SSH environment), and then see the GitHub Sample

Creating an EC2 Environment

Note

Completing this procedure might result in charges to your AWS account. These include possible charges for Amazon EC2. For more information, see Amazon EC2 Pricing.

In this procedure, AWS Cloud9 creates an EC2 environment, creates a new Amazon EC2 instance, and then connects the environment to this newly-created instance. AWS Cloud9 manages this instance's lifecycle, including starting, stopping, and restarting the instance as needed. If you ever delete this environment, AWS Cloud9 automatically terminates this instance.

You can create an AWS Cloud9 EC2 development environment with the AWS Cloud9 console or with code.

Creating an EC2 Environment with the Console

  1. Make sure you completed the steps in Express Setup or Team Setup first, so that you can sign in to the AWS Cloud9 console and create environments.

  2. Sign in to the AWS Cloud9 console, at https://console.aws.amazon.com/cloud9/.

  3. After you sign in to the AWS Cloud9 console, in the top navigation bar, choose an AWS Region to create the environment in. For a list of available AWS Regions, see AWS Cloud9 in the Amazon Web Services General Reference.

    
                     AWS Region selector in the AWS Cloud9 console
  4. If a welcome page is displayed, for New AWS Cloud9 environment, choose Create environment. Otherwise, choose Create environment.

    
                     Choosing the Next step button if welcome page is displayed

    Or:

    
                     Choosing the Create environment button if welcome page is not displayed
  5. On the Name environment page, for Name, type a name for your environment.

  6. To add a description to your environment, type it in Description.

  7. Choose Next step.

  8. On the Configure settings page, for Environment type, choose Create a new instance for environment (EC2).

  9. For Instance type, choose an instance type with the amount of RAM and vCPUs you think you need for the kinds of tasks you want to do. Or leave the default choice.

    Note

    Choosing instance types with more RAM and vCPUs might result in additional charges to your AWS account for Amazon EC2.

  10. For Cost-saving setting, choose the amount of time until AWS Cloud9 shuts down the Amazon EC2 instance for the environment after all web browser instances that are connect to the IDE for the environment have been closed. Or leave the default choice.

    Note

    Choosing a shorter time period might result in fewer charges to your AWS account. Likewise, choosing a longer time might result in more charges.

  11. Expand Network settings (advanced).

  12. AWS Cloud9 uses Amazon Virtual Private Cloud (Amazon VPC) to communicate with the Amazon EC2 instance that AWS Cloud9 creates for this environment. Depending on how Amazon VPC is set up, do one of the following.

    If you're not sure what to choose, we recommend that you skip ahead to step 13 in this procedure.

    When you skip past Network settings (advanced) and leave the preselected default settings, AWS Cloud9 attempts to automatically use the default VPC with its single subnet in the same AWS account and AWS Region as the new environment.

    Does the AWS account have access to an Amazon VPC? Is that VPC in the same AWS account and AWS Region as the new environment? Is that VPC the default VPC for its AWS account? Does that VPC contain a single subnet? Do this

    No

    If no VPC exists, create one.

    To create a VPC in the same AWS account and AWS Region as the new environment, choose Create new VPC, and then follow the on-screen directions. For more information, see Create an Amazon VPC for AWS Cloud9.

    To create a VPC in a different AWS account than the new environment, see Working with Shared VPCs in the Amazon VPC User Guide.

    Yes

    Yes

    Yes

    Yes

    Skip ahead to the step 13 in this procedure.

    When you skip past Network settings (advanced) and leave the preselected default settings, AWS Cloud9 attempts to automatically use the default VPC with its single subnet in the same account and region as the new environment.

    Yes

    Yes

    Yes

    No

    If the default VPC has multiple subnets, expand Network settings (advanced). For Subnet, choose the subnet you want AWS Cloud9 to use in the preselected default VPC.

    If the default VPC has no subnets, create one. To do this, choose Create new subnet, and then follow the on-screen directions. For more information, see Create a Subnet for AWS Cloud9.

    Yes

    Yes

    No

    Yes

    Expand Network settings. For Network (VPC), choose the VPC that you want AWS Cloud9 to use.

    Yes

    Yes

    No

    No

    Expand Network settings. For Network (VPC), choose the VPC that you want AWS Cloud9 to use.

    If the chosen VPC has multiple subnets, expand Network settings (advanced). For Subnet, choose the subnet you want AWS Cloud9 to use in the chosen VPC.

    If the chosen VPC has no subnets, create one. To do this, choose Create new subnet, and then follow the on-screen directions. For more information, see Create a Subnet for AWS Cloud9.

    Yes

    No

    Yes

    AWS Cloud9 cannot use a default VPC in an AWS account than is different than the AWS account for the new environment. Choose a different option in this list.

    Yes

    No

    No

    Yes

    Expand Network settings. For Network (VPC), choose the VPC that you want AWS Cloud9 to use.

    Note

    The VPC must be in the same AWS Region as the new environment, even if the VPC is in a different AWS account.

    Yes

    No

    No

    No

    Expand Network settings. For Network (VPC), choose the VPC that you want AWS Cloud9 to use.

    For Subnet, choose the subnet you want AWS Cloud9 to use in the chosen VPC.

    If the chosen VPC has no subnets, to create a subnet for a VPC in a different AWS account than the new environment, see Working with Shared VPCs in the Amazon VPC User Guide.

    Note

    The VPC and subnet must be in the same AWS Region as the new environment, even if the VPC and subnet are in a different AWS account.

    For more information about these choices, see Amazon VPC Settings.

  13. Choose Next step.

  14. On the Review page, choose Create environment. Wait while AWS Cloud9 creates your environment. This can take several minutes.

After AWS Cloud9 creates your environment, it displays the AWS Cloud9 IDE for the environment.

If AWS Cloud9 doesn't display the IDE after at least five minutes, there might be a problem with your web browser, your AWS access permissions, the instance, or the associated virtual private cloud (VPC). For possible fixes, see Cannot Open an Environment in Troubleshooting.

Creating an EC2 Environment with Code

To use code to create an EC2 environment in AWS Cloud9, call the AWS Cloud9 create EC2 environment operation, as follows.

Note

Make sure you completed the steps in Express Setup or Team Setup first, so that you can create environments.

Creating an SSH Environment

You create an AWS Cloud9 SSH development environment with the AWS Cloud9 console. (You cannot create an SSH environment with code.)

Prerequisites

  • Make sure you completed the steps in Express Setup or Team Setup, so that you can sign in to the AWS Cloud9 console and create environments.

  • Identify an existing cloud compute instance (for example an Amazon EC2 instance in your AWS account), or your own server, that you want AWS Cloud9 to connect to the environment.

  • The existing instance or your own server must be running Linux. AWS Cloud9 doesn't support Windows.

  • You must be able to reach the existing instance or your own server over the public Internet by using SSH. You cannot use this procedure if you can only reach the instance or your own server through a virtual private cloud (VPC) or virtual private network (VPN) and that VPC or VPN doesn't have access to the public internet.

  • If the existing AWS instance is part of an Amazon Virtual Private Cloud (Amazon VPC), the VPC must meet AWS Cloud9 requirements. For details, see Amazon VPC Settings.

  • The existing instance or server must have Python installed, and the version must be 2.7. To check your version, from your instance's or server's terminal, run the command python --version . To install Python 2.7 on your server, see one of the following.

  • The existing instance or server must have Node.js installed, and the version must be 0.6.16 or later. To check your version, from your instance's or server's terminal, run the command node --version . To install Node.js on your server, see one of the following.

  • The directory that you want AWS Cloud9 to start from after login on the existing instance or server must have its access permissions set to rwxr-xr-x. This means read-write-execute permissions for the owner, read-execute permissions for the group, and read-execute permissions for others. For example, if the directory's path is ~, you can set these permissions on the directory by running the chmod command on the instance or server, as follows.

    sudo chmod u=rwx,g=rx,o=rx ~

Create the SSH Environment

  1. Make sure you completed the preceding prerequisites.

  2. Sign in to the AWS Cloud9 console, at https://console.aws.amazon.com/cloud9/.

  3. After you sign in to the AWS Cloud9 console, in the top navigation bar, choose an AWS Region to create the environment in. For a list of available AWS Regions, see AWS Cloud9 in the Amazon Web Services General Reference.

    
                     AWS Region selector in the AWS Cloud9 console
  4. If a welcome page is displayed, for New AWS Cloud9 environment, choose Create environment. Otherwise, choose Create environment.

    
                     Choosing the Next step button if welcome page is displayed

    Or:

    
                     Choosing the Create environment button if welcome page is not displayed
  5. On the Name environment page, for Name, type a name for your environment.

  6. To add a description to your environment, type it in Description.

  7. Choose Next step.

  8. For Environment type:, choose Connect and run in remote server (SSH).

  9. Choose Copy key to clipboard. (This is between View public SSH key and Advanced settings.) Paste the public SSH key value that was copied into the ~/.ssh/authorized_keys file on the existing instance or server.

    Note

    To see the public SSH key value that was copied, expand View public SSH key.

  10. After you paste the public SSH key value, back on the Configure settings page in the AWS Cloud9 console, for User, type the login name you use for the instance or server. For example, for an Amazon EC2 instance running Amazon Linux, it might be ec2-user. For another type of server, it might be root.

  11. For Host, type the public IP address (preferred) or the hostname of the instance or server.

  12. For Port, type the port that you want AWS Cloud9 to use to try to connect to the instance or server, or leave the default port.

  13. To specify the path to the directory on the instance or server that you want AWS Cloud9 to start from after login, which you identified earlier in this procedure's prerequisites, expand Advanced settings, and then type the path in Environment path. If you leave this blank, AWS Cloud9 uses the directory that your instance or server typically starts with after login. This is usually a home or default directory.

  14. To specify the path to the Node.js binary on the instance or server, expand Advanced settings, and then type the path in Node.js binary path. To get the path, you can run the command which node (or nvm which node if you're using nvm) on your instance or server. For example, the path might be /usr/bin/node. If you leave this blank, AWS Cloud9 will try to guess where the Node.js binary is when it tries to connect.

  15. To specify a jump host that the instance or server uses, expand Advanced settings, and then type information about the jump host in SSH jump host, using the format USER_NAME@HOSTNAME:PORT_NUMBER (for example, ec2-user@:ip-192-0-2-0:22)

    The jump host must meet the following requirements.

    • It must be reachable over the public Internet using SSH.

    • It must allow inbound access by any IP address over the specified port.

    • The public SSH key value that was copied into the ~/.ssh/authorized_keys file on the existing instance or server must also be copied into the ~/.ssh/authorized_keys file on the jump host.

  16. Choose Next step.

  17. On the Review page, choose Create environment. Wait while AWS Cloud9 creates your environment. This can take several minutes.

    After AWS Cloud9 creates the environment, it displays the AWS Cloud9 IDE for the environment, and the AWS Cloud9 installer dialog box displays. Choose Next on each of these confirmation pages to complete the environment setup process.

If AWS Cloud9 doesn't display the IDE after at least five minutes, there might be a problem with your web browser, your AWS access permissions, the instance, or the associated network. For possible fixes, see Cannot Open an Environment in Troubleshooting.