Skip to content

Instantly share code, notes, and snippets.

@e-minguez
Last active December 12, 2018 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e-minguez/b98563fcaa792586dafdc2b251274e44 to your computer and use it in GitHub Desktop.
Save e-minguez/b98563fcaa792586dafdc2b251274e44 to your computer and use it in GitHub Desktop.
FreeBSD 12.0-RELEASE on GCP free tier

FreeBSD on GCP free tier

Account

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 :)

SSH keys

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.

Instance details

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

Instance creation

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

Connect to the instance

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment