Step-by-Step Guide: Launching Your First Linux VM on Google Cloud Platform (GCP)

Step-by-Step Guide: Launching Your First Linux VM on Google Cloud Platform (GCP)

With additional step about Deleting a VM on Google Cloud Platform (GCP).

Introduction

Google Cloud Platform (GCP) provides a powerful infrastructure for running applications and storing data in the cloud. In this detailed step-by-step guide, I will walk you through the process of launching your first virtual machine (VM) with a Linux operating system on GCP. By following these instructions, you'll be able to set up your Linux VM and start harnessing the capabilities of GCP.

Steps

Step 1: Create a GCP Account:

  1. Visit the GCP website (https://cloud.google.com/) and sign up for a GCP account if you haven't already using your usual Google account/Gmail account.

  2. Follow the instructions to create your account, provide the necessary information and agree to the terms of service.

  3. Set up billing information to enable GCP services. You will be eligible for a free trial with initial 300 credits to explore GCP and Activate them.

Step 2: Set Up a New Project:

  1. After creating your GCP account, go to the GCP Console (https://console.cloud.google.com/).

  2. In the top navigation bar, click on the project drop-down and select "New Project."

  3. Enter a name for your project and click "Create."

  4. Select the desired billing account and associated resources for your project.

Step 3: Enable Compute Engine API:

  1. In the GCP Console, click on the project drop-down and select "APIs & Services" > "Library."

  2. Use the search bar to find "Compute Engine API" and click on it.

  3. Click the "Enable" button to enable the Compute Engine API for your project.

Step 4: Create a VM Instance:

  1. Navigate to the Compute Engine section in the GCP Console.

  2. Click on the "Create Instance" button to start configuring your VM instance.

  3. Provide a name for your instance.

  4. Choose the desired region and zone for your VM based on your requirements (e.g., us-central1 and us-central1-a).

  5. Select the machine type that suits your needs. The default should work for most use cases.

  6. Under "Boot Disk," click on "Change" to select the Linux distribution you want to use. Choose an image from the list, such as "Ubuntu" or "Debian."

  7. Set the desired boot disk size, keeping in mind the storage requirements of your applications.

  8. Configure the firewall settings by selecting "Allow HTTP traffic" or any other ports you need to open.

  9. Click on "Create" to create your VM instance.

Step 5: Connect to the Linux VM:

  1. Once the VM is created, you can connect to it using SSH.

  2. In the VM instances list in the GCP Console, click on the SSH button next to your VM instance.

  3. A terminal window will open, allowing you to interact with your Linux VM.

Step 6: Explore and Customize Your Linux VM:

  1. You are now connected to your Linux VM on GCP. You can install additional software, configure services, and perform any necessary setup based on your requirements.

  2. Use the package manager of your Linux distribution (e.g., apt-get for Ubuntu) to install applications and libraries.

  3. Configure your Linux VM to meet your specific needs, such as setting up user accounts, enabling security features, or installing additional software packages.

Step 7: Deleting a VM on Google Cloud Platform (GCP):

When you no longer need a VM on GCP, Follow these steps to delete a VM on GCP:

  1. In the VM instances list, locate the VM instance you want to delete.

  2. Check the box next to the VM instance select it.

  3. Click on the "Delete" button at the top of the page.

  4. A confirmation dialog box will appear, providing information about the resources that will be deleted along with the VM instance. Review the information to ensure you're deleting the correct VM instance.

  5. If you have any associated disks with the VM instance, you'll have the option to choose whether to keep or delete them. Make the appropriate selection based on your requirements.

  6. Click on the "Delete" button to initiate the deletion process.

  7. GCP will begin deleting the VM instance and any associated resources. The process may take a few moments to complete.

  8. Once the deletion is finished, the VM instance will be removed from your GCP project, and any associated resources will be released.

Conclusion

By following this step-by-step guide, you have successfully launched your first Linux virtual machine on the Google Cloud Platform (GCP). You can now explore the extensive capabilities of GCP, leverage the scalability and reliability of the cloud, and start building and deploying your applications with ease. Enjoy harnessing the power of GCP for your Linux-based projects!

Please share your thoughts and opinions on this topic in the comments section below.

The above information is up to my understanding and learning experience. Suggestions are always welcome.

~Abhiraj kharbade

#DevOps #GCP #Computeengine

Connect with me :

LinkedIn