The following sections assume you have signed up for google cloud. If you haven't done this step, please visit the gcp signup page. You can start for free.
You can run these instructions from your own terminal, or using the GCP shell. The GCP shell is accessed through your browser, from the GCP dashboard, as described below.
- Please create a project
- You'll use this project id for the commands in this directory
- If using a local terminal / shell:
- Please install gcloud:
1. Visit the interactive install page
2. Ensure you run
gcloud init
- Otherwise, you can use the gcp shell in your browser.
- Navigate to the gcp dashboard
- Select the
>_
image in the upper right part of the top level tool bar - NB: you get do a
git clone
of this project inside the cloud shell
From this directory, you should run the following commands to create the initial VM and ssh in. It is important that you set the project id first, there are sensible defaults for everything else:
export GCP_PROJECT=<the Project Id of the project you created>
# This creates a firewall rule that allows any IP address to access certain ports
./network_create.sh
# This will create a VM instance, with the firewall rule applied
./compute_create.sh
# This will log you into the VM, once it is up and running.
./compute_ssh.sh
For ongoing use, you can stop and start anytime. When you are completely done, please delete the VM.
You don't pay money for the VM when it is stopped, but you do pay for the attached disk (for what has been used).
# If you haven't already, create GCP_PROJECT ..
export GCP_PROJECT=<the Project Id of the project you created>
# To stop a running VM
./compute_stop.sh
# To start a stopped VM
./compute_start.sh
# To delete a VM (in any state)
./compute_delete.sh