Skip to content

Latest commit

 

History

History
125 lines (86 loc) · 5.48 KB

getting-started.md

File metadata and controls

125 lines (86 loc) · 5.48 KB
copyright
years
2020, 2026
lastupdated 2026-11-11
keywords getting started tutorial, IBM Cloud Shell, cloud shell, IBM Cloud cli, using IBM Cloud Shell, cloud shell access
content-type tutorial
services
account-plan lite
completion-time 30m
subcollection cloud-shell

{{site.data.keyword.attribute-definition-list}}

Getting started with {{site.data.keyword.cloud-shell_notm}}

{: #getting-started} {: toc-content-type="tutorial"} {: toc-services=""} {: toc-completion-time="30m"}

In this getting started tutorial, you use {{site.data.keyword.cloud-shell_full}} to clone a sample Node.js app. {{site.data.keyword.cloud-shell_notm}} is a cloud-based shell workspace that you can access through your browser. {{site.data.keyword.cloud-shell_short}} is preconfigured with the full {{site.data.keyword.cloud_notm}} CLI and tons of plug-ins and tools that you can use to manage apps, resources, and infrastructure. {: shortdesc}

New to {{site.data.keyword.cloud-shell_short}}? Watch the demo video{: external} to see how you can start to use the service from the {{site.data.keyword.cloud_notm}} console. {: tip}

Before you begin

{: #prereqs}

  • If you don't already have an {{site.data.keyword.cloud_notm}} account, sign up for one{: external} and log in.
  • Note the following account access information that might affect your access to {{site.data.keyword.cloud-shell_short}} and its features:

Start a session in {{site.data.keyword.cloud-shell_notm}}

{: #open-shell} {: step}

In the {{site.data.keyword.cloud_notm}} console, click the {{site.data.keyword.cloud-shell_notm}} icon {{site.data.keyword.cloud-shell_notm}} icon. A session starts and automatically logs you in through the {{site.data.keyword.cloud_notm}} CLI.

Clone the Node.js sample app

{: #clone-app} {: step}

Your {{site.data.keyword.cloud-shell_short}} session starts in the temporary home directory, /home/<user-name>. Clone the Node.js Express sample app{: external} to this directory and then change to the sample app directory by running the following commands.

git clone https://github.com/IBM/nodejs-express-app.git

{: pre}

cd nodejs-express-app

{: pre}

From your app directory, run the following command to view the new files.

ls

{: pre}

You can see that your nodejs-express-app directory contains all of the sample app files and folders.

Dockerfile  Dockerfile-tools  LICENSE  README.md  package-lock.json
package.json  public  scripts  server  test

{: screen}

Preview the app locally

{: #preview-app-locally} {: step}

You can start it in {{site.data.keyword.cloud-shell_short}} and preview it locally.

  1. First, download project dependencies for the Node.js sample app.

    npm install --only=prod

    {: pre}

  2. Start the app.

    npm run start

    {: pre}

    When the app is running, it outputs the location where the app UI is available. For {{site.data.keyword.cloud-shell_short}}, you need to note only the port, which in this case is 3000 .

    > nodejsexpressapp@1.0.0 start /home/my-user-name/nodejs-express-app
    > node server/server.js
    
    App UI available http://localhost:3000
    Swagger UI available http://localhost:3000/swagger/api-docs
    

    {: screen}

  3. In the {{site.data.keyword.cloud-shell_short}} menu bar, click the Web preview icon Web preview, and select port 3000.

    Your app preview opens in a new window. If you see the congratulations message, your app is running locally in {{site.data.keyword.cloud-shell_short}}!

  4. Press Control+C to stop the app.

Next steps

{: #next-steps}

From {{site.data.keyword.cloud-shell_short}}, you can quickly run commands on your {{site.data.keyword.cloud_notm}} account. For example:

In addition to the {{site.data.keyword.cloud_notm}} CLI, {{site.data.keyword.cloud-shell_short}} is preconfigured with all {{site.data.keyword.cloud_notm}} CLI plug-ins and many tools and runtimes to help you work in the cloud. For the full list, see Installed plug-ins and tools.