Creating a VPS on Google Cloud: 4 Steps from an Empty Account to an Active Server

The process is simpler than you might think — but there are several security details, such as SSH keys and firewall rules, that beginners often overlook.

Google Cloud Platform (GCP) provides Compute Engine as a service for creating Virtual Private Servers (VPS) — virtual machines with full control, flexibility, and high performance running on Google’s global infrastructure. This guide walks you through the complete process of creating a VPS on GCP, from setting up an account to accessing an active server, along with practical tips for keeping costs and security under control from the start.

Unlike traditional VPS services that typically provide shell access within minutes after payment, GCP adds several configuration layers, including projects, networking, and IAM. These can initially feel more complicated for beginners, but they provide much greater control and scalability once you become familiar with the workflow.

$300Free trial credit for new accounts (90 days)
SSH KeyA more secure login method than passwords
4 StepsFrom an empty account to an active server
MinutesTypical time for an instance to become ready after creation
  1. Step 1: Create a Google Cloud Account

    Visit the official Google Cloud website and click “Get Started,” then sign in with an existing Google account or create a new one. You will be asked to provide basic information, including payment details. However, new accounts are not automatically charged because they receive free trial credits worth $300 for 90 days. After completing identity verification, including your phone number and payment method, you will gain access to the Google Cloud dashboard.

  2. Step 2: Set Up an SSH Key

    An SSH key provides an additional layer of security for logging into your VPS without relying on a password that could be guessed or compromised. On Linux/macOS, open a terminal and run ssh-keygen, then follow the prompts to choose a storage location and passphrase. The generated files are typically stored in the ~/.ssh directory. On Windows, you can use PuTTYgen, which is part of the PuTTY suite, to generate a similar key pair. Once the key has been created, add the public key to your GCP account through the Metadata settings or directly when creating the instance so it can be used for login.

  3. Step 3: Create an Instance in Compute Engine

    Sign in to Google Cloud Console, open Compute Engine, select VM Instances, and click Create. Give your instance a unique name, choose the CPU and RAM configuration based on your workload, starting with the cost-efficient E2 family for lightweight needs and moving to N4/C4 families for heavier workloads. Then select the boot disk and operating system image, such as Ubuntu, Debian, or another supported option. Configure the network and firewall rules, and add the SSH key you created earlier. Click Create to finish — the instance should become available within a few minutes.

  4. Step 4: Access the Instance and Manage Costs

    Once the instance is running, access it via SSH using a terminal or a client such as PuTTY. Obtain the instance’s public IP address and use the appropriate SSH command. Google Cloud Console also provides a built-in SSH button that opens a terminal directly in your browser without requiring an additional client setup. For beginners, it is recommended to start with a small instance so you can learn how VPS hosting works on GCP without taking on unnecessary costs, while regularly monitoring CPU, RAM, disk, and network usage through Cloud Monitoring.

Faster Alternative: gcloud CLI

In addition to the web-based Console, you can create an instance using gcloud CLI, the official Google Cloud command-line tool, with a single command, for example gcloud compute instances create instance-name --zone=asia-southeast2-a --machine-type=e2-small. This method is faster for users who are already comfortable with the command line and is particularly useful when you need to create multiple instances repeatedly with similar configurations, which can also be automated through scripts.

Additional Security Notes

  • Consider using OS Login as an alternative to manually managing SSH keys. This feature manages SSH access through Google Cloud IAM, making access management easier across multiple instances.
  • Restrict firewall rules to only the ports that are actually required, such as 22 for SSH and 80/443 for web servers. Do not leave all ports open.
  • Enable budget alerts in Google Cloud Console so you receive notifications before spending exceeds your expectations.

To better understand machine specification options, read Google Cloud VPS: Understanding Compute Engine, or compare it with other GCP hosting options in How to Host a Website on GCP.

FAQ

Is it mandatory to enter payment card details when creating a GCP account?

Yes, payment method verification is required even when using the free trial credits. This is primarily for identity verification and abuse prevention; it does not mean you are immediately charged.

Is an SSH key mandatory, or can I use a password instead?

Compute Engine supports password-based login for some operating system images, but SSH keys are strongly recommended because they are considerably more secure and are an industry standard for server access.

How long does it take for a VPS to become ready?

It usually takes only a few minutes after you click Create, depending on the selected boot disk size, operating system image, and other configuration factors.

What happens if I forget to shut down an unused instance?

An instance that continues running will continue to incur charges based on its configuration. Always stop or delete instances that are no longer being used, and configure budget alerts to help prevent unexpected charges.

Can I create a VPS on GCP without using the command line at all?

Yes. Everything described in this guide can be completed through the web-based Google Cloud Console without using the command line. The gcloud CLI is simply a faster alternative for users who are comfortable with command-line tools.

Common Mistakes to Avoid

  • Storing your SSH private key carelessly — the private key must remain secret on your device. Only the public key should be added to GCP.
  • Opening all firewall ports “to make things easier” — this can expose your server to brute-force attacks and other threats. Only open ports that are genuinely required.
  • Choosing an oversized machine configuration from the beginning — start small and upgrade according to actual needs after monitoring resource usage for several days.
  • Forgetting to set a budget alert — without spending notifications, you may be surprised when the monthly bill is much higher than expected.

Conclusion

Creating a VPS on Google Cloud Platform is relatively straightforward even for beginners. The four main steps are creating an account, setting up an SSH key, creating a Compute Engine instance, and then accessing and monitoring the server. What separates efficient users from inefficient ones is not necessarily technical skill, but discipline in managing two key areas: security, by using SSH keys and restricting firewall access, and costs, by starting with a small instance, monitoring resource usage, and stopping unused instances. Once you are comfortable with this basic workflow, you can explore gcloud CLI and other automation features to make your future cloud management tasks faster and more efficient.

Share:

Leave a Reply

Your email address will not be published. Required fields are marked *