Founder of Technical Potpourri, Co-Founder of Shrey Tech, Enterprise Cloud Architect
In Google Cloud, a Virtual Machine (VM) is a computing resource that emulates a physical computer within the cloud environment. It provides users with the ability to run applications and perform various computing tasks without the need for physical hardware.
In this blog post, I am going to share with you how you troubleshoot your server which is running on Google Cloud Virtual Machine.
Prerequisite – Create The Server Running On Google Cloud
I have a dedicated blog post where I have shown step-by-step approach to create your first server running on Google Cloud Virtual Machine. I highly recommend to go through that post to understand the basics first.
Here is the post
With that, let’s find out how to do the troubleshooting.
If you are seeing a Connection Refused error, it is possible that:
- You are trying to access the VM using an https address. Check that your URL is
- The VM instance does not have the proper tag that allows Compute Engine to apply the appropriate firewall rules to your instance. See Ensure that your VM instance has the correct tags below.
- Your project does not have a firewall rule that allows traffic to the external IP address for your instance. See Ensure that the correct firewall rule exists below.
Make Sure Virtual Machine Has The Correct Tags
In the Google Cloud console, go to the VM instances page.
Click the name of the instance that you are trying to connect to.
Click Edit at the top of the page.
Scroll down to Firewalls and make sure that Allow HTTP traffic is checked. If it is not checked, check it.
Save your changes. This ensures that the correct tags are added to the VM instance.
Make Sure Correct Firewall Rule Exists
- In the Google Cloud console, go to Firewall rules.
Look for a firewall rule that allows all IP ranges through tcp:80. Usually, this rule is named the
If a rule does not exist, create one.
Click Create firewall rule.
Enter a name for the rule, such as
Under Source IP ranges, enter 0.0.0.0/0 to allow traffic from all sources.
Under Protocols and ports, check Specified protocols and ports and enter tcp:80.
Create your firewall rule.
Test your server again by going to the external IP address of the instance.
This article is not endorsed by Salesforce, Google, or any other company in any way. I shared my knowledge on this topic in this blog post. Please always refer to Official Documentation for the latest information.