Stay organized with collections
Save and categorize content based on your preferences.
This tutorial shows how to get started with Compute Engine.
Follow this tutorial by deploying a Hello World .NET web
app to Compute Engine. For help getting started with App Engine, see
the App Engine standard environment.
Objectives
Deploy a Hello World sample app to a single Compute Engine instance.
Costs
In this document, you use the following billable components of Google Cloud:
To generate a cost estimate based on your projected usage,
use the pricing calculator.
New Google Cloud users might be eligible for a free trial.
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.
Leave the settings set to their default values, and click Deploy.
Wait for the Compute Engine instance to deploy. It usually
takes about 5 minutes to deploy.
To display resource information, click VM instance.
To edit the VM instance, click Manage Resource.
Click Set Windows password, and then make a note of the username.
Copy the new Windows password, and then click Close.
In the VM instance details page, make a note of the external IP address.
On your local Windows machine, edit the file HelloWorld/Properties/PublishProfiles/ComputeEngine.pubxml.
Enter your VM instance's external IP address between <MSDeployServiceURL>
and </MSDeployServiceURL>. For example, <MSDeployServiceURL>203.0.113.22</MSDeployServiceURL>
Enter the instance's username that you previously noted between <UserName> and </UserName>.
Save your changes to the ComputeEngine.pubxml file.
In a PowerShell window, publish your app to the Compute Engine instance:
Cloud Logging is automatically configured to gather logs from
various common services, including syslog.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used in this
tutorial, either delete the project that contains the resources, or keep the project and
delete the individual resources.
Delete the project
In the Google Cloud console, go to the Manage resources page.
[[["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-28 UTC."],[[["\u003cp\u003eThis tutorial guides users through deploying a Hello World .NET web application to a single Compute Engine instance.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves setting up a Compute Engine instance via the Google Cloud Marketplace and configuring it to host the web application.\u003c/p\u003e\n"],["\u003cp\u003eUsers will need to install .NET Core SDK 2.1 or later and Web Deploy 3.6 or later on their local Windows machine before proceeding with the tutorial.\u003c/p\u003e\n"],["\u003cp\u003eThe tutorial provides steps for managing and monitoring the Compute Engine instance, including accessing logs via the Logs Explorer.\u003c/p\u003e\n"],["\u003cp\u003eInstructions are given to delete the project, or alternatively, delete individual resources to avoid incurring further charges after completing the tutorial.\u003c/p\u003e\n"]]],[],null,["# Getting started with .NET on Compute Engine\n\n*** ** * ** ***\n\nThis tutorial shows how to get started with Compute Engine.\nFollow this tutorial by deploying a Hello World .NET web\napp to Compute Engine. For help getting started with App Engine, see\nthe [App Engine standard environment](/dotnet/getting-started/tutorial-app).\n\nObjectives\n----------\n\n- Deploy a Hello World sample app to a single Compute Engine instance.\n\nCosts\n-----\n\n\nIn this document, you use the following billable components of Google Cloud:\n\n\n- [Compute Engine](/compute/all-pricing)\n\n\nTo generate a cost estimate based on your projected usage,\nuse the [pricing calculator](/products/calculator). \nNew Google Cloud users might be eligible for a [free trial](/free). \n\n\u003cbr /\u003e\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 Compute Engine API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=compute)\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 Compute Engine API.\n\n\n [Enable the API](https://console.cloud.google.com/flows/enableapi?apiid=compute)\n\n1. Install [.NET\n Core SDK 2.1](https://dotnet.microsoft.com/download/dotnet-core/2.1) or later on your local machine running [Microsoft Windows](https://www.microsoft.com/en-us/windows).\n2. Install [Web Deploy\n3.6](https://www.iis.net/downloads/microsoft/web-deploy) or later on your local machine running [Microsoft Windows](https://www.microsoft.com/en-us/windows). \n\n\nRunning the app locally\n-----------------------\n\n\n1. [Download and unzip](https://github.com/GoogleCloudPlatform/getting-started-dotnet/archive/master.zip) or clone the sample repository from github:\n\n git clone https://github.com/GoogleCloudPlatform/getting-started-dotnet.git\n\n2. In a PowerShell window, go into the `HelloWorld` directory:\n\n cd getting-started-dotnet\\HelloWorld\n\n3. Start a local web server:\n\n dotnet run\n\n4. Open a web browser to `localhost:8080`.\n\n In your web browser, you see some Hello World text, served from your\n local machine.\n5. When you're ready to move on, stop the local web server by pressing\n \u003ckbd\u003eControl+C\u003c/kbd\u003e.\n\n\u003cbr /\u003e\n\nDeploying to a single instance\n------------------------------\n\n\nThis section walks you through running a single instance of your app\non Compute Engine.\n\n\n### Create and configure a Compute Engine instance\n\n\nFrom Google Cloud Marketplace, you can launch an instance of Windows running Microsoft IIS on Compute Engine.\n\n1. In the Google Cloud console, go to the **ASP.NET Framework** Cloud Marketplace page.\n\n [Go to Cloud Marketplace](/console/marketplace/details/click-to-deploy-images/aspnet)\n2. Click **Launch**.\n\n3. Leave the settings set to their default values, and click **Deploy**.\n\n Wait for the Compute Engine instance to deploy. It usually\n takes about 5 minutes to deploy.\n4. To display resource information, click **VM instance**.\n\n5. To edit the VM instance, click **Manage Resource**.\n\n6. Click **Set Windows password**, and then make a note of the username.\n\n7. Copy the new Windows password, and then click **Close**.\n\n8. In the **VM instance details** page, make a note of the external IP address.\n\n9. On your local Windows machine, edit the file `HelloWorld/Properties/PublishProfiles/ComputeEngine.pubxml`.\n\n10. Enter your VM instance's external IP address between `\u003cMSDeployServiceURL\u003e`\n and `\u003c/MSDeployServiceURL\u003e`. For example, `\u003cMSDeployServiceURL\u003e203.0.113.22\u003c/MSDeployServiceURL\u003e`\n\n11. Enter the instance's username that you previously noted between `\u003cUserName\u003e` and `\u003c/UserName\u003e`.\n\n12. Save your changes to the `ComputeEngine.pubxml` file.\n\n13. In a PowerShell window, publish your app to the Compute Engine instance:\n\n ```\n dotnet publish -c Release `\n /p:PublishProfile=Properties\\PublishProfiles\\ComputeEngine.pubxml `\n \"/p:Password=YOUR-PASSWORD\"\n ```\n\n Replace \u003cvar translate=\"no\"\u003eYOUR-PASSWORD\u003c/var\u003e with the password you previously copied.\n14. Open a web browser to your instance's external IP address.\n\n In your web browser, you see some Hello World text, served from your\n Compute Engine instance.\n\n\u003cbr /\u003e\n\n### Manage and monitor an instance\n\nYou can use the Google Cloud console to monitor and manage your instance.\n\n1. To view all of the logs generated by your Compute Engine resources,\n go to the **Logs Explorer** page.\n\n [Go to Logs Explorer](https://console.cloud.google.com/logs/query;query=protoPayload.serviceName%3D'compute.googleapis.com')\n\n\n [Cloud Logging](/logging) is automatically configured to gather logs from\n various common services, including `syslog`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for the resources used in this\ntutorial, either delete the project that contains the resources, or keep the project and\ndelete the individual resources.\n\n### Delete the project\n\n| **Caution** : Deleting a project has the following effects:\n|\n| - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.\n| - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.\n|\n|\n| If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects\n| can help you avoid exceeding project quota limits.\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)\n2. In the project list, select the project that you want to delete, and then click **Delete**.\n3. In the dialog, type the project ID, and then click **Shut down** to delete the project.\n\n### Delete the individual resources\n\n```bash\ngcloud compute instances delete my-app-instance --zone=YOUR_ZONE --delete-disks=all\ngcloud compute firewall-rules delete default-allow-http-80\n```\n\nWhat's next\n-----------\n\n-\n\n Explore reference architectures, diagrams, and best practices about Google Cloud.\n Take a look at our\n [Cloud Architecture Center](/architecture).\n\n- For other .NET resources for building your apps, see the following:\n\n - Manage and monitor your Instance Group deployment at [Compute Engine \\\u003e Instance groups](https://console.cloud.google.com/compute/instanceGroups).\n - Manage your load balancing configuration, including URL maps and backend services, at [Network services \\\u003e Load balancing](https://console.cloud.google.com/net-services/loadbalancing/list).\n - [Deploy an app to Google Kubernetes Engine](/kubernetes-engine/docs/quickstarts/deploy-app-container-image)\n - Explore other [Google Cloud services](/)."]]