CloudEstimate

Size Keycloak on Google Cloud

Medium — 25 to 150 peak logins per second

Monthly cost

$437.27

Annual cost

$5,247/year

Line-item breakdown

Compute $397.27
Storage $40.00
Other $0.00
Arm64 option (Google Axion (C4A)) $433.32/mo

Saves $3.94/mo (1%) across c4a-standard-4.

Components provisioned

Role Instance vCPU GB RAM Storage
Keycloak 2 × n4-standard-4 4 16 100 GB ssd
Database 1 × n4-standard-4 4 16 200 GB ssd

Why this sizing

This medium tier sizing on Google Cloud fits workloads handling twenty-five to one hundred fifty peak logins per second. Compute instances drive the monthly cost at three hundred ninety-seven dollars and twenty-seven cents. High availability is disabled, meaning a single database failure causes downtime for the deployment.

Export

Share the current URL or copy the Google Cloud Terraform / OpenTofu baseline.

Google Cloud Terraform / OpenTofu baseline
# Compatible with Terraform >= 1.6 and OpenTofu >= 1.6
terraform {
  required_version = ">= 1.6.0"

  required_providers {
    google = {
      source  = "hashicorp/google"
      version = "~> 6.0"
    }
  }
}

variable "project_id" {
  description = "Google Cloud project ID for this deployment."
  type        = string
  default     = "replace-with-project-id"
}

provider "google" {
  project = var.project_id
  region  = "us-central1"
}

locals {
  zones = ["us-central1-a", "us-central1-b", "us-central1-c"]
}

# Generated for Google Cloud (us-central1) from the current estimate state.
resource "google_compute_disk" "keycloak_1_data" {
  count = 2
  name  = "keycloak-keycloak-1-data-${count.index + 1}"
  type  = "hyperdisk-balanced"
  zone  = local.zones[count.index % length(local.zones)]
  size  = 100
}

resource "google_compute_instance" "keycloak_1" {
  count        = 2
  name         = "keycloak-keycloak-1-${count.index + 1}"
  machine_type = "n4-standard-4"
  zone         = local.zones[count.index % length(local.zones)]

  boot_disk {
    initialize_params {
      image = "projects/debian-cloud/global/images/family/debian-12"
      size  = 50
      type  = "hyperdisk-balanced"
    }
  }

  network_interface {
    network = "default"
    access_config {}
  }

  attached_disk {
    source = google_compute_disk.keycloak_1_data[count.index].id
    mode   = "READ_WRITE"
  }

  labels = {
    app  = "keycloak"
    role = "keycloak"
  }
}

resource "google_compute_disk" "database_2_data" {
  count = 1
  name  = "keycloak-database-2-data-${count.index + 1}"
  type  = "hyperdisk-balanced"
  zone  = local.zones[count.index % length(local.zones)]
  size  = 200
}

resource "google_compute_instance" "database_2" {
  count        = 1
  name         = "keycloak-database-2-${count.index + 1}"
  machine_type = "n4-standard-4"
  zone         = local.zones[count.index % length(local.zones)]

  boot_disk {
    initialize_params {
      image = "projects/debian-cloud/global/images/family/debian-12"
      size  = 50
      type  = "hyperdisk-balanced"
    }
  }

  network_interface {
    network = "default"
  }

  attached_disk {
    source = google_compute_disk.database_2_data[count.index].id
    mode   = "READ_WRITE"
  }

  labels = {
    app  = "keycloak"
    role = "database"
  }
}

Related views

Sources

Reference architecture: Keycloak for two-node-medium, version Keycloak current high-availability sizing guidance, retrieved April 13, 2026.

https://www.keycloak.org/high-availability/single-cluster/concepts-memory-and-cpu-sizing

Pricing: Google Cloud pricing snapshot, retrieved November 29, 2026.

Commercial pricing only. GovCloud, sovereign cloud, and discounts beyond those shown are not modelled.

Not included in this estimate

  • Vendor licensing and support
  • Professional services
  • Network egress
  • Compliance controls
  • Backup storage
  • Monitoring

Based on Keycloak's official HA sizing concepts and translated into VM-based planning inputs for self-managed deployments.

Estimate excludes external IdPs, SMTP, user federation backends, separate caching infrastructure, and license costs for any commercial database choice.

Related workloads on Google Cloud