Google Cloud Platform (GCP) is a popular choice for hosting applications and services due to its scalability, reliability, and global reach. By default, GCP virtual machine instances have most ports closed for security reasons. However, in certain scenarios, you might need to open specific ports to enable access to your applications. This guide will walk you through the process of opening port 8090 on Google Cloud, allowing you to access your application or service running on that port securely.
Prerequisites:
- A Google Cloud Platform account. If you don’t have one, sign up for a free trial at https://cloud.google.com/free.
- Basic familiarity with using the Google Cloud Console and working with virtual machines.
Step 2: Navigating to the Virtual Machine Instance
- In the Google Cloud Console, navigate to “Compute Engine” > “VM instances.”
- Identify the VM instance for which you want to open port 8090. If you haven’t created a VM instance yet, follow the steps to create one before proceeding.
Step 3: Editing the Firewall Rules To allow incoming traffic on port 8090, you need to create a firewall rule:
- Click on the name of the VM instance to open its details page.
- On the VM details page, scroll down to the “Firewall” section and click on “View network details.”
Step 4: Creating a Firewall Rule
- In the “Firewall rules” page, click on the “Create firewall rule” button.
- Provide a descriptive name for the new rule, such as “allow-port-8090.”
- Set the “Direction of traffic” to “Ingress” (incoming traffic).
- Under “Targets,” choose “Specified target tags” and add the tag corresponding to your VM instance. If your VM instance does not have any tags, you can create a new tag for it.
- In the “Source IP ranges” field, you can specify the IP ranges from which traffic will be allowed. For example, entering “0.0.0.0/0” will allow traffic from any IP address. Be cautious with this setting to avoid security risks.
- Under “Protocols and ports,” select “Specified protocols and ports.”
- In the “Protocol” dropdown, choose “TCP.”
- In the “Ports” field, enter “8090” (without quotes) to specify that the rule applies to port 8090.
- Review the rule configuration, ensuring it aligns with your security requirements, and click on the “Create” button to create the firewall rule.
Step 5: Verifying the Firewall Rule
- After creating the firewall rule, go back to the “VM instances” page and locate your VM instance.
- Click on the “Edit” button (pencil icon) for the VM instance.
- In the “Network tags” section, make sure that the tag you used in the firewall rule is associated with your VM instance.
- If you added the tag during the creation of the rule, it should already be associated with the VM. If not, add it now.
- Click on the “Save” button to apply the changes.
Step 6: Testing Port 8090 Access
- Now that port 8090 is open, you can access your application or service running on that port using the external IP address of your VM instance. Make sure that your application or service is running and listening on port 8090.
- Open a web browser and enter the following URL:
http://[external-ip]:8090
(replace[external-ip]
with the actual external IP address of your VM instance). - If everything is set up correctly, you should be able to access your application or service through port 8090.
Conclusion
Opening port 8090 on Google Cloud Platform allows incoming traffic to access your application or service running on a virtual machine instance. However, it’s crucial to consider security implications when opening ports. Always follow security best practices and limit access to trusted sources by specifying appropriate source IP ranges in the firewall rule.
By leveraging the power of Google Cloud Platform and its robust networking capabilities, you can ensure seamless and secure access to your applications while enjoying the benefits of cloud computing. As you continue to manage your cloud resources on GCP, explore additional features and services to optimize your cloud infrastructure and make the most of the cloud’s potential for your business needs. Happy cloud computing on Google Cloud!