{"_id":"5be5bbb2ffa7a1021c0be8df","project":"54cf411f9d09bb0d00a17a1c","version":{"_id":"54cf411f9d09bb0d00a17a1f","project":"54cf411f9d09bb0d00a17a1c","__v":16,"createdAt":"2015-02-02T09:19:27.656Z","releaseDate":"2015-02-02T09:19:27.656Z","categories":["54cf41209d09bb0d00a17a20","54cfb99bbba1a023008741af","54cfb9a65ff7e617002bbd7f","54cfba03bba1a023008741b6","54cfba0ebba1a023008741b8","54cfba19bba1a023008741b9","54cfba29bba1a023008741bb","54cfba345ff7e617002bbd87","54cfba3ebba1a023008741bc","54cfba473995cf0d0006f6f0","54e371b18ef7552300409bf2","54e37aa5e887c50d005ef629","555a4e9b147f91190092d137","56b0e91802f4bc0d006ce254","5bb4f4e01635b500032b94fd","5c05a785ceb5b80220cf0e93"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"5bb4f4e01635b500032b94fd","project":"54cf411f9d09bb0d00a17a1c","version":"54cf411f9d09bb0d00a17a1f","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-10-03T16:57:04.619Z","from_sync":false,"order":7,"slug":"migrating","title":"Migrating Your Workspace"},"user":"5bac0709475b5d000364fa42","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-11-09T16:54:10.139Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":13,"body":"You can move your existing Cloud9 online workspace to your local desktop or laptop computer and work with it offline from there. \n\nTo do this, we recommend the following approach:\n\n1. Download the folders, files, and data from your Cloud9 online workspace onto your local desktop or laptop computer. If you want to \"run\" the downloaded workspace content inside of a Docker container (for example running inside of a self-contained Ubuntu operating system, perhaps also running the Cloud9 IDE), continue with the remaining steps here. Otherwise, you're done.\n2. Install and then run [Docker](https://docs.docker.com/engine/docker-overview/) on that same computer. You should be comfortable working with Docker. If you're not, get up to speed with the *Docker Get Started Tutorial*, specifically [Part 1: Orientation and setup](https://docs.docker.com/get-started/) and [Part 2: Containers](https://docs.docker.com/get-started/part2/).\n3. Use Docker to run a Docker [container](https://docs.docker.com/engine/docker-overview/#docker-objects) on that same computer. This container has the settings, packages, apps, and dependencies from your original Cloud9 online workspace. It also has access to the folders, files, and data that you downloaded from your original online workspace. \n4. Use an integrated development environment (IDE) to work with your Cloud9 workspace in the running container. \n\nThe rest of this topic describes this approach in detail. \n\n:exclamation: If you'd rather move your existing Cloud9 workspace over to a new AWS Cloud9 development environment, instead of working with it offline, **stop now** and skip over to the AWS Cloud9 [Migrating to AWS Cloud9](migration-checklist) for alternate instructions instead.\n\n:question: If you have questions or need help migrating, go to the [Cloud9 Community](https://community.c9.io/) website or email [support:::at:::c9.io](mailto:support@c9.io).\n\n# Contents\n\n* [Prerequisites](migrating-to-cloud9-offline#section-prerequisites)\n* [Step 1: Download folders, files, and data from your workspace](migrating-to-cloud9-offline#section-step-1-download-folders-files-and-data-from-your-workspace)\n* [Step 2: Install Docker](migrating-to-cloud9-offline#section-step-2-install-docker)\n* [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker)\n* [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container)\n* [Step 5: Use an IDE to work with your workspace offline](migrating-to-cloud9-offline#section-step-5-use-an-ide-to-work-with-your-workspace-offline)\n* [Step 6: Save new workspace changes as you work](migrating-to-cloud9-offline#section-step-6-save-new-workspace-changes-as-you-work)\n* [Cleaning up](migrating-to-cloud9-offline#section-cleaning-up)\n\n# Prerequisites\n\nIf you want to \"run\" your downloaded workspace content inside of a Docker container (for example running inside of a self-contained Ubuntu operating system, perhaps also running a version of the Cloud9 IDE), we recommend using a local desktop or laptop computer running an operating system that [Docker Community Edition (Docker CE)](https://docs.docker.com/install/overview/) supports. \n\nAt the time of this writing, supported operating systems are:\n\n* **macOS**: OS X El Capitan 10.11 or later.\n* **Windows**: Windows 10.\n* **Linux**:\n  * **Ubuntu**: Xenial 16.04 (LTS) or Trusty 14.04 (LTS).\n  * **Debian**: Stretch 9 (stable), Jessie 8 (LTS), or Wheezy 7.7 (LTS).\n  * **Fedora**: 64-bit version 26 or 27.\n  * **CentOS**: A maintained version of CentOS 7.\n\nThat same computer must have the IDE that you want to use to work with your Cloud9 workspace that is running in Docker.\n\n:information-source: If you're running an older version of a Mac or Windows operating system that Docker CE doesn't support, you can try using [Docker Toolbox](https://docs.docker.com/toolbox/overview/). We link to equivalent Docker Toolbox instructions throughout this topic. However, we don't go into details about them here.\n\n# Step 1: Download folders, files, and data from your workspace\n\n:information-source: If you have already downloaded your workspace and just want to know how to extract the workspace download's contents, skip ahead to step 7 in this procedure. \n\nThe following video demonstrates the download process, from the start of the video through the 0:45 mark and resuming from the 1:57 mark to the end of the video.\n[block:embed]\n{\n  \"html\": \"<iframe class=\\\"embedly-embed\\\" src=\\\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0SAkLUnJYkw%3Ffeature%3Doembed&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0SAkLUnJYkw&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0SAkLUnJYkw%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\\\" width=\\\"854\\\" height=\\\"480\\\" scrolling=\\\"no\\\" frameborder=\\\"0\\\" allow=\\\"autoplay; fullscreen\\\" allowfullscreen=\\\"true\\\"></iframe>\",\n  \"url\": \"https://www.youtube.com/watch?v=0SAkLUnJYkw\",\n  \"title\": \"C9 migration to AWS Cloud9\",\n  \"favicon\": \"https://s.ytimg.com/yts/img/favicon-vfl8qSV2F.ico\",\n  \"image\": \"https://i.ytimg.com/vi/0SAkLUnJYkw/hqdefault.jpg\"\n}\n[/block]\nIn your existing Cloud9 online workspace, you might have some combination of folders, files, data in databases, and content in app frameworks (such as WordPress) that you want to continue working with. In this step, you instruct Cloud9 to prepare a single file for you to download. You also choose whether Cloud9 includes in this download either just the contents of the workspace's home directory or the entire workspace's contents. \n\n1. Open your **Workspaces** dashboard, if it isn't already displayed. (To display it, go to https://c9.io/<your-user-name>.)\n2. In the tile for the workspace that you want to download, choose **Prepare for Download / Migrate**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/3d254b5-prepare-workspace.png\",\n        \"prepare-workspace.png\",\n        377,\n        302,\n        \"#6b985e\"\n      ]\n    }\n  ]\n}\n[/block]\n3. In the dialog box that displays, choose **Archive**, and wait while Cloud9 prepares your workspace to be downloaded.   \n\n    :exclamation: Cloud9 can take a long time to prepare the workspace download file. After you choose **Archive**, you can't do anything with that workspace until Cloud9 finishes its work.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/218e713-archive-workspace.png\",\n        \"archive-workspace.png\",\n        687,\n        270,\n        \"#f2f2f1\"\n      ]\n    }\n  ]\n}\n[/block]\n4. Do one of the following:\n\n    * In your email inbox, open the message from support@c9.io with the subject **Your workspace is ready for download/migration**. Then choose the link in the body of the message.   \n    * In your **Workspaces** dashboard, if the workspace's tile displays the message **Your workspace is ready for download/migration**, then choose **Download / Migrate**. On the **What would you like to do with your workspace** page, select **Download to my computer**, and then choose **Next**.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7802e2d-download-email.png\",\n        \"download-email.png\",\n        452,\n        315,\n        \"#d3d5d7\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7de0419-download-ready.png\",\n        \"download-ready.png\",\n        381,\n        304,\n        \"#658e5b\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/4d54a4b-download-workspace.png\",\n        \"download-workspace.png\",\n        933,\n        897,\n        \"#e2b315\"\n      ]\n    }\n  ]\n}\n[/block]\n5. On the **What would you like to download** page, choose one of the following options, and then choose **Download**:\n\n    * Choose **Home directory files** if you want Cloud9 to prepare to download only the directories, subdirectories, and files from this workspace's `/home/ubuntu/environment` directory.   \n    * Choose **Workspace image** if you want Cloud9 to prepare to download the directories, subdirectories, and files, from this workspace's \"root\" or `/` directory, along with additional content (for example, any database files created by MySQL or MongoDB) that you can use to \"run\" this workspace inside of a Docker container (for example, running inside of a self-contained Ubuntu operating system, perhaps also running a version of the Cloud9 IDE).\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/20fcccc-download-type.png\",\n        \"download-type.png\",\n        943,\n        913,\n        \"#2d93db\"\n      ]\n    }\n  ]\n}\n[/block]\n6. Depending on the type of web browser that you're using, follow any on-screen instructions to finish saving the workspace download to your local computer. When you are finished saving the workspace download, choose **Cancel** or **Dashboard** to return to your **Workspaces** dashboard. \n7. The workspace download consists of a single file, in .tar.gz, or compressed TAR (Tape ARchive) format. (This file is also sometimes referred to as a *tar file* or a *tarball*.) To extract (also sometimes referred to as *unpack*, *unarchive*, *unzip*, or simply *open*) the contents of this file, run the following command from a terminal for Linux or **Terminal** for macOS. (Alternatives for Windows are listed below.) This command assumes that you have already switched to the directory that contains the file that you want to extract.\n\n    :information-source: If you want to \"run\" this workspace inside of a Docker container (for example running inside of a self-contained Ubuntu operating system, perhaps also running a version of the Cloud9 IDE), we recommend that you create a single, blank directory on your local computer and extract the contents of this file into it. In a later step, you connect Docker to this directory. For example, this topic uses `mkdir -p ~/c9/downloaded-files/`. (For Windows, `~` is available through utilities such as [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell) and [Git Bash for Windows](https://gitforwindows.org/). Or you can use something like `mkdir <drive>:\\Users\\<user_name>\\c9\\downloaded-files\\`.)\n\n    **For Linux or macOS**, run the following command:\n\n    `tar -xvzf FILENAME.tar.gz -C DESTINATION`\n\n    Where:\n\n    * `x` means to extract the contents of the file.\n    * `v` means to verbosely show progress. (To turn this off, omit `v`.)\n    * `z` means to uncompress the file.\n    * `f` means the name of the specified file to extract.\n    * `FILENAME.tar.gz` is the name of the file to extract.\n    * `-C` means to extract the file to the specified path. \n    * `DESTINATION` is the path to where you want to extract the file's contents, for example, `~/c9/downloaded-files/`.\n\n    **For Windows**, search the internet using a phrase such as \"open .tar.gz files in Windows\", followed by your Windows version number, for example, \"open .tar.gz files in Windows 10\". Alternatives here include various graphical applications (such as 7-Zip) as well as command prompt options (such as `tar` through Cygwin).\n\n8. If you chose **Workspace image** earlier, continue on to the next step to learn how to \"run\" this workspace inside of a Docker container on your local computer. Otherwise, if you chose **Home directory files** earlier, you're now done and can skip the rest of the steps on this page.\n\n# Step 2: Install Docker\n\nIn this step, you install [Docker Community Edition (Docker CE)](https://docs.docker.com/install/overview/) on your local computer. If you already have Docker installed, skip ahead to [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker). \n\nTo check whether Docker is installed, run the command `docker --version` from your operating system's terminal or command prompt. If you get an error message, see the following procedure, \"To install Docker CE\". Otherwise, if the Docker version number is displayed, skip ahead to [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker).\n\nTo install Docker CE, see the following:\n\n* **macOS**: [Install Docker for Mac](https://docs.docker.com/v17.12/docker-for-mac/install/).\n* **Windows**: [Install Docker for Windows](https://docs.docker.com/v17.12/docker-for-windows/install/).\n* **Linux**:\n  * **Ubuntu**: [Get Docker CE for Ubuntu](https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/).\n  * **Debian**: [Get Docker CE for Debian](https://docs.docker.com/v17.12/install/linux/docker-ce/debian/).\n  * **Fedora**: [Get Docker CE for Fedora](https://docs.docker.com/v17.12/install/linux/docker-ce/fedora/).\n  * **CentOS**: [Get Docker CE for CentOS](https://docs.docker.com/v17.12/install/linux/docker-ce/centos/).\n\n:information-source: If you must use Docker Toolbox instead of Docker CE, see [Install Docker Toolbox on macOS](https://docs.docker.com/toolbox/toolbox_install_mac/) or [Install Docker Toolbox on Windows](https://docs.docker.com/toolbox/toolbox_install_windows/), and then skip ahead to [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker).\n\n# Step 3: Start Docker\n\nIn this step, you start the Docker process or app. If Docker is already running, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). \n\n:information-source: If you're using Docker Toolbox instead of Docker CE, see [Verify your installation for Mac](https://docs.docker.com/toolbox/toolbox_install_mac/#step-3-verify-your-installation) or [Verify your installation for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/#step-3-verify-your-installation), and then skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container).\n\nTo check whether Docker is running:\n\n* **macOS**: Check whether the whale in the status bar is in a steady state (in other words, the blocks on top of the whale aren't moving). This indicates that Docker is running. If the whale is in a steady state, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). If the whale isn't in the status bar, see the following procedure, \"To start Docker\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/aef59f7-whale-in-menu-bar.png\",\n        \"whale-in-menu-bar.png\",\n        394,\n        43,\n        \"#464448\"\n      ]\n    }\n  ]\n}\n[/block]\n* **Windows**: Check whether the whale in the taskbar is in a steady state (in other words, the blocks on top of the whale aren't moving). This indicates that Docker is running. If the whale is in a steady state, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container).  If the whale isn't in the taskbar, see the following procedure, \"To start Docker\". \n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/94624f8-whale-taskbar-circle.png\",\n        \"whale-taskbar-circle.png\",\n        256,\n        47,\n        \"#0e0b0a\"\n      ]\n    }\n  ]\n}\n[/block]\n* **Linux**: Run the command `sudo systemctl status docker` or `sudo service docker status`, depending on your operating system. \n\n   If the service is running, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container).\n\n   If the service isn't running, see the following procedure, \"To start Docker\".\n\nTo start Docker: \n\n* **macOS**: Double-click **Docker.app** in your **Applications** folder. Then see the previous procedure, \"To check whether Docker is running\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/50849de-docker-app-in-apps.png\",\n        \"docker-app-in-apps.png\",\n        886,\n        198,\n        \"#c4e0e7\"\n      ]\n    }\n  ]\n}\n[/block]\n* **Windows**: Choose **Start**, search for `Docker`, and choose the **Docker for Windows** app in the search results. Then see the previous procedure, \"To check whether Docker is running\".\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/b698155-docker-app-search.png\",\n        \"docker-app-search.png\",\n        593,\n        682,\n        \"#262527\"\n      ]\n    }\n  ]\n}\n[/block]\n* For Linux, run the command `sudo systemctl start docker` or `sudo service docker start`, depending on your operating system. Then see the previous procedure, \"To check whether Docker is running\".\n\n# Step 4: Run the container\n\nIn this step, you have Docker run a container that has the settings, packages, apps, and dependencies, based on your original Cloud9 online workspace. This container also connects to the directory that contains your downloaded content.\n\n1. Get the base image ID for your original Cloud9 online workspace. To get this base image ID, look in the Cloud9 console at either your workspace tile's caption on your Cloud9 dashboard's **Workspaces** page, or the tile's caption in the **Choose a template** section of the **Create a new workspace** page.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cf2ad58-ide-workspace-tile-caption.png\",\n        \"ide-workspace-tile-caption.png\",\n        614,\n        620,\n        \"#eeeeed\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cf2bd61-console-choose-template.png\",\n        \"console-choose-template.png\",\n        830,\n        274,\n        \"#d8d8d6\"\n      ]\n    }\n  ]\n}\n[/block]\n2. Once you have the caption from the workspace tile or the workspace template tile, use the following table to look up the base image ID.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Workspace tile caption\",\n    \"h-1\": \"Workspace template tile caption\",\n    \"h-2\": \"Base image ID\",\n    \"0-0\": \"php workspace\",\n    \"0-1\": \"HTML5\",\n    \"1-0\": \"nodejs workspace\",\n    \"1-1\": \"Node.js\",\n    \"2-0\": \"php workspace\",\n    \"2-1\": \"PHP, Apache, & MySQL\",\n    \"3-0\": \"python workspace\",\n    \"3-1\": \"Python\",\n    \"4-0\": \"python workspace\",\n    \"4-1\": \"Django\",\n    \"5-0\": \"ruby workspace\",\n    \"5-1\": \"Ruby\",\n    \"6-0\": \"cpp workspace\",\n    \"6-1\": \"C++\",\n    \"7-0\": \"wordpress workspace\",\n    \"7-1\": \"Wordpress\",\n    \"8-0\": \"railstutorial workspace\",\n    \"8-1\": \"Rails Tutorial\",\n    \"9-0\": \"<blank>\",\n    \"9-1\": \"Blank\",\n    \"10-0\": \"cs50 workspace\",\n    \"10-1\": \"Harvard's CS50\",\n    \"10-2\": \"`cs50/ide` - Note that this image includes a special version of Cloud9 Core with CS50-specific plugins. For more information, see [CS50 IDE Offline](https://cs50.readthedocs.io/ide/offline/).\",\n    \"0-2\": \"`cloud9/ws-html5`\",\n    \"1-2\": \"`cloud9/ws-nodejs`\",\n    \"2-2\": \"`cloud9/ws-php`\",\n    \"3-2\": \"`cloud9/ws-python-plain`\",\n    \"4-2\": \"`cloud9/ws-python`\",\n    \"5-2\": \"`cloud9/ws-ruby`\",\n    \"6-2\": \"`cloud9/ws-cpp`\",\n    \"7-2\": \"`cloud9/ws-wordpress`\",\n    \"9-2\": \"`cloud9/ws-default`\",\n    \"8-2\": \"`cloud9/ws-ruby`\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]\n3. From a terminal or command prompt on your local computer, run the following command to run the container, substituting `<base_image_id>` for the base image ID that you just noted, for example `cloud9/ws-default`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"docker run --privileged -e \\\"IP=127.0.0.1\\\" -e \\\"PORT=8080\\\" --name myc9ws --mount type=bind,source=~/c9/downloaded-files/,target=/home/ubuntu/workspace/ -d -t -p 5050:5050 -p 8080-8082:8080-8082 <base_image_id>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIn the preceding command: \n\n* `--privileged` gives the container permission to do almost everything that the host operating system can do.\n* `-e` sets simple environment variables in the container, in this case the IP address and port.\n* `--name` is a name for the image, in this case, `myc9ws`. \n* `--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/`).\n* `-d` means to run the container in the background.\n* `-t` means to run the container with a pseudo terminal.\n* `-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.\n* `<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.\n\n:information-source: On Linux, you might need to add `sudo` before `docker`, both here and throughout the rest of this topic. To get around this, see [Manage Docker as a non-root user](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user).\n\nTo confirm that the container is indeed running, run the command `docker ps`. If it's running, you'll see a container with a **NAMES** value of **myc9ws** and a **STATUS** of **Up** in the list of containers. \n\nIf it isn't running, try running the command `docker start myc9ws`, and then run `docker ps` again. \n\nTo see a list of all available containers, regardless of status, run `docker ps -a`.\n\n# Step 5: Use an IDE to work with your workspace offline\n\nSome IDEs provide features or techniques for working with code in running Docker containers. See the following resources to explore some possibilities. \n\n* Cloud9 Core: see [Using Cloud9 Core](doc:using-cloud9-core).\n* Visual Studio Code: see the [Docker WorkSpace](https://marketplace.visualstudio.com/items?itemName=tiibun.vscode-docker-ws) extension.\n\nNote that we have not fully tested these resources with all operating systems, and can't guarantee they will work in all situations.\n\n# Step 6: Save new workspace changes as you work\n\nIf you stop a container, or if the host operating system stops the container for some other reason,  any uncommitted changes that you made to that container might be lost. To save your changes as you work, one approach is to commit those changes to a new container.\n\nTo commit your changes to a new container, run the following command.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"docker commit <existing_container_name> <new_base_image_id>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIn the preceding command: \n\n* `<existing_container_name>` is the name of the container that was started, for example `myc9ws`.\n* `<new_base_image_id>` is an ID you choose for the new base image, for example, `cloud9/ws-default:YYYY-MM-DD-VV`; where `YYYY-MM-DD` is the current year, month, and day, and `-VV` is some incremental version for that day (for example, `-01`).\n\nTo run a new container based on this new base image, run the following command.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"docker run --privileged -e \\\"IP=127.0.0.1\\\" -e \\\"PORT=8080\\\" --name <new_container_name> --mount type=bind,source=~/c9/downloaded-files/target=/home/ubuntu/workspace/ -d -t -p 5050:5050 -p 8080-8082:8080-8082 <new_base_image_id>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nIn the preceding command: \n\n* `<new_container_name>` is a name you choose for this new container, for example, `myc9ws-YYYY-MM-DD-VV`.\n* `<new_base_image_id>` is the ID of the new base image that you just created, for example, `cloud9/ws-default:YYYY-MM-DD-VV`.\n* If port 5050 is already in use on your local computer, change it to a different port.\n\n# Cleaning up\n\nTo delete Docker and all of its resources from your local computer, follow the steps in this section.\n\n## Step 1: Stop running Docker containers\n\nTo stop all running Docker containers, run the command `docker stop $(docker ps -a -q)`. Note that to run this command in Windows, you should use a utility such as PowerShell or Git Bash for Windows.\n\nTo stop a specific running Docker container, run the command `docker stop <container_name>`, where `<container_name>` is the name of the container to stop. \n\nTo see a list of running Docker containers, run the command `docker ps`.\n\n## Step 2: Delete Docker containers\n\nTo delete all Docker containers, run the command `docker rm -f $(docker ps -a -q)`. Note that to run this command in Windows, you should use a utility such as PowerShell or Git Bash for Windows.\n\nTo delete a specific Docker container, run the command `docker rm -f <container_name>`, where `<container_name>` is the name of the container to delete. \n\nTo see a list of Docker containers, run the command `docker ps -a`.\n\n## Step 3: Delete Docker images\n\nTo delete all Docker images, run the command `docker rmi -f $(docker images -q)`. Note that to run this command in Windows, you should use a utility such as PowerShell or Git Bash for Windows.\n\nTo delete a specific Docker image, run the command `docker rmi -f <image_name>`, where `<image_name>` is the name of the image to delete. \n\nTo see a list of Docker images, run the command `docker image ls`.\n\n## Step 4: Stop Docker\n\n* **macOS**: Click the whale in the status bar, and then choose **Quit Docker**.\n* **Windows**: Right-click the whale in the taskbar, and then choose **Quit Docker Desktop**.\n* **Linux**: Run the command `sudo systemctl stop docker` or `sudo service docker stop`, depending on your operating system.\n\n## Step 5: Uninstall Docker\n\n* **macOS**: If the whale is in the status bar, choose the whale, and then choose **Uninstall**. If the whale isn't in the status bar, run the command `run: <DockerforMacPath> --uninstall`, for example, `/Applications/Docker.app/Contents/MacOS/Docker --uninstall`.\n* **Windows**: Use **Add or remove programs** to uninstall **Docker Desktop**.\n* **Linux**:\n  * **Ubuntu or Debian**: Run the command `sudo apt-get purge docker-ce`.\n  * **Fedora**: Run the command `sudo dnf remove docker-ce`.\n  * **CentOS**: Run the command `sudo yum remove docker-ce`.\n\n:information-source: If you're using Docker Toolbox instead of Docker CE, see [How to uninstall Toolbox for Mac](https://docs.docker.com/toolbox/toolbox_install_mac/#how-to-uninstall-toolbox) or [How to uninstall Toolbox for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/#how-to-uninstall-toolbox).","excerpt":"","slug":"migrating-to-cloud9-offline","type":"basic","title":"Migrating to Your Local Computer"}

Migrating to Your Local Computer


You can move your existing Cloud9 online workspace to your local desktop or laptop computer and work with it offline from there. To do this, we recommend the following approach: 1. Download the folders, files, and data from your Cloud9 online workspace onto your local desktop or laptop computer. If you want to "run" the downloaded workspace content inside of a Docker container (for example running inside of a self-contained Ubuntu operating system, perhaps also running the Cloud9 IDE), continue with the remaining steps here. Otherwise, you're done. 2. Install and then run [Docker](https://docs.docker.com/engine/docker-overview/) on that same computer. You should be comfortable working with Docker. If you're not, get up to speed with the *Docker Get Started Tutorial*, specifically [Part 1: Orientation and setup](https://docs.docker.com/get-started/) and [Part 2: Containers](https://docs.docker.com/get-started/part2/). 3. Use Docker to run a Docker [container](https://docs.docker.com/engine/docker-overview/#docker-objects) on that same computer. This container has the settings, packages, apps, and dependencies from your original Cloud9 online workspace. It also has access to the folders, files, and data that you downloaded from your original online workspace. 4. Use an integrated development environment (IDE) to work with your Cloud9 workspace in the running container. The rest of this topic describes this approach in detail. :exclamation: If you'd rather move your existing Cloud9 workspace over to a new AWS Cloud9 development environment, instead of working with it offline, **stop now** and skip over to the AWS Cloud9 [Migrating to AWS Cloud9](migration-checklist) for alternate instructions instead. :question: If you have questions or need help migrating, go to the [Cloud9 Community](https://community.c9.io/) website or email [support@c9.io](mailto:support@c9.io). # Contents * [Prerequisites](migrating-to-cloud9-offline#section-prerequisites) * [Step 1: Download folders, files, and data from your workspace](migrating-to-cloud9-offline#section-step-1-download-folders-files-and-data-from-your-workspace) * [Step 2: Install Docker](migrating-to-cloud9-offline#section-step-2-install-docker) * [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker) * [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container) * [Step 5: Use an IDE to work with your workspace offline](migrating-to-cloud9-offline#section-step-5-use-an-ide-to-work-with-your-workspace-offline) * [Step 6: Save new workspace changes as you work](migrating-to-cloud9-offline#section-step-6-save-new-workspace-changes-as-you-work) * [Cleaning up](migrating-to-cloud9-offline#section-cleaning-up) # Prerequisites If you want to "run" your downloaded workspace content inside of a Docker container (for example running inside of a self-contained Ubuntu operating system, perhaps also running a version of the Cloud9 IDE), we recommend using a local desktop or laptop computer running an operating system that [Docker Community Edition (Docker CE)](https://docs.docker.com/install/overview/) supports. At the time of this writing, supported operating systems are: * **macOS**: OS X El Capitan 10.11 or later. * **Windows**: Windows 10. * **Linux**: * **Ubuntu**: Xenial 16.04 (LTS) or Trusty 14.04 (LTS). * **Debian**: Stretch 9 (stable), Jessie 8 (LTS), or Wheezy 7.7 (LTS). * **Fedora**: 64-bit version 26 or 27. * **CentOS**: A maintained version of CentOS 7. That same computer must have the IDE that you want to use to work with your Cloud9 workspace that is running in Docker. :information-source: If you're running an older version of a Mac or Windows operating system that Docker CE doesn't support, you can try using [Docker Toolbox](https://docs.docker.com/toolbox/overview/). We link to equivalent Docker Toolbox instructions throughout this topic. However, we don't go into details about them here. # Step 1: Download folders, files, and data from your workspace :information-source: If you have already downloaded your workspace and just want to know how to extract the workspace download's contents, skip ahead to step 7 in this procedure. The following video demonstrates the download process, from the start of the video through the 0:45 mark and resuming from the 1:57 mark to the end of the video. [block:embed] { "html": "<iframe class=\"embedly-embed\" src=\"//cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0SAkLUnJYkw%3Ffeature%3Doembed&url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0SAkLUnJYkw&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0SAkLUnJYkw%2Fhqdefault.jpg&key=02466f963b9b4bb8845a05b53d3235d7&type=text%2Fhtml&schema=youtube\" width=\"854\" height=\"480\" scrolling=\"no\" frameborder=\"0\" allow=\"autoplay; fullscreen\" allowfullscreen=\"true\"></iframe>", "url": "https://www.youtube.com/watch?v=0SAkLUnJYkw", "title": "C9 migration to AWS Cloud9", "favicon": "https://s.ytimg.com/yts/img/favicon-vfl8qSV2F.ico", "image": "https://i.ytimg.com/vi/0SAkLUnJYkw/hqdefault.jpg" } [/block] In your existing Cloud9 online workspace, you might have some combination of folders, files, data in databases, and content in app frameworks (such as WordPress) that you want to continue working with. In this step, you instruct Cloud9 to prepare a single file for you to download. You also choose whether Cloud9 includes in this download either just the contents of the workspace's home directory or the entire workspace's contents. 1. Open your **Workspaces** dashboard, if it isn't already displayed. (To display it, go to https://c9.io/<your-user-name>.) 2. In the tile for the workspace that you want to download, choose **Prepare for Download / Migrate**. [block:image] { "images": [ { "image": [ "https://files.readme.io/3d254b5-prepare-workspace.png", "prepare-workspace.png", 377, 302, "#6b985e" ] } ] } [/block] 3. In the dialog box that displays, choose **Archive**, and wait while Cloud9 prepares your workspace to be downloaded. :exclamation: Cloud9 can take a long time to prepare the workspace download file. After you choose **Archive**, you can't do anything with that workspace until Cloud9 finishes its work. [block:image] { "images": [ { "image": [ "https://files.readme.io/218e713-archive-workspace.png", "archive-workspace.png", 687, 270, "#f2f2f1" ] } ] } [/block] 4. Do one of the following: * In your email inbox, open the message from support@c9.io with the subject **Your workspace is ready for download/migration**. Then choose the link in the body of the message. * In your **Workspaces** dashboard, if the workspace's tile displays the message **Your workspace is ready for download/migration**, then choose **Download / Migrate**. On the **What would you like to do with your workspace** page, select **Download to my computer**, and then choose **Next**. [block:image] { "images": [ { "image": [ "https://files.readme.io/7802e2d-download-email.png", "download-email.png", 452, 315, "#d3d5d7" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/7de0419-download-ready.png", "download-ready.png", 381, 304, "#658e5b" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/4d54a4b-download-workspace.png", "download-workspace.png", 933, 897, "#e2b315" ] } ] } [/block] 5. On the **What would you like to download** page, choose one of the following options, and then choose **Download**: * Choose **Home directory files** if you want Cloud9 to prepare to download only the directories, subdirectories, and files from this workspace's `/home/ubuntu/environment` directory. * Choose **Workspace image** if you want Cloud9 to prepare to download the directories, subdirectories, and files, from this workspace's "root" or `/` directory, along with additional content (for example, any database files created by MySQL or MongoDB) that you can use to "run" this workspace inside of a Docker container (for example, running inside of a self-contained Ubuntu operating system, perhaps also running a version of the Cloud9 IDE). [block:image] { "images": [ { "image": [ "https://files.readme.io/20fcccc-download-type.png", "download-type.png", 943, 913, "#2d93db" ] } ] } [/block] 6. Depending on the type of web browser that you're using, follow any on-screen instructions to finish saving the workspace download to your local computer. When you are finished saving the workspace download, choose **Cancel** or **Dashboard** to return to your **Workspaces** dashboard. 7. The workspace download consists of a single file, in .tar.gz, or compressed TAR (Tape ARchive) format. (This file is also sometimes referred to as a *tar file* or a *tarball*.) To extract (also sometimes referred to as *unpack*, *unarchive*, *unzip*, or simply *open*) the contents of this file, run the following command from a terminal for Linux or **Terminal** for macOS. (Alternatives for Windows are listed below.) This command assumes that you have already switched to the directory that contains the file that you want to extract. :information-source: If you want to "run" this workspace inside of a Docker container (for example running inside of a self-contained Ubuntu operating system, perhaps also running a version of the Cloud9 IDE), we recommend that you create a single, blank directory on your local computer and extract the contents of this file into it. In a later step, you connect Docker to this directory. For example, this topic uses `mkdir -p ~/c9/downloaded-files/`. (For Windows, `~` is available through utilities such as [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell) and [Git Bash for Windows](https://gitforwindows.org/). Or you can use something like `mkdir <drive>:\Users\<user_name>\c9\downloaded-files\`.) **For Linux or macOS**, run the following command: `tar -xvzf FILENAME.tar.gz -C DESTINATION` Where: * `x` means to extract the contents of the file. * `v` means to verbosely show progress. (To turn this off, omit `v`.) * `z` means to uncompress the file. * `f` means the name of the specified file to extract. * `FILENAME.tar.gz` is the name of the file to extract. * `-C` means to extract the file to the specified path. * `DESTINATION` is the path to where you want to extract the file's contents, for example, `~/c9/downloaded-files/`. **For Windows**, search the internet using a phrase such as "open .tar.gz files in Windows", followed by your Windows version number, for example, "open .tar.gz files in Windows 10". Alternatives here include various graphical applications (such as 7-Zip) as well as command prompt options (such as `tar` through Cygwin). 8. If you chose **Workspace image** earlier, continue on to the next step to learn how to "run" this workspace inside of a Docker container on your local computer. Otherwise, if you chose **Home directory files** earlier, you're now done and can skip the rest of the steps on this page. # Step 2: Install Docker In this step, you install [Docker Community Edition (Docker CE)](https://docs.docker.com/install/overview/) on your local computer. If you already have Docker installed, skip ahead to [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker). To check whether Docker is installed, run the command `docker --version` from your operating system's terminal or command prompt. If you get an error message, see the following procedure, "To install Docker CE". Otherwise, if the Docker version number is displayed, skip ahead to [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker). To install Docker CE, see the following: * **macOS**: [Install Docker for Mac](https://docs.docker.com/v17.12/docker-for-mac/install/). * **Windows**: [Install Docker for Windows](https://docs.docker.com/v17.12/docker-for-windows/install/). * **Linux**: * **Ubuntu**: [Get Docker CE for Ubuntu](https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/). * **Debian**: [Get Docker CE for Debian](https://docs.docker.com/v17.12/install/linux/docker-ce/debian/). * **Fedora**: [Get Docker CE for Fedora](https://docs.docker.com/v17.12/install/linux/docker-ce/fedora/). * **CentOS**: [Get Docker CE for CentOS](https://docs.docker.com/v17.12/install/linux/docker-ce/centos/). :information-source: If you must use Docker Toolbox instead of Docker CE, see [Install Docker Toolbox on macOS](https://docs.docker.com/toolbox/toolbox_install_mac/) or [Install Docker Toolbox on Windows](https://docs.docker.com/toolbox/toolbox_install_windows/), and then skip ahead to [Step 3: Start Docker](migrating-to-cloud9-offline#section-step-3-start-docker). # Step 3: Start Docker In this step, you start the Docker process or app. If Docker is already running, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). :information-source: If you're using Docker Toolbox instead of Docker CE, see [Verify your installation for Mac](https://docs.docker.com/toolbox/toolbox_install_mac/#step-3-verify-your-installation) or [Verify your installation for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/#step-3-verify-your-installation), and then skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). To check whether Docker is running: * **macOS**: Check whether the whale in the status bar is in a steady state (in other words, the blocks on top of the whale aren't moving). This indicates that Docker is running. If the whale is in a steady state, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). If the whale isn't in the status bar, see the following procedure, "To start Docker". [block:image] { "images": [ { "image": [ "https://files.readme.io/aef59f7-whale-in-menu-bar.png", "whale-in-menu-bar.png", 394, 43, "#464448" ] } ] } [/block] * **Windows**: Check whether the whale in the taskbar is in a steady state (in other words, the blocks on top of the whale aren't moving). This indicates that Docker is running. If the whale is in a steady state, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). If the whale isn't in the taskbar, see the following procedure, "To start Docker". [block:image] { "images": [ { "image": [ "https://files.readme.io/94624f8-whale-taskbar-circle.png", "whale-taskbar-circle.png", 256, 47, "#0e0b0a" ] } ] } [/block] * **Linux**: Run the command `sudo systemctl status docker` or `sudo service docker status`, depending on your operating system. If the service is running, skip ahead to [Step 4: Run the container](migrating-to-cloud9-offline#section-step-4-run-the-container). If the service isn't running, see the following procedure, "To start Docker". To start Docker: * **macOS**: Double-click **Docker.app** in your **Applications** folder. Then see the previous procedure, "To check whether Docker is running". [block:image] { "images": [ { "image": [ "https://files.readme.io/50849de-docker-app-in-apps.png", "docker-app-in-apps.png", 886, 198, "#c4e0e7" ] } ] } [/block] * **Windows**: Choose **Start**, search for `Docker`, and choose the **Docker for Windows** app in the search results. Then see the previous procedure, "To check whether Docker is running". [block:image] { "images": [ { "image": [ "https://files.readme.io/b698155-docker-app-search.png", "docker-app-search.png", 593, 682, "#262527" ] } ] } [/block] * For Linux, run the command `sudo systemctl start docker` or `sudo service docker start`, depending on your operating system. Then see the previous procedure, "To check whether Docker is running". # Step 4: Run the container In this step, you have Docker run a container that has the settings, packages, apps, and dependencies, based on your original Cloud9 online workspace. This container also connects to the directory that contains your downloaded content. 1. Get the base image ID for your original Cloud9 online workspace. To get this base image ID, look in the Cloud9 console at either your workspace tile's caption on your Cloud9 dashboard's **Workspaces** page, or the tile's caption in the **Choose a template** section of the **Create a new workspace** page. [block:image] { "images": [ { "image": [ "https://files.readme.io/cf2ad58-ide-workspace-tile-caption.png", "ide-workspace-tile-caption.png", 614, 620, "#eeeeed" ] } ] } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/cf2bd61-console-choose-template.png", "console-choose-template.png", 830, 274, "#d8d8d6" ] } ] } [/block] 2. Once you have the caption from the workspace tile or the workspace template tile, use the following table to look up the base image ID. [block:parameters] { "data": { "h-0": "Workspace tile caption", "h-1": "Workspace template tile caption", "h-2": "Base image ID", "0-0": "php workspace", "0-1": "HTML5", "1-0": "nodejs workspace", "1-1": "Node.js", "2-0": "php workspace", "2-1": "PHP, Apache, & MySQL", "3-0": "python workspace", "3-1": "Python", "4-0": "python workspace", "4-1": "Django", "5-0": "ruby workspace", "5-1": "Ruby", "6-0": "cpp workspace", "6-1": "C++", "7-0": "wordpress workspace", "7-1": "Wordpress", "8-0": "railstutorial workspace", "8-1": "Rails Tutorial", "9-0": "<blank>", "9-1": "Blank", "10-0": "cs50 workspace", "10-1": "Harvard's CS50", "10-2": "`cs50/ide` - Note that this image includes a special version of Cloud9 Core with CS50-specific plugins. For more information, see [CS50 IDE Offline](https://cs50.readthedocs.io/ide/offline/).", "0-2": "`cloud9/ws-html5`", "1-2": "`cloud9/ws-nodejs`", "2-2": "`cloud9/ws-php`", "3-2": "`cloud9/ws-python-plain`", "4-2": "`cloud9/ws-python`", "5-2": "`cloud9/ws-ruby`", "6-2": "`cloud9/ws-cpp`", "7-2": "`cloud9/ws-wordpress`", "9-2": "`cloud9/ws-default`", "8-2": "`cloud9/ws-ruby`" }, "cols": 3, "rows": 11 } [/block] 3. From a terminal or command prompt on your local computer, run the following command to run the container, substituting `<base_image_id>` for the base image ID that you just noted, for example `cloud9/ws-default`. [block:code] { "codes": [ { "code": "docker run --privileged -e \"IP=127.0.0.1\" -e \"PORT=8080\" --name myc9ws --mount type=bind,source=~/c9/downloaded-files/,target=/home/ubuntu/workspace/ -d -t -p 5050:5050 -p 8080-8082:8080-8082 <base_image_id>", "language": "shell" } ] } [/block] 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. :information-source: On Linux, you might need to add `sudo` before `docker`, both here and throughout the rest of this topic. To get around this, see [Manage Docker as a non-root user](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user). To confirm that the container is indeed running, run the command `docker ps`. If it's running, you'll see a container with a **NAMES** value of **myc9ws** and a **STATUS** of **Up** in the list of containers. If it isn't running, try running the command `docker start myc9ws`, and then run `docker ps` again. To see a list of all available containers, regardless of status, run `docker ps -a`. # Step 5: Use an IDE to work with your workspace offline Some IDEs provide features or techniques for working with code in running Docker containers. See the following resources to explore some possibilities. * Cloud9 Core: see [Using Cloud9 Core](doc:using-cloud9-core). * Visual Studio Code: see the [Docker WorkSpace](https://marketplace.visualstudio.com/items?itemName=tiibun.vscode-docker-ws) extension. Note that we have not fully tested these resources with all operating systems, and can't guarantee they will work in all situations. # Step 6: Save new workspace changes as you work If you stop a container, or if the host operating system stops the container for some other reason, any uncommitted changes that you made to that container might be lost. To save your changes as you work, one approach is to commit those changes to a new container. To commit your changes to a new container, run the following command. [block:code] { "codes": [ { "code": "docker commit <existing_container_name> <new_base_image_id>", "language": "shell" } ] } [/block] In the preceding command: * `<existing_container_name>` is the name of the container that was started, for example `myc9ws`. * `<new_base_image_id>` is an ID you choose for the new base image, for example, `cloud9/ws-default:YYYY-MM-DD-VV`; where `YYYY-MM-DD` is the current year, month, and day, and `-VV` is some incremental version for that day (for example, `-01`). To run a new container based on this new base image, run the following command. [block:code] { "codes": [ { "code": "docker run --privileged -e \"IP=127.0.0.1\" -e \"PORT=8080\" --name <new_container_name> --mount type=bind,source=~/c9/downloaded-files/target=/home/ubuntu/workspace/ -d -t -p 5050:5050 -p 8080-8082:8080-8082 <new_base_image_id>", "language": "shell" } ] } [/block] In the preceding command: * `<new_container_name>` is a name you choose for this new container, for example, `myc9ws-YYYY-MM-DD-VV`. * `<new_base_image_id>` is the ID of the new base image that you just created, for example, `cloud9/ws-default:YYYY-MM-DD-VV`. * If port 5050 is already in use on your local computer, change it to a different port. # Cleaning up To delete Docker and all of its resources from your local computer, follow the steps in this section. ## Step 1: Stop running Docker containers To stop all running Docker containers, run the command `docker stop $(docker ps -a -q)`. Note that to run this command in Windows, you should use a utility such as PowerShell or Git Bash for Windows. To stop a specific running Docker container, run the command `docker stop <container_name>`, where `<container_name>` is the name of the container to stop. To see a list of running Docker containers, run the command `docker ps`. ## Step 2: Delete Docker containers To delete all Docker containers, run the command `docker rm -f $(docker ps -a -q)`. Note that to run this command in Windows, you should use a utility such as PowerShell or Git Bash for Windows. To delete a specific Docker container, run the command `docker rm -f <container_name>`, where `<container_name>` is the name of the container to delete. To see a list of Docker containers, run the command `docker ps -a`. ## Step 3: Delete Docker images To delete all Docker images, run the command `docker rmi -f $(docker images -q)`. Note that to run this command in Windows, you should use a utility such as PowerShell or Git Bash for Windows. To delete a specific Docker image, run the command `docker rmi -f <image_name>`, where `<image_name>` is the name of the image to delete. To see a list of Docker images, run the command `docker image ls`. ## Step 4: Stop Docker * **macOS**: Click the whale in the status bar, and then choose **Quit Docker**. * **Windows**: Right-click the whale in the taskbar, and then choose **Quit Docker Desktop**. * **Linux**: Run the command `sudo systemctl stop docker` or `sudo service docker stop`, depending on your operating system. ## Step 5: Uninstall Docker * **macOS**: If the whale is in the status bar, choose the whale, and then choose **Uninstall**. If the whale isn't in the status bar, run the command `run: <DockerforMacPath> --uninstall`, for example, `/Applications/Docker.app/Contents/MacOS/Docker --uninstall`. * **Windows**: Use **Add or remove programs** to uninstall **Docker Desktop**. * **Linux**: * **Ubuntu or Debian**: Run the command `sudo apt-get purge docker-ce`. * **Fedora**: Run the command `sudo dnf remove docker-ce`. * **CentOS**: Run the command `sudo yum remove docker-ce`. :information-source: If you're using Docker Toolbox instead of Docker CE, see [How to uninstall Toolbox for Mac](https://docs.docker.com/toolbox/toolbox_install_mac/#how-to-uninstall-toolbox) or [How to uninstall Toolbox for Windows](https://docs.docker.com/toolbox/toolbox_install_windows/#how-to-uninstall-toolbox).