Stay organized with collections
Save and categorize content based on your preferences.
Deploy a Cloud Run service with Cloud Code for VS Code
This page shows you how to get started quickly with Cloud Code.
You'll set up a Hello World service that runs on Cloud Run using a
sample application, deploy your service to Cloud Run, and view
the status of your live service's resources.
Before you begin
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Cloud Run service: To delete a Cloud Run
service, navigate to Cloud Run in the
Google Cloud console using the navigation menu. Select the service
you want to delete and then click Delete.
What's next
Discover the language-specific
debugging support
that Cloud Code provides.
Customize your Cloud Code experience by configuring
relevant settings.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eThis guide provides instructions on how to quickly deploy a Hello World service to Cloud Run using Cloud Code for VS Code.\u003c/p\u003e\n"],["\u003cp\u003eYou'll learn how to create a new Cloud Run application from a selection of sample services and then deploy it using the "Deploy to Cloud Run" command.\u003c/p\u003e\n"],["\u003cp\u003eThe guide explains how to use Cloud Code's Log Viewer to view logs from your deployed service, as well as how to view the status of your Cloud Run service using the Cloud Run service browser.\u003c/p\u003e\n"],["\u003cp\u003eInstructions are given on how to clean up resources, whether deleting the entire project or only the container image and Cloud Run service, after the quickstart.\u003c/p\u003e\n"],["\u003cp\u003eFinally, it gives pointers to further resources such as language-specific debugging, relevant settings, and running a Kubernetes application with Cloud Code.\u003c/p\u003e\n"]]],[],null,["# Quickstart: Deploy a Cloud Run service with Cloud Code for VS Code\n\nDeploy a Cloud Run service with Cloud Code for VS Code\n======================================================\n\nThis page shows you how to get started quickly with Cloud Code.\n\nYou'll set up a Hello World service that runs on Cloud Run using a\nsample application, deploy your service to Cloud Run, and view\nthe status of your live service's resources.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Cloud Run API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the Cloud Run API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=run.googleapis.com)\n\n1. Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git). Git is required for copying samples to your machine.\n2. Install the [Cloud Code plugin](/code/docs/vscode/install#installing) if you haven't already.\n\nCreating a service\n------------------\n\n1. In the Cloud Code status bar, click the active project name.\n\n2. In the Quick Pick menu that appears, select **New Application**.\n\n3. Choose **Cloud Run application** as your preferred application type.\n\n4. From the list of sample applications (Node.js, Python with Flask and Django\n frameworks, Java, Go), choose a Hello World service.\n\n For example, choosing `Node.js: Hello World` creates a starter Node.js\n Hello World service.\n5. Confirm your service location on disk (or modify it, if necessary) and click\n **Create New Application**.\n\n A preview of the README file for your selected service will open in VS Code.\n\nDeploy to Cloud Run\n-------------------\n\nTo deploy your service to Cloud Run, follow these steps:\n\n1. Open the Command Palette (press `Ctrl`/`Cmd`+`Shift`+`P` or click **View** \\\u003e\n **Command Palette** ) and then run the **Deploy to Cloud Run** command.\n\n2. In the **Deploy to Cloud Run** pane, set your Google Cloud project.\n\n3. Accept the remaining default settings and then click **Deploy**.\n\n Cloud Code builds your image, pushes it to the registry, and\n deploys your service to Cloud Run.\n4. To view your running service, open the URL displayed at the top of the\n **Deploy to Cloud Run** dialog.\n\nViewing logs\n------------\n\nYou can also view logs from your deployed service with the Log Viewer\nthat comes with Cloud Code.\n\nTo view logs, follow these steps:\n\n1. Click **Cloud Code** in the VS Code Activity bar on the left.\n2. Expand the **Cloud Run** section to view your Cloud Run service.\n3. Right-click your Cloud Run service and then click **View logs**.\n\nViewing resource status\n-----------------------\n\nYou can view the status of your Cloud Run services using the\nCloud Run service browser:\n\n1. Click **Cloud Code** in the VS Code Activity bar on the left.\n2. Expand the **Cloud Run** section to view your Cloud Run service.\n3. Click the Cloud Run service you'd like to know more about. The service's properties are displayed in the window below.\n\nCleaning up\n-----------\n\nTo delete your project:\n\n1. Go to the Projects page in the Google Cloud console:\n\n [Go to the Projects page](https://console.cloud.google.com/project)\n2. Select the project you created for this quickstart and then click\n **Delete**.\n\n3. Type the project ID to confirm and then click **Shut down**.\n\n This shuts down the project and schedules it for deletion.\n\nIf you're using a pre-existing project and would like to delete resources\nyou created for this quickstart:\n\n- **Container image:** While Cloud Run doesn't charge when the\n service isn't in use, you might be\n [charged for storing the container image in Artifact Registry](/artifact-registry/pricing).\n For steps to delete your image, see\n [Deleting images](/artifact-registry/docs/docker/manage-images#deleting_images).\n\n- **Cloud Run service:** To delete a Cloud Run\n service, navigate to Cloud Run in the\n Google Cloud console using the navigation menu. Select the service\n you want to delete and then click **Delete**.\n\nWhat's next\n-----------\n\n- Discover the language-specific [debugging support](/code/docs/vscode/debug) that Cloud Code provides.\n- Customize your Cloud Code experience by configuring [relevant settings](/code/docs/vscode/configuring-settings).\n- Try creating and [running a Kubernetes application with Cloud Code](/code/docs/vscode/quickstart-local-dev)."]]