Back to Knowledge
Updated Sep 2026

Building with Google Cloud

Already on Google Cloud, or tempted by Firebase and Gemini? Here's how to build modern web apps with GCP services in 2026, what the free trial really covers, and when it beats the simpler Vibe Stack.

1GCP vs Vibe Stack: When to Choose What

Google Cloud is often friendlier than AWS, and Cloud Run is one of the nicest ways to run a container anywhere. It's still a full cloud platform, with a full cloud platform's knobs.

Choose GCP If...

  • Your company already runs on Google Cloud or Workspace
  • You want to run any language in a container that scales to zero (Cloud Run)
  • You need Kubernetes (GKE) or big-data tools like BigQuery
  • You want Gemini models and Google's AI platform close to your data
  • You're building on Firebase (mobile apps, realtime data)

Choose Vibe Stack If...

  • You want to ship fast with near-zero config
  • You're building a standard Next.js web app
  • You want preview deployments on every PR without wiring CI
  • You're a solo developer or small team
  • You'd rather pick best-in-class tools than one platform

Our take: GCP is generally easier than AWS, but "easier" is still more work than Vercel + Neon. Choose GCP when you need its platform features; choose the Vibe Stack when you just want to ship. Mixing is fine: a Vercel frontend calling a Cloud Run API is a solid pattern.

2Recommended GCP Stack for Web Apps

Cloud Run

Google Cloud Run

Google's serverless container platform. Deploy any containerized app and it scales automatically, down to zero when idle. Google's former Cloud Functions product now lives under it as Cloud Run functions.

"Like AWS Lambda, but you bring your own container. More flexible, still serverless."

(App Hosting)

Run containers that scale to zero, no cluster to manage

Why Use It

  • • Serverless containers: any language or framework
  • • Scales to zero, so idle services cost little
  • • Deploy straight from source (it builds the container for you)
  • • HTTPS URL out of the box, custom domains supported

Gotchas

  • • Container concepts help (Docker

    Docker

    A tool that packages your app and its environment into a 'container' that runs the same everywhere. No more 'it works on my machine.'

    "Like shipping furniture in a box. Everything arrives exactly as it was packed."

    , ports, images)
  • • No PR preview deployments unless you build them in CI
  • • Stateless: the filesystem doesn't persist
  • • Cold starts when scaled to zero

Comparable to: Vercel Functions or AWS Lambda, but you ship a whole HTTP server instead of individual functions. Great for Python (FastAPI, Django) or anything that isn't Next.js.

Firebase

Firebase

Google's app development platform with real-time database, authentication, hosting, and more. Great for rapid prototyping but watch costs at scale.

"Like a backend-in-a-box. Everything you need to get started, but read the meter."

App Hosting (Next.js on Google)

GitHub-connected hosting with built-in Next.js support

If you want the Vercel-style "push to GitHub, it deploys" workflow but on Google's infrastructure, Firebase App Hosting is the closest match. It builds with Cloud Build, serves on Cloud Run, and caches through Cloud CDN, with preconfigured support for Next.js and Angular. It requires the pay-as-you-go Blaze plan.

Pick this over raw Cloud Run when your app is Next.js and you don't want to write a Dockerfile or CI pipeline.

Cloud SQL

Google Cloud SQL

Google's fully managed relational database for PostgreSQL, MySQL, and SQL Server. Auto-backups, high availability, and tight integration with GCP services.

"Like AWS RDS, but from Google. Same concept, different cloud neighborhood."

(Database)

Managed PostgreSQL

PostgreSQL

A powerful, open-source relational database. Rock-solid, feature-rich, and the choice for serious production apps.

"Like the Toyota Camry of databases. Reliable, well-documented, handles anything you throw at it."

, MySQL, or SQL Server

Why Use It

  • • Automatic backups and replication
  • • High availability with failover
  • • Built-in connector for Cloud Run
  • • Private IP inside your VPC

Gotchas

  • • The instance bills while it runs, traffic or not
  • • No scale-to-zero like Neon
  • • Connection limits: you need pooling
  • • More setup than a Neon connection string

Comparable to: Amazon RDS. For branching dev databases and scale-to-zero, Neon still wins; a Cloud Run app can connect to Neon just fine.

Firebase Authentication

User sign-in with email, phone, and social providers

Why Use It

  • • Email/password, phone, and social logins
  • • Client SDKs for web, iOS, and Android
  • • Free tier covers many small apps
  • • Plays nicely with Firestore security rules

Gotchas

  • • Lock-in to the Firebase ecosystem
  • • Server-side session handling in Next.js takes extra work
  • • Usage past the free limits is billed

Comparable to: Clerk, Auth0, or Better Auth. See Auth. Check Firebase pricing for current limits.

Cloud Run functions (formerly Cloud Functions)

Single-purpose functions for events, webhooks, and background tasks

Why Use It

  • • Write one function, Google handles the container
  • • Triggers from Pub/Sub, Cloud Storage, and other events
  • • Runs on Cloud Run under the hood

Gotchas

  • • Old tutorials say "Cloud Functions 2nd gen": same idea, new name
  • • "1st gen" functions are legacy; don't start new ones there
  • • Cold starts, like any scale-to-zero service

Rule of thumb: Cloud Run services for HTTP APIs and whole apps; Cloud Run functions for small event-driven jobs.

3Free Trial, Free Tier & Real Costs

New Google Cloud customers get $300 in credit for 90 days, plus Free Tier monthly limits on some products that continue after the trial.

