Menu
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.

Usage pattern Follow these procedures

I want AWS Cloud9 to create a development environment, launch a new Amazon EC2 instance running Amazon Linux with no sample code, connect the environment to the new instance, and then open the AWS Cloud9 IDE.

(When AWS Cloud9 launches a new Amazon EC2 instance this way, we call the environment an EC2 environment.)

This topic

I want AWS Cloud9 to create an environment, connect it to an existing Amazon EC2 instance or my own server, and then open the IDE.

(When AWS Cloud9 connects an environment to an existing Amazon EC2 instance or your own server, we call the environment an SSH environment.)

This topic

I want to launch a new Amazon EC2 instance preconfigured with a popular app or framework such as WordPress, MySQL, PHP, Node.js, Nginx, Drupal, or Joomla, or a Linux distribution such as Ubuntu, Debian, FreeBSD, or openSUSE. Then I want AWS Cloud9 to create an SSH environment, connect it to the new instance, and then open the IDE.

Working with Amazon Lightsail Instances

I want to create a software development project that includes a toolchain with source control, build, deployment, and virtual servers or serverless resources. Then I want AWS Cloud9 to create an EC2 environment, connect it to the project, and then open the IDE.

Working with AWS CodeStar Projects

I want to create a continuous delivery pipeline that models, visualizes, and automates the steps required to release my software. Then I want AWS Cloud9 to create an environment, open the IDE, and connect it to the repository that contains my software's source code to be sent through the pipeline.

Working with AWS CodePipeline

Before you start this procedure, you must already be signed in to AWS Cloud9. To sign in to AWS Cloud9, see one of the following:

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.

To create an environment, do the following:

  1. 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
  2. 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
  3. On the Name environment page, for Name, type a name for your AWS Cloud9 development environment.

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

  5. Choose Next step.

  6. On the Configure settings page, for Environment type, do one of the following:

    • To launch an Amazon EC2 instance and then connect to the new environment from the newly-launched instance, choose Create a new instance for environment (EC2). (We call this an EC2 environment.)

      Note

      Choosing Create a new instance for environment (EC2) might result in possible charges to your AWS account for Amazon EC2. For more information, see Amazon EC2 Pricing.

    • To connect to the new environment from an existing Amazon EC2 instance or your own server, choose Connect and run in remote server (SSH). (We call this an SSH environment.) For more information, see SSH Environment Host Requirements.

      Note

      To choose Connect and run in remote server (SSH), you must be able to reach the existing instace or your own server over the public internet using SSH. For example, you cannot choose Connect and run in remote server (SSH) 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.

  7. Depending on the environment type you chose in step 6 of this procedure, do one of the following:

    • If you chose Create a new instance for environment (EC2), then 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.

    • If you chose Connect and run in remote server (SSH), skip ahead to step 10 in this procedure. It shows you how to set up an existing Amazon EC2 instance or your own server and specify SSH environment settings.

  8. AWS Cloud9 uses Amazon Virtual Private Cloud (Amazon VPC) in your AWS account to communicate with the newly-launched Amazon EC2 instance. Depending on how Amazon VPC is set up in your AWS account, do one of the following.

    Does the account have a VPC with at least one subnet in that VPC? Is the VPC you want AWS Cloud9 to use the default VPC in the account? Does the VPC have a single subnet? Do this

    No

    If no VPC exists, create one. To do this, expand Network settings. For Network (VPC), choose Create new VPC, and then follow the on-screen directions. For more information, see Create an Amazon VPC for AWS Cloud9.

    If a VPC exists but has no subnet, create one. To do this, expand Network settings. For Network (VPC), choose Create new subnet, and then follow the on-screen directions. For more information, see Create a Subnet for AWS Cloud9.

    Yes

    Yes

    Yes

    Skip ahead to the next step in this procedure. (AWS Cloud9 will automatically use the default VPC with its single subnet.)

    Yes

    Yes

    No

    Expand Network settings (advanced). For Subnet, choose the subnet you want AWS Cloud9 to use in the preselected default VPC.

    Yes

    No

    Yes or 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 that VPC.

    For more information, see Amazon VPC Settings.

  9. 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.

    Skip ahead to step 11 in this procedure.

  10. If you chose Connect and run in remote server (SSH), do the following:

    1. Make sure the existing Amazon EC2 instance or your own server runs Linux.

    2. Make sure the existing instance or server is reachable over the public Internet.

      Note

      If you are using an existing Amazon EC2 instance, and that instance is part of an Amazon Virtual Private Cloud (Amazon VPC), there are additional requirements. See Amazon VPC Settings.

    3. On the existing instance or server, you 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:

    4. On the existing instance or server, you 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:

    5. After you confirm that Node.js is installed on the existing instance or server, do the following:

      1. Back in the AWS Cloud9 console, choose Copy key to clipboard. 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.

      2. For Login name in the AWS Cloud9 console, 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.

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

      4. 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.

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

        Important

        This directory 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, as follows.

        sudo chmod u=rwx,g=rx,o=rx ~
      6. 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 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.

      7. To specify a jump host that the instance or server uses, 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.

  11. Choose Next step.

  12. On the Review choices page, choose Create environment. Wait while AWS Cloud9 creates your environment. This can take several minutes. Please be patient.

    Note

    If you chose Connect and run in remote server (SSH) previously, you'll will be prompted to confirm whether AWS Cloud9 can set up the new environment on the existing instance or server. You'll also be given a choice to install some optional components. Simply choose Next on each of these confirmation pages.