Skip to main content
Google Cloud · lesson 1 of 10
Google Cloud beginner Lesson 1 of 10

Introduction to Google Cloud Platform

Create a free-tier GCP account, understand the project and billing-account model, and get gcloud authenticated against a real project.

By SkillByExample · Published

gcp google-cloud getting-started gcloud

Every Google Cloud resource — a virtual machine, a storage bucket, a database — belongs to exactly one project, and every project is billed through a billing account. That two-level model is the first thing to get straight, because almost every permission error and every stray charge traces back to which project a resource landed in.

This lesson uses a free-tier account. Sign up at cloud.google.com/free with a Google account and a credit card — you get a 90-day, $300 credit, and Google will not auto-upgrade you to a paid account without confirmation. Every command below runs safely inside that trial.

Projects, billing accounts, and organizations

Organization (optional, needs Google Workspace/Cloud Identity)
 └── Billing Account  ── pays for ──┐
 └── Project                        │
      ├── skillbyexample-437219  ◄──┘
      │    ├── IAM policies
      │    ├── Enabled APIs
      │    └── Resources (VMs, buckets, databases, ...)
      └── another-project-991204

A personal Gmail account has no organization node — projects sit directly under your billing account. A company account typically has an organization at the top, with folders grouping projects by team. Every lesson in this track uses a single project so billing and IAM stay easy to reason about.

Installing and initializing gcloud

Install the Google Cloud CLI for your OS from cloud.google.com/sdk/docs/install, then run gcloud init to authenticate and pick a project.

gcloud init
Welcome! This command will take you through the configuration of gcloud.

Pick configuration to use:
 [1] Re-initialize this configuration [default] with new settings
 [2] Create a new configuration
Please enter your numeric choice:  2

Enter configuration name.  Names start with a lower case letter and
contain only lower case letters a-z, digits 0-9, and hyphens '-':  skillbyexample
Your current configuration has been set to: [skillbyexample]

Choose the account you would like to use to perform operations for
this configuration:
 [1] you@gmail.com
 [2] Log in with a new account
Please enter your numeric choice:  1

You are logged in as: [you@gmail.com].

Pick cloud project to use:
 [1] skillbyexample-437219
 [2] Create a new project
Please enter numeric choice or text value (must exceed 3 characters): 1

Your current project has been set to: [skillbyexample-437219].

Do you want to configure a default Compute Region and Zone? (Y/n)?  y

Which Google Compute Engine zone would you like to use as project default?
 [1] us-central1-a
 [2] us-east1-b
 [3] europe-west1-b
 ...
Please enter numeric choice or text value (must exceed 3 characters):  1

Your project default Compute Engine zone has been set to [us-central1-a].
Your project default Compute Engine region has been set to [us-central1].

Your Google Cloud SDK is configured and ready to use!

* Commands that require authentication will use you@gmail.com by default
* Commands will reference project `skillbyexample-437219` by default
* Compute Engine commands will use region `us-central1` by default
* Compute Engine commands will use zone `us-central1-a` by default

Run `gcloud help config` to learn how to change individual settings

gcloud init writes those defaults to a configuration on disk so you don’t retype --project and --zone on every command. Everything after this lesson assumes they’re set.

Checking who and what you’re authenticated as

gcloud auth list
      Credentialed Accounts
ACTIVE  ACCOUNT
*       you@gmail.com

To set the active account, run:
    $ gcloud config set account `ACCOUNT`
gcloud config list
[compute]
region = us-central1
zone = us-central1-a
[core]
account = you@gmail.com
disable_usage_reporting = True
project = skillbyexample-437219

Your active configuration is: [skillbyexample]

The * next to an account in auth list marks the active one — the identity every subsequent gcloud command runs as. config list shows the active configuration’s defaults, which is why the two commands answer different questions: one is “who am I,” the other is “what happens if I don’t pass a flag.”

Confirming billing is attached

