{"id":11888,"date":"2025-09-25T16:32:45","date_gmt":"2025-09-25T07:32:45","guid":{"rendered":"https:\/\/sreake.com\/?p=11888"},"modified":"2026-02-10T16:15:28","modified_gmt":"2026-02-10T07:15:28","slug":"use-google-cloud-workstations-like-a-pro","status":"publish","type":"post","link":"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/","title":{"rendered":"Use Google Cloud Workstations like a Pro!"},"content":{"rendered":"\n<p>Hi! I\u2019m Amine Ilidrissi (<a href=\"https:\/\/x.com\/realaminevg\">@realaminevg<\/a>) from the Sreake team.<\/p>\n\n\n\n<p>These days, I mainly do client work, which means I have to think a lot about security and onboarding.<\/p>\n\n\n\n<p>When developing locally, it can be difficult to ensure everyone on my team uses a secure development environment, and that every new team member gets started quickly.<\/p>\n\n\n\n<p>This is where <strong>Google Cloud Workstations<\/strong> come in. Built for security and replicability, we use them a lot and couldn\u2019t be happier with them.<\/p>\n\n\n\n<p>In this article, we\u2019ll cover:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>What Google Cloud Workstations are, and why use them<\/li><li>How to set up your own Cloud Workstation<\/li><li>How to connect to your Cloud Workstation, either from your browser or your local IDE<\/li><\/ul>\n\n\n\n<p>We\u2019ll also go beyond the official documentation! I\u2019ll show you a quick way of starting your Cloud Workstation from your local IDE. Strap in!<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_75 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#What_are_Google_Cloud_Workstations_and_why_use_them\" >What are Google Cloud Workstations and why use them?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Set_up_your_own_Cloud_Workstation\" >Set up your own Cloud Workstation<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Step_1_Create_a_workstation_cluster\" >Step 1: Create a workstation cluster<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Step_2_Create_a_workstation_configuration\" >Step 2: Create a workstation configuration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Step_3_Create_a_workstation\" >Step 3: Create a workstation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Connect_to_your_Cloud_Workstation\" >Connect to your Cloud Workstation<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#From_your_browser\" >From your browser<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#From_your_local_IDE\" >From your local IDE<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Start_your_Cloud_Workstation_from_your_local_IDE\" >Start your Cloud Workstation from your local IDE<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Step_1_Automate_the_whole_process_using_a_script\" >Step 1: Automate the whole process using a script<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Step_2_Change_SSH_settings\" >Step 2: Change SSH settings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Step_3_Start_and_connect_to_the_workstation\" >Step 3: Start and connect to the workstation<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/sreake.com\/en\/blog\/use-google-cloud-workstations-like-a-pro\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_are_Google_Cloud_Workstations_and_why_use_them\"><\/span>What are Google Cloud Workstations and why use them?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s look at <a href=\"https:\/\/cloud.google.com\/workstations\">the official explanation<\/a> for Google Cloud Workstations:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote has-gray-100-background-color is-layout-flow wp-block-quote-is-layout-flow\"><p>Fully managed development environments built to meet the needs of security-sensitive enterprises. <em>[Google Cloud Workstations]<\/em> enhances the security of development environments while accelerating developer onboarding and productivity, including a native integration with Gemini for Google Cloud.<\/p><\/blockquote>\n\n\n\n<p>What this means is:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>You get a <strong>secure<\/strong> development environment that you can log on to from anywhere.<\/li><li><strong>Everyone<\/strong> gets that same development environment.<\/li><li>You can use <strong>Gemini<\/strong> in your development environment for AI-powered development.<\/li><\/ul>\n\n\n\n<p>In a way, this is similar to other products such as <a href=\"https:\/\/github.com\/features\/codespaces\">Github Codespaces<\/a> or Google\u2019s own <a href=\"https:\/\/firebase.studio\/\">Firebase Studio<\/a>. The difference lies, then, in <strong>customization<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Setting your instance type beyond a few presets<\/li><li>Securing your team\u2019s environment through IAM<\/li><li>Using code editors other than the default one (often only available in the browser)<\/li><li>And a lot more!<\/li><\/ul>\n\n\n\n<p>Other products offer an out-of-the-box experience that helps you get started quickly, but the above customizations are simply out of the question.<\/p>\n\n\n\n<p>Google Cloud Workstations, on the other hand, takes a bit longer to get started, but lets you <strong>completely<\/strong> customize your environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Set_up_your_own_Cloud_Workstation\"><\/span>Set up your own Cloud Workstation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Ready to have your very own Google Cloud Workstation? We\u2019ll guide you through the steps of setting up a workstation cluster and a workstation configuration, then you\u2019ll be able to create a workstation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Make sure you have a GCP account and project set up.<\/li><li>Make sure you enable the <a href=\"https:\/\/console.cloud.google.com\/flows\/enableapi?apiid=workstations.googleapis.com\">Cloud Workstations API<\/a>.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Create_a_workstation_cluster\"><\/span>Step 1: Create a workstation cluster<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A <a href=\"https:\/\/cloud.google.com\/workstations\/docs\/architecture#workstation_cluster\">workstation cluster<\/a> manages multiple workstations in a Google Cloud region. You will only have to create a cluster once per region.<\/p>\n\n\n\n<p>Go to the <a href=\"https:\/\/console.cloud.google.com\/workstations\/clusters\">Cloud Workstations Cluster Management<\/a> page and create a new cluster; we\u2019ll call it \u201ctest-cluster\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"276\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-1-1024x276.png\" alt=\"\" class=\"wp-image-11911\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-1-1024x276.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-1-300x81.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-1-768x207.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-1.png 1052w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Create a new cluster<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"638\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-2-1024x638.png\" alt=\"\" class=\"wp-image-11912\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-2-1024x638.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-2-300x187.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-2-768x478.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-2.png 1124w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Name your cluster test-cluster<\/figcaption><\/figure>\n\n\n\n<p>Wait for your cluster to be created; this can take up to 20 minutes!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Create_a_workstation_configuration\"><\/span>Step 2: Create a workstation configuration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>A <a href=\"https:\/\/cloud.google.com\/workstations\/docs\/create-configuration\">workstation configuration<\/a> is a template for your workstation. It allows you to uniformly set machine types, disk size, container images, etc. across your team.<\/p>\n\n\n\n<p>For the sake of simplicity, we\u2019ll go with the default settings, but feel free to consult <a href=\"https:\/\/cloud.google.com\/workstations\/docs\/create-configuration\">the documentation<\/a> for more options!<\/p>\n\n\n\n<p>To create a new configuration, go to the <a href=\"https:\/\/console.cloud.google.com\/workstations\/configurations\">Cloud Workstations Configuration<\/a> page and press the \u201cCreate\u201d button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"275\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-3-1024x275.png\" alt=\"\" class=\"wp-image-11915\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-3-1024x275.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-3-300x81.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-3-768x206.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-3.png 1086w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Create a new configuration<\/figcaption><\/figure>\n\n\n\n<p>We\u2019ll call our configuration \u201ctest-configuration\u201d and use the cluster we\u2019ve created previously (test-cluster).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"767\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-4-1024x767.png\" alt=\"\" class=\"wp-image-11916\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-4-1024x767.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-4-300x225.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-4-768x575.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-4.png 1068w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Use the cluster you\u2019ve created previously<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Create_a_workstation\"><\/span>Step 3: Create a workstation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You\u2019re now ready to create your workstation!<\/p>\n\n\n\n<p>Press the \u201cCreate Workstation\u201d button on the <a href=\"https:\/\/console.cloud.google.com\/workstations\/list\">Cloud Workstations List<\/a> page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"275\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-5-1024x275.png\" alt=\"\" class=\"wp-image-11919\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-5-1024x275.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-5-300x80.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-5-768x206.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-5.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Create a new workstation<\/figcaption><\/figure>\n\n\n\n<p>Name your workstation \u201ctest-workstation\u201d, and use the configuration you\u2019ve created previously (test-configuration).<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-6-1024x464.png\" alt=\"\" class=\"wp-image-11920\"\/><figcaption>Use the configuration you\u2019ve created previously<\/figcaption><\/figure>\n\n\n\n<p>Press the Create button and your workstation will now be created! \ud83c\udf89<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"876\" height=\"554\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-7.png\" alt=\"\" class=\"wp-image-11921\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-7.png 876w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-7-300x190.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-7-768x486.png 768w\" sizes=\"auto, (max-width: 876px) 100vw, 876px\" \/><figcaption>Your workstation is created and ready to be started!<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connect_to_your_Cloud_Workstation\"><\/span>Connect to your Cloud Workstation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Let\u2019s go through how to connect to your Cloud Workstation, either through your browser or your local IDE.<\/p>\n\n\n\n<p>We first have to start the workstation by pressing the \u201cStart\u201d button on the <a href=\"https:\/\/console.cloud.google.com\/workstations\/list\">Cloud Workstations List<\/a> page. The workstation should then show up as started.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"560\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-8.png\" alt=\"\" class=\"wp-image-11929\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-8.png 852w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-8-300x197.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-8-768x505.png 768w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><figcaption>You can now connect to your workstation!<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"From_your_browser\"><\/span>From your browser<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Press the \u201cLaunch\u201d button that just popped up when you started your workstation:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"852\" height=\"560\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-9.png\" alt=\"\" class=\"wp-image-11930\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-9.png 852w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-9-300x197.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-9-768x505.png 768w\" sizes=\"auto, (max-width: 852px) 100vw, 852px\" \/><figcaption>Press the \u201cLaunch\u201d button to connect to your workstation<\/figcaption><\/figure>\n\n\n\n<p>A code editor should now launch on your browser. If this looks familiar, that\u2019s because this editor is based on Code-OSS, the open source version of VSCode!<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-10-1024x583.png\" alt=\"\" class=\"wp-image-11931\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-10-1024x583.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-10-300x171.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-10-768x437.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-10-1536x875.png 1536w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-10-2048x1166.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Your browser-based code editor<\/figcaption><\/figure>\n\n\n\n<p>From here, you can clone repositories, execute programs, etc. just as you would on a regular machine!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"From_your_local_IDE\"><\/span>From your local IDE<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>If you prefer, you can also connect to your workstation through your local IDE! Let\u2019s go through <a href=\"https:\/\/cloud.google.com\/workstations\/docs\/develop-code-using-local-vscode-editor\">the official documentation<\/a> to get started.<\/p>\n\n\n\n<p>(We will only be covering VS Code-based editors, but you can also use <a href=\"https:\/\/cloud.google.com\/workstations\/docs\/develop-code-using-local-jetbrains-ides\">JetBrains IDEs<\/a>!)<\/p>\n\n\n\n<p>Make sure you\u2019ve gone through the following steps first:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Start your workstation.<\/li><li>Install the <a href=\"https:\/\/cloud.google.com\/sdk\/docs\/install\">gcloud CLI<\/a>.<\/li><li>Install the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ms-vscode-remote.remote-ssh\">Remote &#8211; SSH<\/a> VS Code extension locally.<\/li><\/ul>\n\n\n\n<p>To begin, let\u2019s look up your workstation name. You can do so by clicking on the \u201cSee details\u201d link on the <a href=\"https:\/\/console.cloud.google.com\/workstations\/list\">Cloud Workstations List<\/a> page:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"780\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-11.png\" alt=\"\" class=\"wp-image-11932\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-11.png 964w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-11-300x243.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-11-768x621.png 768w\" sizes=\"auto, (max-width: 964px) 100vw, 964px\" \/><figcaption>Click the \u201cSee details\u201d link to look up your workstation name<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"1020\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-12-1024x1020.png\" alt=\"\" class=\"wp-image-11933\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-12-1024x1020.png 1024w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-12-300x300.png 300w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-12-768x765.png 768w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-12.png 1110w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Copy your workstation name as we\u2019ll use it later<\/figcaption><\/figure>\n\n\n\n<p>Next, execute the following command: (don\u2019t forget to put in your workstation name!)<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>gcloud workstations start-tcp-tunnel --local-host-port=:9998 &lt;YOUR_WORKSTATION_NAME&gt; 22\n<\/code><\/pre>\n\n\n\n<p>This will open a TCP tunnel on port 9998 from your local machine to your workstation. If everything goes well, you should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>Listening on port &#91;9998].\n<\/code><\/pre>\n\n\n\n<p>You can now use this TCP tunnel to connect to your workstation from your local IDE! Follow the VS Code instructions on <a href=\"https:\/\/code.visualstudio.com\/docs\/remote\/ssh#_connect-to-a-remote-host\">connecting to a remote host<\/a>, and enter <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">user@localhost:9998<\/span><\/span><\/code> as the remote host.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Start_your_Cloud_Workstation_from_your_local_IDE\"><\/span>Start your Cloud Workstation from your local IDE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>We\u2019ve covered how to connect to your workstation through your local IDE. But what if there was a better way?<\/p>\n\n\n\n<p>Right now, you need to go through <strong>three steps<\/strong> to connect to your workstation:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Start your workstation from the <a href=\"https:\/\/console.cloud.google.com\/workstations\/list\">Cloud Workstations List<\/a> page<\/li><li>Execute the <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">gcloud workstations start-tcp-tunnel<\/span><\/span><\/code> command on your terminal<\/li><li><a href=\"https:\/\/code.visualstudio.com\/docs\/remote\/ssh#_connect-to-a-remote-host\">Connect to your workstation<\/a> through your local IDE<\/li><\/ol>\n\n\n\n<p>Three steps may not seem like much, but another problem is that you need to operate on three different programs: your web browser, your terminal, and your IDE! And everyone knows <a href=\"https:\/\/www.atlassian.com\/blog\/loom\/cost-of-context-switching\">context switching is never great<\/a>.<\/p>\n\n\n\n<p>To solve this, let\u2019s go beyond the official documentation and automate the whole process! You\u2019ll then be able to connect to your workstation in <strong>one simple step<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Automate_the_whole_process_using_a_script\"><\/span>Step 1: Automate the whole process using a script<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here\u2019s a script that automates the whole process of starting the workstation and creating the TCP tunnel. Put it in your SSH configuration directory. We\u2019ll assume you put it in <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">~\/.ssh\/workstation-startup.sh<\/span><\/span><\/code> .<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>GCP_WORKSTATION_NAME=\"$1\"\nGCP_TUNNEL_HOST=\"$2\"\nGCP_TUNNEL_PORT=\"$3\"\n\ntrap 'kill \"$jpid\" 2&gt;\/dev\/null' EXIT\n\n&gt;&amp;2 echo \"Starting server...\"\n\ngcloud workstations start $GCP_WORKSTATION_NAME 2&gt; \/dev\/null\n\n&gt;&amp;2 echo \"Server is ready!\"\n\n&gt;&amp;2 echo \"Starting TCP tunnel...\"\n\ngcloud workstations start-tcp-tunnel --local-host-port=$GCP_TUNNEL_HOST:$GCP_TUNNEL_PORT $GCP_WORKSTATION_NAME 22 2&gt; \/dev\/null &amp;\njpid=\"$!\"\n\nuntil nc -z $GCP_TUNNEL_HOST $GCP_TUNNEL_PORT 2&gt;\/dev\/null; do\n    sleep 1\ndone\n\n&gt;&amp;2 echo \"Started tunnel on host $GCP_TUNNEL_HOST and port $GCP_TUNNEL_PORT\"\n\nnc $GCP_TUNNEL_HOST $GCP_TUNNEL_PORT\n<\/code><\/pre>\n\n\n\n<p>Let\u2019s go through what this script does:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Starts the workstation (<code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">gcloud workstations start<\/span><\/span><\/code>).<\/li><li>Opens a TCP tunnel in the background (<code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">gcloud workstations start-tcp-tunnel<\/span><\/span><\/code>).<\/li><li>Waits until the TCP tunnel is open by polling it every second (<code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">until nc ...<\/span><\/span><\/code>).<\/li><li>Using the netcat (<code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">nc<\/span><\/span><\/code>) command to forward the TCP connection to SSH.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Change_SSH_settings\"><\/span>Step 2: Change SSH settings<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>You will need to use this script when connecting to your workspace. Open your SSH configuration (usually at <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">~\/.ssh\/config<\/span><\/span><\/code> ) and add the following block:<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>Host gcp-cloud-workstation # Any host name is fine\n  HostName localhost\n  Port 9998 # Any port is fine\n  User user\n  StrictHostKeyChecking no\n  UserKnownHostsFile \/dev\/null\n  ConnectTimeout 0\n  ProxyCommand sh ~\/.ssh\/workstation-startup.sh \"&lt;YOUR_WORKSTATION_NAME&gt;\" %h %p # Change to your workstation name\n<\/code><\/pre>\n\n\n\n<p>We use the <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">ProxyCommand<\/span><\/span><\/code> directive to run our script. Don\u2019t forget to put <a href=\"#From_your_local_IDE\" title=\"\">your workstation name<\/a> in!<\/p>\n\n\n\n<div class=\"wp-block-group has-gray-200-background-color is-vertical is-content-justification-left is-layout-flex wp-container-core-group-is-layout-41619b2b wp-block-group-is-layout-flex\">\n<p>\ud83d\udca1 <strong>Why are we using the <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">StrictHostKeyChecking<\/span><\/span><\/code> and <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">UserKnownHostsFile<\/span><\/span><\/code> directives?<\/strong><\/p>\n\n\n\n<p class=\"has-text-align-left\">The SSH host keys change whenever we start our workstation. This means that if we don\u2019t use the above directives, the below warning pops up, and we won\u2019t be able to connect to the workstation.<\/p>\n\n\n\n<pre class=\"wp-block-code code-block\"><code>@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\nSomeone could be eavesdropping on you right now (man-in-the-middle attack)!\nIt is also possible that a host key has just been changed.\n<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-left\">As we are starting a TCP tunnel on localhost, we can safely use the <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">StrictHostKeyChecking<\/span><\/span><\/code> and <code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">UserKnownHostsFile<\/span><\/span><\/code> directives, and ignore the above warning.<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Start_and_connect_to_the_workstation\"><\/span>Step 3: Start and connect to the workstation<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>We can now start and connect to the workstation in one simple step! Just select the SSH host you\u2019ve added earlier (<code><span style=\"color:#ef7133\" class=\"tadv-color\"><span style=\"background-color:#e9edf1\" class=\"tadv-background-color\">gcp-test-workstation<\/span><\/span><\/code> ), and the editor will start the workstation, start the TCP tunnel and connect to the workstation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"586\" height=\"265\" src=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-13.png\" alt=\"\" class=\"wp-image-11940\" srcset=\"https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-13.png 586w, https:\/\/sreake.com\/wp-content\/uploads\/2025\/09\/image-13-300x136.png 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><figcaption>Connect to the SSH host you\u2019ve added earlier<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Hey, you\u2019ve made it this far!<\/p>\n\n\n\n<p>As we\u2019ve seen, Google Cloud Workstations are a really great solution for secure, replicable development environments. You can spend less time worrying about securing data or onboarding new team members!<\/p>\n\n\n\n<p>Whether you like coding in your browser or on your local IDE, I hope this article has inspired you to try Google Cloud Workstations.<\/p>\n\n\n\n<p>Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi! I\u2019m Amine Ilidrissi (@realaminevg) from the Sreake team. These days, I mainly do client work, which means I have to think a lot about security and onboarding. When developing locally, it can be difficult to ensure everyone on my team uses a secure development environment, and that every new team member gets started quickly. [&hellip;]<\/p>\n","protected":false},"author":45,"featured_media":11950,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_locale":"en_US","_original_post":"https:\/\/sreake.com\/?p=11888","footnotes":""},"categories":[17],"tags":[48,14,23],"class_list":["post-11888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-google-cloud","tag-sre","tag-enginner-blog","en-US"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts\/11888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/comments?post=11888"}],"version-history":[{"count":1,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts\/11888\/revisions"}],"predecessor-version":[{"id":13489,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/posts\/11888\/revisions\/13489"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/media\/11950"}],"wp:attachment":[{"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/media?parent=11888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/categories?post=11888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sreake.com\/wp-json\/wp\/v2\/tags?post=11888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}