AWS Cloud9
User Guide

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 Setting Up AWS Cloud9 first, 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.

  • Make sure that the existing instance or your own server meets all of the SSH Host Requirements. This includes having specific versions of Python, Node.js, and other components installed; setting specific permissions on the directory that you want AWS Cloud9 to start from after login; and setting up any associated Amazon Virtual Private Cloud.

Create the SSH Environment

  1. Make sure you completed the preceding prerequisites.

  2. Connect to your existing instance or your own server by using an SSH client, if you are not already connected to it. You must do this so that you can add the necessary public SSH key value to the instance or server, as described later in this procedure.

    Note

    To connect to an existing AWS cloud compute instance, see one or more of the following resources:

    To connect to your own server, you could search the internet using a phrase such as "connect to a server by using the ssh command" (from macOS or Linux) or "connect to a server by using PuTTY" (from Windows).

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

  4. 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 AWS General Reference.

    
                     AWS Region selector in the AWS Cloud9 console
  5. 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
  6. On the Name environment page, for Name, type a name for your environment.

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

  8. Choose Next step.

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

  10. For User, type the login name you used to connect to the instance or server earlier in this procedure. For example, for an AWS cloud compute instance, it might be ec2-user, ubuntu, or root.

    Note

    For best results, we recommend that the login name is associated with administrative privileges or an administrator user on the instance or server. Specifically, this login name should own the Node.js installation on the instance or server. To check this, from your instance's or server's terminal, run the command ls -l $(which node) (or ls -l $(nvm which node) if you're using nvm). This command displays the Node.js installation's owner's name (along with the installation's permissions, group name, and location).

  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.

    • Netcat must be installed.

  16. 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 that you connected to earlier in this procedure. (~ represents the home directory for the login name that you specified for User earlier in this procedure.)

    Note

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

  17. Choose Next step.

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

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.