ToDo:
- [x]
- Get a free GCP account:
- Go to the Google Cloud Console.
- Create a new project (See 'My First Project').
Welcome screen.
- In the left navigation menu, click on "Compute Engine" under the "Compute" section and select "VM instances".
VM instances.
- Click on the "Create instance" button to create a new virtual machine instance.
Create VM instance.
- Select the desired configuration for the virtual machine, such as machine type, CPU, memory, and storage options. Allow https traffic.
- In this case we use: N2 series, 8GB RAM and 30 GB of storage.
- Region: europe-southwest
Configure instance.
- Select an Ubuntu image and 30 GB of storage.
OS image configuration.
-
Configure the additional settings as per your requirements, including the region, network settings, and SSH access.
-
Review the configuration and click on the "Create" button to create your virtual machine. Note the monthly estimate is $68 and we have $300 credit, in that case we will not exceed the free resources. However, you can also set a Budget for your project, and set alarms (See https://cloud.google.com/billing/docs/how-to/budgets).
Pricing.
- Wait for the virtual machine to be provisioned. Once it is ready, you can find its details on the Compute Engine dashboard, including its public IP.
Get public IP.
- To connect to the virtual machine via SSH, click on the SSH button next to the virtual machine instance name. This will open a terminal window directly in your browser.
SSH-in-browser
-
You are now connected to your GCP free tier virtual machine and can start using it for your desired tasks.
-
To connect to the VM via SSH from your local machine
- Generate your SSH keys
ssh-keygen -t rsa -f ~/.ssh/gcp-vm
- Go to metadata and add your public ssh key
- Connect to the VM using your private key
ssh -i ~/.ssh/gcp-vm [email protected]
Adding SSH keys.