| copyright |
|
||
|---|---|---|---|
| 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} {: 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}
{: #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:
- An account administrator can grant specific users access to {{site.data.keyword.cloud-shell_short}} and its features, even if {{site.data.keyword.cloud-shell_short}} settings are disabled at the account level. For more information, see Assigning access to {{site.data.keyword.cloud-shell_short}} and its features at a user level.
- Account owners or users with {{site.data.keyword.cloud-shell_short}} administrator access can enable or disable {{site.data.keyword.cloud-shell_short}} features for an account. The available features in this release are File upload and download and Web preview. The feature settings apply only to the enabled {{site.data.keyword.cloud-shell_short}} locations. For more information, see Enabling or disabling {{site.data.keyword.cloud-shell_short}} features for an account.
- For more information, see IAM roles and actions.
{: #open-shell} {: step}
In the {{site.data.keyword.cloud_notm}} console, click the {{site.data.keyword.cloud-shell_notm}} icon . A session starts and automatically logs you in through the {{site.data.keyword.cloud_notm}} CLI.
{: #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-app-locally} {: step}
You can start it in {{site.data.keyword.cloud-shell_short}} and preview it locally.
-
First, download project dependencies for the Node.js sample app.
npm install --only=prod
{: pre}
-
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}
-
In the {{site.data.keyword.cloud-shell_short}} menu bar, click the Web preview icon
, 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}}!
-
Press
Control+Cto stop the app.
{: #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.