Scale-to-zero services

Cloud Run services, Cloud Run functions

Very cheap at hobby traffic; many small apps stay inside the Free Tier.

Always-on services

Cloud SQL instances, GKE clusters, VMs

Bill every hour they exist. Cloud SQL is usually the biggest line for a small app.

Sneaky extras

Network egress, logging volume, container image storage

Small individually, surprising together.

Compared with AWS: both now lead with time-limited credits for new accounts, and both keep a set of always-free allowances. The cheapest GCP setup pairs Cloud Run (scale to zero) with Neon instead of Cloud SQL. Check the Google Cloud free program page for current per-product limits, and set a budget alert before you deploy.

4Building GCP Apps with AI

Claude Code

Claude Code

Anthropic's agentic coding tool. It lives in your terminal (and in VS Code, JetBrains, and on the web), reads your codebase, edits files, runs commands, and ships code. Install with the native installer (`curl -fsSL https://claude.ai/install.sh | bash` on macOS/Linux, `irm https://claude.ai/install.ps1 | iex` on Windows); it needs a Pro, Max, Team, Enterprise, or Console account.

"Like having a senior developer living in your terminal, ready to help 24/7."

(Recommended)

Claude Code handles GCP well: Dockerfiles, gcloud commands, Cloud Run config, IAM bindings, and Firebase setup. Because it runs in your terminal, it can run gcloud itself and read the real error instead of guessing.

Tip: Ask Claude to explain the trade-off between a Cloud Run service and a Cloud Run function for your use case before it writes code. Use plan mode for anything that creates billable resources.

Company bills AI through Google Cloud? Claude Code can run on Google's AI platform (Vertex AI, now called Agent Platform). Pick it at the login prompt, or configure it manually:

Terminal

export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=global
export ANTHROPIC_VERTEX_PROJECT_ID=YOUR-PROJECT-ID
claude

Setup, model access, and IAM: Claude Code on Google Cloud.

Gemini + Antigravity

Antigravity

Google's agentic development platform: an IDE, CLI, and SDK plus the Antigravity 2.0 command center for orchestrating multiple AI agents working in parallel. It runs on Google's Gemini models and is generally available and free for individuals (as of Sep 2026).

"Like a mission control for AI coding agents. You manage the fleet, they write the code."

Google Antigravity is Google's agentic development platform: an IDE, a CLI, an SDK, and the Antigravity 2.0 command center for managing agents. It's generally available, free for individuals, and powered by Gemini models. If you live in Google's ecosystem, it's a strong option alongside (or instead of) Claude Code. Google also ships the open-source Gemini CLI.

Deep dive: Antigravity. Comparing tools: AI Tools.

Cursor, Copilot & others

All know GCP basics. The shared risk is outdated naming ("Cloud Functions 2nd gen") and deprecated flags from old training data. Point your assistant at current docs when it matters.

5Quick Start: Deploy to Cloud Run

1

Create a Google Cloud account

Sign up at cloud.google.com to get the $300 / 90-day trial credit, create a project, and set a budget alert under Billing right away.

2

Install the gcloud CLI and sign in

Install the Google Cloud CLI from Google's docs, then:

Terminal

gcloud auth login
gcloud config set project YOUR-PROJECT-ID
3

(Optional) Add a Dockerfile

Deploying from source works without one: Cloud Run builds the container with buildpacks. Add a Dockerfile when you want control. For Next.js:

Dockerfile

FROM node:24-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
ENV NODE_ENV=production
# Cloud Run sends traffic to $PORT (8080 by default); next start honors PORT
EXPOSE 8080
CMD ["npm", "start"]
4

Deploy

Terminal

gcloud run deploy my-app --source .

Answer the prompts: region, enabling the required APIs, creating an image repository, and whether to allow public access (yes for a public site).

5

Your app is live

Cloud Run gives you a run.app URL with HTTPS. Set secrets as environment variables or with Secret Manager (never bake them into the image), and map a custom domain when you're ready (see Domains).

That's it. Re-run the same command to ship updates. Want deploy-on-push instead? Connect the repo to Cloud Build, or use Firebase App Hosting for Next.js.

6Common GCP Gotchas

IAM and service accounts

Every Cloud Run service runs as a service account, and every API call checks IAM. "Permission denied" is the most common error you'll see.

Fix: Give each service its own service account with only the roles it needs. Avoid broad roles like Editor on production projects. Cloud Logging shows exactly which permission was missing; paste it into Claude.

Cloud SQL connection limits

Cloud Run can spin up many instances under load, each opening database connections. You'll hit Cloud SQL's limit fast without pooling.

Fix: Cap max instances, use a small pool per instance, and connect through the Cloud SQL connector or a pooler like PgBouncer. Or use Neon's pooled connection string.

Cold starts (still a thing)

A service scaled to zero has to start a container on the next request. Big images and slow framework boot make that noticeable.

Fix: Keep images small (slim or Alpine bases, Next.js standalone output), or set a minimum instance count on latency-sensitive services, which costs money even when idle.

Egress and forgotten resources

Data leaving Google's network is billed, so serving big files or video adds up. So do test databases nobody deleted after the trial ended.

Fix: Put static assets behind Cloud CDN (or a CDN in front), compress responses, set budget alerts, and delete projects you're done with; deleting a project removes everything in it.

Ready to build on Google Cloud?

Cloud Run plus a scale-to-zero database is a great combo. Compare it with AWS before you commit.