Run Cloud9 workspaces locally

A very quick setup guide

Assuming that you followed the steps in this guide and downloaded the workspaces from Cloud9 dashboard to your local machine. Unzip .tar into some ~/c9/downloaded-files folder.

Run the command below in your terminal to start the container:

In the preceding command:

  • --privileged gives the container permission to do almost everything that the host operating system can do.
  • -e sets simple environment variables in the container, in this case the IP address and port.
  • --name is a name for the image, in this case, myc9ws.
  • --mount makes a directory available to the container. source is the path to the directory on the host operating system (for example, ~/c9/downloaded-files/ or <drive>:\Users\<user_name>\c9\downloaded-files\ for Windows), and target is the path in the container that you can use to refer to that same directory (for example, /home/ubuntu/workspace/).
  • -d means to run the container in the background.
  • -t means to run the container with a pseudo terminal.
  • -p connects ports in the container to ports on the host operating system. If port 5050 is already in use on your local computer, change it to a different port.
  • <base_image_id> is the base image ID to use, which you noted previously (for example cloud9/ws-default). Docker pulls the base image down to your local computer if it doesn't already exist there. Note that pulling down a base image for the first time might take several minutes.

In the preceding command:

  • -it means to display an interactive terminal for running commands in the container.
  • myc9ws is the name of the running container (can be anything).
  • /bin/bash to get a bash shell in the container.

STEP 1: DOWNLOAD, INSTALL, AND RUN CLOUD9 CORE

In the interactive terminal, run the following commands, one at a time, to download, install, and then run Cloud9 Core inside of the container.

stop the server (ctrl+C), and install mongodb:

run the server:

this will run the Cloud9 IDE, which is accessible in the browser through localhost: 5050.

STEP 2: ACCESS YOUR APP IN THE BROWSER

Now in the IDE in the terminal you can access your workspace contents:

This will run your app and it will be accessible in the browser through localhost: 9090.

Some Useful commands for reviving the connection to mongodb

Resources used for this post:

Everything is unknown until it’s known. Self-learner.

Everything is unknown until it’s known. Self-learner.