Google Cloud Project and SDK Setup
Create a Google Cloud project, install and initialise the Google Cloud CLI, authenticate, and verify the configuration from VS Code.
The image works locally. Now we prepare Google Cloud: a project to hold everything, and the Google Cloud CLI (gcloud) to control it from the terminal.
Google Cloud terms you will see
| Term | Meaning |
|---|---|
| Google account | The login you use for the console and gcloud |
| Billing account | Where charges go. Linked to one or more projects |
| Project | A container for everything you create: services, images, settings, permissions |
| Project ID | The unique, permanent identifier of a project. Commands use this, not the display name |
| Region | The data centre location, for example us-central1 or asia-south1 (Mumbai) |
| API / service | A Google Cloud product you switch on per project, such as Cloud Run or Cloud Build |
| IAM | Identity and Access Management: who is allowed to do what in the project |
Step 1: Create a project
Open the console
Go to the Google Cloud console and sign in with your Google account.
Create a new project
Click the project picker at the top, then New project. Enter a name, for example telusko-content-tracker. Leave Organization empty if you do not have one, and click Create.
Note the project ID
Google shows a project ID below the name. It must be globally unique, so it may differ slightly from the name. Every gcloud command uses the project ID, not the name. Save it next to the image name from the previous lesson.
Billing
Cloud Run, Cloud Build and Artifact Registry need billing enabled on the project, even if your usage stays within the free tier. Check Billing in the console and set a budget alert so you are notified long before any surprise.
Step 2: Install the Google Cloud CLI
Download the installer for your OS from the official install page:
| OS | How |
|---|---|
| Windows | Run the Google Cloud CLI installer. Keep the option to add gcloud to your PATH |
| macOS | Download the archive and run the install script, or use Homebrew |
| Linux | Use the package for your distribution, or the archive |
At the end, the installer starts gcloud init. It asks you to log in with your Google account and pick a project. If your new project is not in the list, choose to enter a project ID and type it.
Step 3: Make gcloud available in VS Code
The VS Code terminal may not see the new PATH yet. If gcloud is "not recognized":
- Close all VS Code windows (not just the terminal tab)
- Reopen VS Code and open a new terminal
Then check:
gcloud --versionRestart Claude Code in that new terminal too, and switch back to Sonnet with /model sonnet if needed.
Step 4: Authenticate
gcloud auth loginA browser window opens. Pick your account and click Allow.
Set the project for all following commands (use your own project ID):
gcloud config set project telusko-content-trackerAlso set application default credentials, which tools and libraries use to call Google APIs:
gcloud auth application-default loginStep 5: Verify
gcloud config listYou should see your account and your project ID. If both are right, the setup is done.
Should Claude Code run these commands?
It can, and for repetitive commands that is useful. But login flows open a browser and need your decisions, so they are easier to run yourself with ! or in a normal terminal. Commands that would put credentials or secrets in the conversation should always be run by you, outside Claude.
Useful gcloud commands
| Command | What it does |
|---|---|
gcloud --version | Show the installed CLI version |
gcloud auth list | Show which accounts are logged in and which one is active |
gcloud config list | Show the active account, project and default region |
gcloud projects list | List the projects your account can access |
gcloud config set project <PROJECT_ID> | Switch the active project |
gcloud config set run/region us-central1 | Set a default region for Cloud Run, so you can skip --region |
Troubleshooting
| Problem | Fix |
|---|---|
gcloud is not recognized | Restart all VS Code windows or your terminal. On Windows, check that the Cloud SDK bin folder is on your PATH |
New project does not appear in gcloud init | Choose "enter a project ID" and type it, or run gcloud config set project <PROJECT_ID> |
PERMISSION_DENIED or billing errors later | Make sure billing is linked to the project and that you are logged in with the account that owns it |
| Wrong account is used | gcloud auth list, then gcloud config set account <email> |
Official references
- Install the Google Cloud CLI
- Initialize the gcloud CLI
- Creating and managing projects
- Create a budget alert
Written By: Shramik Masti
How is this guide?
Last updated on
Dockerizing and Testing the App Locally
Ask Claude Code for a production-ready Dockerfile with precise requirements, understand every line, then build and run the container locally with environment variables.
Artifact Registry, Cloud Run and Testing
Enable the required Google Cloud APIs, create an Artifact Registry repository, build the image with Cloud Build, deploy it to Cloud Run with a real secret, and test the live app.
