{"id":7844,"date":"2026-10-10T14:52:05","date_gmt":"2026-10-10T14:52:05","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=7844"},"modified":"2026-10-11T14:02:03","modified_gmt":"2026-10-11T14:02:03","slug":"creating-instance-in-vpc-network","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/","title":{"rendered":"Creating instance in VPC Network"},"content":{"rendered":"\r\n<h1><strong><b>How to Launch a VM Instance in a Custom VPC Network on Google Cloud<\/b><\/strong><\/h1>\r\n<p class=\"wp-block-paragraph\">When you create your first virtual machine in Google Cloud, it quietly lands in the default network. That is fine for a quick test, but real projects almost never stay there. Teams build their own Virtual Private Cloud, or VPC, network so they can choose the address ranges, separate environments such as development and production, and decide exactly which traffic is allowed in and out.<\/p>\r\n<p>A VPC network is made of subnets, and every virtual machine lives in one of them. That has two practical consequences. The machine must be created in the same region as the subnet it uses, and nothing can reach it until you create firewall rules that allow the traffic. A custom network starts closed. New users are often caught out by exactly this, when a machine they created looks perfectly healthy but cannot be reached.<\/p>\r\n<p>This guide takes you through the whole job. We first create a custom network and subnet, then launch a Compute Engine instance inside it using the console with every original screenshot kept in place. After that we add a firewall rule for SSH, connect to the machine to prove it works, repeat the setup with gcloud, and finish with troubleshooting, common mistakes and a short FAQ.<\/p>\r\n<h2><strong><b>Default Network or Custom Network?<\/b><\/strong><\/h2>\r\n<div style=\"width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px;\">\r\n<table style=\"width: 100%; min-width: 600px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.5; color: #1f2937;\"><caption style=\"caption-side: top; text-align: left; padding: 12px 14px; font-size: 18px; font-weight: bold; color: #0f2a4a;\">Default network vs custom mode network<\/caption>\r\n<thead>\r\n<tr style=\"background: #0f2a4a;\">\r\n<th style=\"padding: 12px 14px; text-align: left; color: #ffffff; font-weight: bold; border-bottom: 2px solid #0b1f38; width: 22%;\" scope=\"col\">Point<\/th>\r\n<th style=\"padding: 12px 14px; text-align: left; color: #ffffff; font-weight: bold; border-bottom: 2px solid #0b1f38; width: 39%;\" scope=\"col\">Default network<\/th>\r\n<th style=\"padding: 12px 14px; text-align: left; color: #ffffff; font-weight: bold; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Custom mode network<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr style=\"background: #ffffff;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top; border-bottom: 1px solid #e5e9f0;\" scope=\"row\">Subnets<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">One per region, created automatically<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Only the subnets you create<\/td>\r\n<\/tr>\r\n<tr style=\"background: #f5f8fc;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top; border-bottom: 1px solid #e5e9f0;\" scope=\"row\">Address ranges<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Chosen by Google<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Chosen by you<\/td>\r\n<\/tr>\r\n<tr style=\"background: #ffffff;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top; border-bottom: 1px solid #e5e9f0;\" scope=\"row\">Firewall rules<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">Includes rules allowing internal traffic, SSH and ping<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top; border-bottom: 1px solid #e5e9f0;\">No allow rules for incoming traffic until you create them<\/td>\r\n<\/tr>\r\n<tr style=\"background: #f5f8fc;\">\r\n<th style=\"padding: 12px 14px; text-align: left; font-weight: 600; vertical-align: top;\" scope=\"row\">Best for<\/th>\r\n<td style=\"padding: 12px 14px; vertical-align: top;\">Quick tests and learning<\/td>\r\n<td style=\"padding: 12px 14px; vertical-align: top;\">Production and anything that needs planned addressing<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\r\n<p>&nbsp;<\/p>\r\n<p><strong><b>My advice:<\/b><\/strong>\u00a0learn on a custom network from the start. It shows you exactly which rules your application needs, and Google&#8217;s own documentation says custom mode suits most production use.<\/p>\r\n<p><strong><b>Prerequisites:<\/b><\/strong><\/p>\r\n<ul>\r\n<li>A Google Cloud account with a project that has billing enabled.<\/li>\r\n<li>The Compute Engine API enabled.<\/li>\r\n<li>A role that can create networks, instances and firewall rules, such as Compute Admin and Network Admin.<\/li>\r\n<li>A custom VPC network with at least one subnet. If you do not have one, create it with the next section.<\/li>\r\n<\/ul>\r\n<h2><strong><b>Create a Custom VPC Network and Subnet<\/b><\/strong><\/h2>\r\n<p>In the console, open the navigation menu, choose VPC network, then VPC networks, and click <strong><b>Create VPC network<\/b><\/strong>. Name it, choose the Custom subnet creation mode, and add a subnet with a name, a region and an IP range such as 10.10.0.0\/24. Click <strong><b>Create<\/b><\/strong>.<\/p>\r\n<p>The same job in gcloud takes two commands:<\/p>\r\n<p>gcloud compute networks create my-vpc &#8211;subnet-mode=custom<\/p>\r\n<p>gcloud compute networks subnets create my-subnet &#8211;network=my-vpc &#8211;range=10.10.0.0\/24 &#8211;region=us-central1<\/p>\r\n<p>Remember the region you chose. Your virtual machine must be in the same one.<\/p>\r\n<h2><strong><b>Create a VM Instance in the VPC Network Using the Console<\/b><\/strong><\/h2>\r\n<p>Menu labels move from time to time, so use the wording below as a guide.<\/p>\r\n<p><strong>1.<\/strong> Open the Google Cloud console. Choose Compute Engine and then VM instances.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7845\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg\" alt=\"\" width=\"432\" height=\"336\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg 601w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7-300x234.jpg 300w\" sizes=\"auto, (max-width: 432px) 100vw, 432px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>2.<\/strong> Click Create instance.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"235\" class=\"wp-image-7846\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/8.jpg\" alt=\"\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/8.jpg 734w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/8-300x96.jpg 300w\" sizes=\"auto, (max-width: 734px) 100vw, 734px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>3.<\/strong> Give the instance a name. Choose the region that matches your subnet, and then any zone inside that region.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7847\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/9.jpg\" alt=\"\" width=\"455\" height=\"520\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/9.jpg 575w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/9-263x300.jpg 263w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>4.<\/strong> Under Firewall, tick Allow HTTP traffic and Allow HTTPS traffic if you plan to run a web server. These boxes add network tags, and you still need firewall rules in a custom network. We cover that below.<br \/><strong>5.<\/strong> Open the section called Advanced options, then Networking. In older consoles it is named Management, security, disks, networking, sole tenancy.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7848\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/10.jpg\" alt=\"\" width=\"391\" height=\"154\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/10.jpg 510w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/10-300x118.jpg 300w\" sizes=\"auto, (max-width: 391px) 100vw, 391px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>6.<\/strong> Under Network interfaces, select the VPC network and the subnetwork you created.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7849\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/11.jpg\" alt=\"\" width=\"497\" height=\"488\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/11.jpg 584w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/11-300x294.jpg 300w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>7.<\/strong> Click Done, then Create.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7850\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/12.jpg\" alt=\"\" width=\"428\" height=\"319\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/12.jpg 590w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/12-300x224.jpg 300w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>8.<\/strong> When the instance is ready, confirm that it is in the region you chose and has an internal IP address. It will show an external address too unless you turned it off.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7851\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/13.jpg\" alt=\"\" width=\"657\" height=\"169\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/13.jpg 956w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/13-300x77.jpg 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/13-768x198.jpg 768w\" sizes=\"auto, (max-width: 657px) 100vw, 657px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<h2><strong><b>Create a Firewall Rule to Allow SSH<\/b><\/strong><\/h2>\r\n<p class=\"wp-block-paragraph\">A custom network does not allow incoming connections until you say so. To connect over SSH, you need a rule for port 22.<\/p>\r\n<p><strong>1.<\/strong> Open the navigation menu, choose VPC network and then Firewall.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7856\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/14.jpg\" alt=\"\" width=\"441\" height=\"238\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/14.jpg 570w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/14-300x162.jpg 300w\" sizes=\"auto, (max-width: 441px) 100vw, 441px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>2.<\/strong> Click Create firewall rule.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7857\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/15.jpg\" alt=\"\" width=\"468\" height=\"188\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/15.jpg 663w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/15-300x121.jpg 300w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>3.<\/strong> Enter a name, such as allow-ssh-my-vpc, and select your custom VPC network.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7858\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/16.jpg\" alt=\"\" width=\"457\" height=\"438\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/16.jpg 673w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/16-300x288.jpg 300w\" sizes=\"auto, (max-width: 457px) 100vw, 457px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>4.<\/strong> Choose the direction of traffic. Ingress controls connections coming in to your machines, and egress controls connections going out. For SSH you want ingress.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7859\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/16a.jpg\" alt=\"\" width=\"395\" height=\"231\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/16a.jpg 690w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/16a-300x176.jpg 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><br \/><strong>5.<\/strong> Set the targets to all instances in the network, or to a specific network tag. Enter the source IP ranges. Under Protocols and ports, choose TCP and enter port 22. Click Create.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7860\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/17.jpg\" alt=\"\" width=\"401\" height=\"469\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/17.jpg 665w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/17-256x300.jpg 256w\" sizes=\"auto, (max-width: 401px) 100vw, 401px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong><b>Security note:<\/b><\/strong>\u00a0the source range decides who can try to log in. The range 0.0.0.0\/0 means the whole internet, which invites constant automated login attempts. Use your own office or home address range, or use Identity-Aware Proxy, which needs the source range 35.235.240.0\/20, so that no machine has SSH open to everyone.<\/p>\r\n<h2><strong><b>Connect With SSH to Test the Network<\/b><\/strong><\/h2>\r\n<p><strong>1.<\/strong> Go back to Compute Engine and VM instances.<\/p>\r\n<p><strong>2.<\/strong> Click <strong><b>SSH<\/b><\/strong>next to your new instance.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-7861\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/18-1024x197.jpg\" alt=\"\" width=\"726\" height=\"139\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/18-1024x197.jpg 1024w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/18-300x58.jpg 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/18-768x147.jpg 768w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/18-1200x230.jpg 1200w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/18.jpg 1287w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/figure>\r\n<\/div>\r\n\r\n\r\n\r\n<p class=\"wp-block-paragraph\"><strong>3.<\/strong> A browser window opens and connects. If you reach a command prompt, the machine is running inside your VPC network and your firewall rule works.<\/p>\r\n\r\n\r\n\r\n<div class=\"wp-block-image\">\r\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"842\" height=\"326\" class=\"wp-image-7862\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/19.jpg\" alt=\"\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/19.jpg 842w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/19-300x116.jpg 300w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/19-768x297.jpg 768w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><\/figure>\r\n<h2><strong><b>Do It With gcloud<\/b><\/strong><\/h2>\r\n<p>Create the instance in your subnet:<\/p>\r\n<p>gcloud compute instances create vpc-vm &#8211;zone=us-central1-a &#8211;subnet=my-subnet &#8211;tags=allow-ssh<\/p>\r\n<p>Create the firewall rule, targeting only machines with that tag:<\/p>\r\n<p>gcloud compute firewall-rules create allow-ssh-my-vpc &#8211;network=my-vpc &#8211;direction=INGRESS &#8211;action=allow &#8211;rules=tcp:22 &#8211;source-ranges=35.235.240.0\/20 &#8211;target-tags=allow-ssh<\/p>\r\n<p>Replace the source range with your own address range if you are not using Identity-Aware Proxy. Then connect:<\/p>\r\n<p>gcloud compute ssh vpc-vm &#8211;zone=us-central1-a<\/p>\r\n<p>If you want a web server on this machine, create a second rule allowing TCP ports 80 and 443 in the same way.<\/p>\r\n<h2><strong><b>When SSH Does Not Connect<\/b><\/strong><\/h2>\r\n<ul>\r\n<li><b><\/b><strong><b>No rule for port 22.<\/b><\/strong>This is the most common cause in a custom network. Create the ingress rule.<\/li>\r\n<li><b><\/b><strong><b>Rule targets the wrong tag.<\/b><\/strong>Check that the tag on the machine matches the tag in the rule.<\/li>\r\n<li><b><\/b><strong><b>Rule on the wrong network.<\/b><\/strong>The rule must belong to the same VPC network as the machine.<\/li>\r\n<li><b><\/b><strong><b>Source range does not include you.<\/b><\/strong>Your current address must fall inside the range.<\/li>\r\n<li><b><\/b><strong><b>No external address.<\/b><\/strong>A machine without one cannot be reached directly from the internet. Use Identity-Aware Proxy or a bastion host.<\/li>\r\n<\/ul>\r\n<h2><strong><b>Common Mistakes to Avoid<\/b><\/strong><\/h2>\r\n<ul>\r\n<li><b><\/b><strong><b>Choosing a region without a subnet.<\/b><\/strong>You cannot create instances in a region that has no subnet in your network.<\/li>\r\n<li><b><\/b><strong><b>Trusting the HTTP and HTTPS boxes.<\/b><\/strong>In a custom network they add tags only. Create the rules.<\/li>\r\n<li><b><\/b><strong><b>Opening SSH to the whole internet.<\/b><\/strong>Use a narrow range or Identity-Aware Proxy.<\/li>\r\n<li><b><\/b><strong><b>Copying commands with curly quotes or a long dash.<\/b><\/strong>Pasting from a web page can change the double dash before a flag into a single long character. Type the flags by hand if a command fails oddly.<\/li>\r\n<li><b><\/b><strong><b>Leaving test machines running.<\/b><\/strong>Delete the instance and the network when you finish, to avoid charges.<\/li>\r\n<\/ul>\r\n<p>You now have a custom network, a machine inside it and a firewall rule that lets you connect. From here, try adding a second subnet in another region, or a web server with its own narrow rule for ports 80 and 443.<\/p>\r\n<\/div>\r\n","protected":false},"excerpt":{"rendered":"<p>How to Launch a VM Instance in a Custom VPC Network on Google Cloud When you create your first virtual machine in Google Cloud, it quietly lands in the default network. That is fine for a quick test, but real projects almost never stay there. Teams build their own Virtual Private Cloud, or VPC, network [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,1640],"tags":[766,605,699,700,711,617,683,684,685,611,764],"class_list":["post-7844","post","type-post","status-publish","format-standard","hentry","category-google-cloud-platform","category-networking","tag-cloud-vpc-network","tag-gcp","tag-gcp-certification","tag-gcp-cloud-console","tag-gcp-instance","tag-google-cloud","tag-google-cloud-certification","tag-google-cloud-console","tag-google-cloud-courses","tag-google-cloud-platform","tag-vpc-networks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Launch a VM Instance in a Custom VPC Network<\/title>\n<meta name=\"description\" content=\"Create a custom VPC network and subnet, launch a Compute Engine VM inside it, add a firewall rule for SSH, and fix the common reasons connections fail.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Launch a VM Instance in a Custom VPC Network\" \/>\n<meta property=\"og:description\" content=\"Create a custom VPC network and subnet, launch a Compute Engine VM inside it, add a firewall rule for SSH, and fix the common reasons connections fail.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-10T14:52:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-11T14:02:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"601\" \/>\n\t<meta property=\"og:image:height\" content=\"468\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/\",\"url\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/\",\"name\":\"How to Launch a VM Instance in a Custom VPC Network\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg\",\"datePublished\":\"2026-10-10T14:52:05+00:00\",\"dateModified\":\"2026-10-11T14:02:03+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Create a custom VPC network and subnet, launch a Compute Engine VM inside it, add a firewall rule for SSH, and fix the common reasons connections fail.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg\",\"width\":601,\"height\":468},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating instance in VPC Network\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Launch a VM Instance in a Custom VPC Network","description":"Create a custom VPC network and subnet, launch a Compute Engine VM inside it, add a firewall rule for SSH, and fix the common reasons connections fail.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/","og_locale":"en_US","og_type":"article","og_title":"How to Launch a VM Instance in a Custom VPC Network","og_description":"Create a custom VPC network and subnet, launch a Compute Engine VM inside it, add a firewall rule for SSH, and fix the common reasons connections fail.","og_url":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2026-10-10T14:52:05+00:00","article_modified_time":"2026-10-11T14:02:03+00:00","og_image":[{"width":601,"height":468,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg","type":"image\/jpeg"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/","url":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/","name":"How to Launch a VM Instance in a Custom VPC Network","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg","datePublished":"2026-10-10T14:52:05+00:00","dateModified":"2026-10-11T14:02:03+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Create a custom VPC network and subnet, launch a Compute Engine VM inside it, add a firewall rule for SSH, and fix the common reasons connections fail.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2021\/04\/7.jpg","width":601,"height":468},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/google-cloud-platform\/networking\/creating-instance-in-vpc-network\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Creating instance in VPC Network"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/7844","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=7844"}],"version-history":[{"count":12,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/7844\/revisions"}],"predecessor-version":[{"id":11947,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/7844\/revisions\/11947"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=7844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=7844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=7844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}