A project with no billing account can create a handful of things but most APIs — Compute Engine, Cloud SQL — refuse to enable until billing is linked.

gcloud billing accounts list
gcloud billing projects describe skillbyexample-437219
ACCOUNT_ID            NAME                OPEN
01A2B3-4C5D6E-7F8A9B  My Billing Account  True

billingAccountName: billingAccounts/01A2B3-4C5D6E-7F8A9B
billingEnabled: true
name: projects/skillbyexample-437219/billingInfo
projectId: skillbyexample-437219

billingEnabled: true is the field to check before debugging a confusing PERMISSION_DENIED or FAILED_PRECONDITION from any other API — it’s often just this.

Practice

1. List every project your account can see, not just the active one.
gcloud projects list
PROJECT_ID              NAME             PROJECT_NUMBER
skillbyexample-437219   skillbyexample   918273645102

gcloud projects list ignores the active configuration entirely — it queries the Resource Manager API for every project your account has at least viewer access to.

2. Switch the active project without re-running gcloud init.
gcloud config set project skillbyexample-437219
Updated property [core/project].

gcloud init is only needed for first-time setup or a brand-new configuration; day to day, gcloud config set changes one property at a time.

3. Create a second, independent gcloud configuration for a different project.
gcloud config configurations create sandbox
gcloud config set project some-other-project-id
gcloud config configurations list
Created [sandbox].
Activated [sandbox].
Updated property [core/project].

NAME            IS_ACTIVE  ACCOUNT        PROJECT                 COMPUTE_DEFAULT_ZONE
default         False      you@gmail.com  skillbyexample-437219   us-central1-a
sandbox         True       you@gmail.com  some-other-project-id

Configurations are how you avoid accidentally running a command against the wrong project when you juggle more than one.

4. Check which APIs are already enabled on the project.
gcloud services list --enabled --limit=5
NAME                              TITLE
cloudapis.googleapis.com          Google Cloud APIs
cloudresourcemanager.googleapis.com  Cloud Resource Manager API
cloudtrace.googleapis.com         Cloud Trace API
compute.googleapis.com            Compute Engine API
storage.googleapis.com            Cloud Storage API

A fresh project starts with a small default set. The Compute Engine and Cloud SQL lessons ahead will each need to gcloud services enable one more API before their first example runs.

5. Find out exactly how much of the $300 trial credit is left.

The billing balance isn’t exposed through gcloud — check it in the Cloud Console under Billing → Overview, which shows remaining credit and days left in the trial. This is worth bookmarking now; the cost lesson later in this track comes back to it.

Next: IAM — roles, service accounts, and reading a PERMISSION_DENIED error correctly.

Frequently Asked Questions

Is Google Cloud Platform free to try?
New accounts get a 90-day, $300 free trial credit, plus a permanent Always Free tier (a small Compute Engine instance, 5 GB of Cloud Storage, and more) that keeps working after the trial ends or the credit runs out, as long as usage stays under the free limits.
What is a GCP project, exactly?
A project is the unit everything else attaches to: billing, IAM permissions, enabled APIs, and every resource you create. Every VM, bucket, and database belongs to exactly one project, identified by a globally unique project ID such as skillbyexample-437219.
Do I need a credit card to use the free tier?
Yes. Google requires a card or bank account to verify you are not a bot and to enable billing on the project, but it will not charge you automatically once the trial credit is used — you have to explicitly upgrade to a paid account first.
What is the difference between gcloud, gsutil, and the Cloud Console?
gcloud is the general-purpose CLI for most GCP services; gsutil is a separate, older CLI specific to Cloud Storage (gcloud storage is replacing it); the Cloud Console is the web UI. All three call the same underlying REST APIs, so anything one can do the others can too.
Why does my project ID have a random number suffix?
Project IDs are globally unique across every GCP customer, not just your account. If the name you typed is already taken, gcloud or the console appends a random six-digit suffix automatically so the ID stays available.