Preparing the Google Cloud Project and Cloud Shell
From creating the project to linking billing, setting a budget alert, and installing Terraform in Cloud Shell
Google Cloud resources are created inside a project, and usage is billed to the linked billing account. Check the project ID and billing status before any server command. Everything needed here happens in the browser, in the Google Cloud Console and Cloud Shell.
Before you start
You need a Google account and a supported payment method. As of August 2026, new customers eligible for the free trial receive $300 in credit valid for 90 days after verifying their identity with that payment method. The trial does not turn into automatic charges when it ends. Once the credit runs out or the 90 days pass, resources stop, and continuing requires a manual upgrade to a paid account. This stage sets up the billing link and budget alert before creating a Minecraft VM.
The budget at this stage is a notification budget. Reaching the amount you set does not stop Compute Engine VM or Storage usage on its own.
Creating the Project
Run: in the Google Cloud Console
- Sign in to the Google Cloud Console.
- Click the project picker at the top.
- Click
New Project. - Enter a project name you will recognize.
- Check the project ID shown on screen and click
Create. - When creation finishes, select the new project in the project picker at the top.
The project name can be changed later, but the project ID is what the Google Cloud APIs and
Terraform keep using. Later commands take the ID, not the name. An example looks like
minecraft-guide-123456: lowercase letters, digits, and hyphens.
On an organization account you may not have permission to create a project yourself. If the
New Project button is missing or creation is refused, ask an organization administrator to create
the project and link billing.
Linking a Billing Account
Creating the Minecraft VM, disks, and external IP requires an active billing account linked to the project.
Run: in the left menu of the Console
- Open
Billing. - If you have no billing account, follow the guidance to create a self-service one.
- Find the project you created under
My Projects. - In the project row menu, click
Change billing. - Select the billing account to use and link it.
If you already selected a billing account while creating the project, do not link it again. The Google Cloud billing link documentation lists the permissions the project and the billing account need.
Creating a Budget Alert
A budget alert sends an email when usage approaches the amount you expect. The VM and Storage keep running until you take a separate action to stop them.
Run: in the billing screen
- Open the billing account you linked under
Billing. - Select
Budgets & alertsunderCost management. - Click
Create budget. - Limit the scope to this one Minecraft project.
- Enter a monthly amount you can absorb.
- Check the default threshold alerts and the recipient email address, then save.
The budget amount does not mean the server price. Set it at an amount that lets you notice the mistake of leaving the server running. Google Cloud documents the budget and alert setup procedure separately.
Opening Cloud Shell
Cloud Shell is a Linux terminal that runs in the browser. It comes with tools such as gcloud,
curl, and nano, and it passes the project selected in the Console through as the current
project.
Run: in the Google Cloud Console
- Click the
Activate Cloud Shellicon at the top right of the Console. - Wait until the terminal opens at the bottom of the screen.
- If a permission request appears the first time, read it and click
Authorize.
Once $ appears at the end of the prompt, enter the next command.
gcloud config get-value project
The output must match the project ID you noted earlier. If it differs, select the project again at the top of the Console and open a new Cloud Shell tab.
Cloud Shell’s $HOME comes with 5GB of persistent storage in the default mode. Ephemeral mode
discards working files when the session ends, so it is not used here. Also keep in mind that if you
do not open Cloud Shell even once for 120 days, this entire storage is deleted. If you plan to take
a long break from operating the server, copy working files such as terraform.tfvars to your local
PC as well.
Preparing Terraform
The Cloud Shell image may or may not include Terraform. The June 2026 Cloud Shell release notes record the removal of the bundled CLI, so check whether it exists first.
Check: in Cloud Shell
The five lines below are a single check command. Copy the whole block, paste it, and press Enter: it
prints the version when Terraform is present, and Terraform installation required when it is not.
if command -v terraform >/dev/null 2>&1; then
terraform version
else
echo "Terraform installation required"
fi
If it reports Terraform v1.8 or later and below 2.0, skip the installation. If it is missing or
older, download the public installation script.
Conditional run: Cloud Shell has no Terraform, or a version below 1.8
curl --fail --location \
https://juntiger-assets.pages.dev/minecraft-terraform-bootstrap.sh \
--output minecraft-terraform-bootstrap.sh
bash minecraft-terraform-bootstrap.sh
export PATH="$HOME/.local/bin:$PATH"
terraform version
The installation script only accepts Cloud Shell’s Linux x86_64 environment. It downloads the
Terraform 1.15.8 archive used to verify this series, compares it against the SHA-256 pinned in the
script, and installs it under $HOME/.local/bin. Do not run this script on macOS or WSL.
The export PATH=... line tells the currently open session where the install path is. The script
also adds the same line to $HOME/.profile, so the next Cloud Shell tab you open finds the
terraform command without running it again.
Normal output starts like Terraform v1.15.8.
Using a Local Terminal
To work from your own computer instead of Cloud Shell, follow the HashiCorp Terraform installation docs and the Google Cloud CLI installation docs. The same Bash commands work in macOS Terminal, Linux, and WSL.
Locally, a browser sign-in is not passed through the way it is in Cloud Shell. part 03 sets up
gcloud init, the CLI login, and Application Default Credentials separately.
Completion Check
Run these three commands in Cloud Shell.
gcloud config get-value project
gcloud auth list --filter="status:ACTIVE"
terraform version
If the project differs or the terraform command is not found, stop here. These three commands
succeeding is the prerequisite for
Terraform Authentication and Remote State.
References
Comments
No comments yet. Be the first to leave one.
Pending review