Create a GCP account, accept the terms, etc.
NOTE: There are ton of details skipped here such as the VPC, firewall, etc. this is just a quick introduction :)
First, create the ssh-keys:
Metadata
- Key:
sshKeys
- Value:
<yourusername>:ssh-rsa <yourkey> <yourusername>
ssh-keys
Just paste your public key (~/.ssh/id_rsa.pub)
For more information, see the official documentation.
The free tier is limited to:
- Certain regions (I choose us-central1 in this case)
- 30 GB HDD (I chosse 29 GB just in case)
- f1-micro size (¯\_(ツ)_/¯)
See https://cloud.google.com/free/docs/gcp-free-tier#always-free for more information
Create the instance using the cloud console (or the gcloud cli if installed) as:
gcloud compute instances create INSTANCENAME \
--image freebsd-12-0-release-amd64 \
--image-project=freebsd-org-cloud-dev \
--zone "us-central1-c" \
--machine-type "f1-micro" \
--network "default" --maintenance-policy "MIGRATE" \
--boot-disk-size "29" \
--boot-disk-type "pd-standard" \
--async
After a while, the instance will be available. See the instance details with gcloud compute instances list
:
gcloud compute instances list
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
freebsd us-central1-c f1-micro 10.128.0.2 35.239.255.111 RUNNING
Then, connect with the proper key to the public IP:
ssh <myuser>@35.239.255.111