Deploying Medplum on Google Cloud with Terraform and GKE

A planning guide to running self-hosted Medplum on Google Cloud with Terraform, GKE, Cloud SQL and Cloud Armor, including what the Beta deployment does and what your team must confirm.

On this page

Deploying Medplum on Google Cloud with Terraform and GKE: what the work covers

A healthcare platform team that must host Medplum inside its own Google Cloud project needs to know exactly what the Beta Terraform path provisions before it commits to that route. The Medplum self-hosting documentation marks its GCP deployment as Beta, and it is built from Terraform modules that create a VPC, a GKE cluster, a Cloud SQL PostgreSQL instance, Cloud Storage buckets for binary data, a Redis instance for caching, and the ingress layer. That ingress layer includes a Cloud Armor web application firewall policy, Google-managed certificates for the public hostnames, and Secret Manager entries for configuration values. The Medplum application itself is then installed onto the cluster with the Helm chart. Each of these resources is created in an account the client controls, so the client owns the resulting environment, its billing, its IAM bindings, its logging and its upgrade schedule.

Teams usually choose this path when their organization already runs workloads on Google Cloud, has standardized on Terraform, and wants Medplum on Kubernetes rather than on a single virtual machine. Because the Terraform code is a starting point and not a managed service, the team must confirm the module versions it will pin, the regions and availability zones that meet its residency rules, and whether the Cloud Armor rules, private networking and database settings match its own security baseline. Ask the implementation partner to list every resource the plan creates, which of them are billed by usage, and which identities and roles each one needs. Confirm also the Medplum release the modules target, since the upgrade sequence is tied to the minor versions in the Medplum upgrading guide.

The rest of this section sets the boundary for the work. Everything listed here is operated by your team after handover, including node pool sizing, database backups, certificate renewal checks, secret rotation and patch windows for both Kubernetes and the Medplum server. Medplum's compliance documentation describes these operating duties as a shared responsibility between Medplum and its customers, so a clear owner for each one should be named before the first deployment. Medplum's self-hosting documentation lists the supported paths and their status, and it should be checked again on the day the build starts.

How the GCP parts connect

The request starts at the user's browser and passes through Cloud Armor, where the WAF policy is applied before traffic reaches the GKE ingress. The ingress hands requests to Medplum pods in the cluster, which reach Cloud SQL for PostgreSQL data, Redis for cache, and Cloud Storage for binaries. Secret Manager sits apart from the request path and supplies configuration to the pods. Check that each of these hand-offs stays on private addresses inside the VPC, and confirm how your Terraform modules wire the secret and storage permissions.

Request path from users through Cloud Armor and GKE to the data tier.

Which GCP layout fits your team

This layout starts from nothing and lets Medplum's Terraform configuration build the network, the GKE cluster, Cloud SQL for PostgreSQL, Cloud Storage, Redis, ingress and certificates. Your team inherits a complete environment, so most of the early effort goes into reviewing what Terraform creates rather than assembling parts by hand. Because the path is marked Beta, you should treat its module layout and variable names as subject to change between releases.

  • Reuse: Terraform covers the foundation, and the Helm chart deploys the application on top of it.
  • Ownership: Your team owns the Google Cloud project, the state backend and every later change to the Terraform code.
  • Fit: Teams without an existing cluster or a platform engineer who already reviews Terraform plans.
  • Risk: Beta status means you should confirm current support terms and pin module versions before adopting them.
  • Cost driver: Cloud SQL, GKE node pools and Cloud Armor rules are billed by Google, and their sizing follows your load.

Before you commit, confirm with Medplum which Terraform module version matches your target Medplum release and how the module handles upgrades to the cluster and database.

What each Terraform component must be checked for

The Terraform for a Medplum Beta deployment on Google Cloud creates networking, a GKE cluster, managed PostgreSQL, storage, Redis and a WAF policy, and each one carries its own defaults. Review the generated code for each component before running apply, because the choices made in these modules are hard to change once Medplum data is loaded.

VPC and subnet design

Check the CIDR ranges for the VPC, the subnet that hosts GKE nodes, and the secondary ranges reserved for pods and services. Confirm that the database and Redis instances sit on private addresses reachable only from the cluster, and that no subnet is open to the public internet. Ranges that overlap with your corporate network or another peered VPC will block VPN and interconnect routing later, so confirm them with your network team first.

GKE cluster settings

Confirm whether the cluster is regional or zonal, whether private nodes and a private control plane endpoint are enabled, and which release channel and node pool machine types the module selects. Check that Workload Identity is on so pods read Google secrets without long-lived service account keys, and that node auto-upgrade and maintenance windows match your change calendar. Medplum's Helm chart sizing should be checked against the node pool you actually create.

Cloud SQL PostgreSQL

Check the database version, the instance tier, high availability setting, and whether public IP is disabled in favor of private service access. Confirm automated backups, point-in-time recovery, the backup retention window and the deletion protection flag, since a generated default may allow accidental destruction of the instance. Confirm that the database user credentials are created and stored in Secret Manager rather than written to state or code in plain text.

Cloud Storage buckets

Check that each bucket uses uniform bucket-level access, public access prevention, and a location that matches your data residency rules. Confirm versioning and retention settings, and whether the bucket is used for binary data that Medplum serves through presigned URLs. Those URLs depend on signing keys, so confirm where the service account signing material is stored before any clinical documents are uploaded.

Redis instance

Confirm the Memorystore Redis tier, memory size, version, and whether in-transit encryption and AUTH are enabled. Check that the instance is attached to the same VPC as GKE and that it is not reachable from outside the private network. Medplum uses Redis as its cache, so an undersized or single-zone instance affects latency and recovery after a failure.

Cloud Armor policy

Check which rules the WAF policy applies to the load balancer, whether preconfigured OWASP rules are in preview or enforced mode, and whether rate limiting thresholds are set. Confirm that the policy is attached to the backend service that serves Medplum's API and web app, and that its logs are routed to a location your security team reviews. Preview mode rules log matches without blocking, so confirm the enforcement mode before go-live.

How to set up the Medplum GCP deployment

This sequence takes you from a Google Cloud project with billing and a domain to a running Medplum instance on GKE, with each stage confirmed before the next begins. The Terraform path is marked Beta in Medplum's self-hosting docs, so confirm the current module and chart versions against the docs before you start.

  1. Confirm prerequisites before any resources exist

    Your cloud or platform owner confirms a Google Cloud project with billing enabled, the IAM roles needed to create networking, GKE, Cloud SQL, Cloud Storage and Redis resources, a domain you control for the Medplum base and app URLs, and an email sender for invitations and MFA codes. Also confirm the Medplum release and Helm chart version you intend to install. You know this step is done when a written checklist names each item and its owner.

  2. Create the Terraform state backend

    The platform engineer creates a remote state location for Terraform before the first plan, with restricted access, versioning and a separate state for each environment. Keeping state off a laptop makes later changes reviewable and avoids two people applying conflicting changes. You know this step is done when a second team member can read the state configuration and run an initialization that connects to it.

  3. Review and apply the Terraform plan

    The platform engineer sets the variables for the project, region and network ranges, runs a plan, and reviews every resource before applying. The plan should show the VPC, GKE cluster, Cloud SQL for PostgreSQL, Cloud Storage bucket, Redis instance, Cloud Armor policy and load balancer resources, with no unexpected deletions. You know this step is done when the apply completes and the outputs list the cluster name, database connection details and bucket names.

  4. Get GKE credentials and verify cluster access

    The platform engineer retrieves cluster credentials with the Google Cloud CLI and confirms that kubectl can reach the API server using the expected identity. Check that the nodes are Ready and that the namespace planned for Medplum exists or can be created under your access model. You know this step is done when a read-only command lists the nodes and the Medplum namespace from the cluster you intended, not another environment.

  5. Populate Secret Manager with configuration secrets

    The platform engineer writes the database password, Redis credentials, signing keys, email provider credentials and other settings into Secret Manager, and grants the GKE workload identity access only to the secrets it needs. Values should not appear in Terraform variable files, chart values or shell history. You know this step is done when each required secret exists, its access binding is recorded, and a test read from the cluster identity succeeds without exposing the value.

  6. Install the Medplum Helm chart

    The platform engineer edits the chart values to point at the Cloud SQL, Redis, Cloud Storage and secret references from the earlier steps, then runs a Helm install into the Medplum namespace. Check the rendered manifests before installing, and confirm that the server pods reach a ready state and their logs show a successful start. You know this step is done when the release reports deployed and the health endpoint answers from inside the cluster.

  7. Validate DNS and the managed certificate

    The platform engineer creates DNS records that point the Medplum domains at the load balancer address from the ingress. Google-managed certificates are issued only after the domain resolves to that address, so the certificate can take time to move to an active state. You know this step is done when DNS resolves from outside your network and the certificate status shows active for each hostname, with no mismatch errors in the browser.

  8. Run smoke tests and record the result

    The platform engineer signs in to the Medplum app with an administrator account, creates a test project, sends an invitation to a test address, and reads and writes a sample FHIR resource through the API. The security team checks that Cloud Armor rules are attached to the ingress and that the database is not reachable from outside the private network. You know this step is done when every check passes and the results, with the versions deployed, are filed with the change record.

How Secret Manager and the Helm chart hold Medplum configuration

The configuration path runs from Terraform outputs to Secret Manager to Kubernetes, and each hop needs an owner. Terraform creates the Cloud SQL instance, the Redis instance, the Cloud Storage bucket and the service accounts, then writes the values the server needs into Secret Manager secrets: the PostgreSQL connection details and password, the Redis host, and the signing keys used for presigned binary URLs. The Helm chart does not read Terraform state. Instead, the cluster pulls those secrets into Kubernetes through the mechanism your team selects, such as the Secret Manager add-on for the Secrets Store CSI Driver or an external secrets operator, and the chart references them by name. Confirm the exact mechanism and secret names against the Medplum GCP documentation for your release before you write the values file, because a renamed secret fails at pod startup rather than at apply time.

Two settings in the server configuration, baseUrl for the API and appBaseUrl for the web app, must match the hostnames your load balancer and Google-managed certificates serve. They appear in invite links, password reset emails, OAuth redirects and SMART launch URLs, so a mismatch often looks like a sign-in failure rather than a configuration error. Decide both hostnames before the first helm install, and check that the DNS records and certificate domains match them exactly, including the scheme and any trailing path.

Change control applies to every value in this chain. A manual edit in the Secret Manager console or a kubectl edit on a running deployment creates a state that Terraform and the Helm chart do not know about, and the next apply or upgrade can silently overwrite it or leave the cluster inconsistent. Route changes through version-controlled Terraform and values files, peer review and a recorded deployment, and treat Secret Manager versions as an audit trail. Ask your partner or internal team to document how rotation of the database password and signing keys is performed without downtime, and who approves each rotation.

Security and operational considerations on Google Cloud

A Medplum deployment on Google Cloud spans managed databases, a cluster, a load balancer and a secrets store, and each one carries its own access and patching decisions. The cards below cover the controls to design before go-live and the routines that keep them working after launch.

Private networking for Cloud SQL and Redis

Cloud SQL and Redis hold clinical records and session data, so they should sit on private IP addresses inside the VPC with no public endpoint. Confirm with your Terraform plan that the database and cache are reachable only from the GKE node and pod ranges, and that authorized networks are empty. Ask the Beta module's maintainers which private service access ranges it creates and how they are sized before you add new workloads.

Least-privilege service accounts and Workload Identity

Each Medplum workload should run under its own Google service account with only the roles it needs, such as Cloud SQL client access for the server and read access to one bucket for binaries. Bind these accounts to Kubernetes service accounts through Workload Identity so no long-lived JSON key files are stored in the cluster. Review the bindings after every Terraform change, because a broad project-level role is easy to add and hard to notice.

Cloud Armor rule tuning

The Cloud Armor WAF policy in front of the ingress should start with the preconfigured rule sets in preview mode, so you can see which legitimate FHIR requests and bulk exports they would block. Tune exclusions for specific paths and request sizes before switching rules to enforce. Also decide how rate limits apply to API clients and bots, since automated integrations can look like attacks to generic rules.

Kubernetes Secrets encryption at rest

Kubernetes stores Secrets unencrypted in etcd by default, so the database password and signing keys are exposed to anyone who can read the etcd data or the Secret objects. Configure application-layer encryption of Secrets with a key held in Cloud KMS, or keep sensitive values in Secret Manager and mount them through the Secrets Store CSI Driver. Restrict list and watch access on Secrets with narrow RBAC roles, because those verbs reveal values to anyone who holds them.

Pod Security Standards

Apply the restricted Pod Security Standard to the namespace that runs Medplum so containers cannot run as root, escalate privileges or mount host paths. Check that the Helm chart's security context settings satisfy the restricted profile before enforcing it, and use the warn and audit modes first to find violations. Record any exception as a documented decision with an owner, since an exception on the API pods affects every request path.

Patching tied to Medplum's security targets

Medplum commits to security patches within 7 days for critical vulnerabilities (CVSS 9.0 or higher) and 14 days for high ones (CVSS 7.0 to 8.9), so your own change window should fit inside those deadlines. Patches cover the Medplum images, GKE node pools, Cloud SQL minor versions and Redis, and each has its own schedule. Confirm with your team who approves an out-of-cycle node upgrade, and rehearse it in a non-production project first.

Medplum versions policy

Running upgrades on a GKE deployment without skipping versions

The main rule for upgrading a self-hosted Medplum deployment on GKE is that every minor version must be applied in sequence. Medplum's upgrading guide is explicit that skipping versions, for example moving from v3.1.2 straight to v4.3.4, causes startup failures. Plan the path from your current version to your target as a list of intermediate minor releases, and treat each one as its own deployment with its own verification. Patch releases ship weekly, so the sequence is usually about minor versions, but confirm each step against the Medplum upgrading guide before you schedule the window.

Data migrations are the part of the change window that is hardest to estimate. Medplum's guide notes that post-deploy data migrations can run for hours or days on large datasets, and those migrations run against the Cloud SQL PostgreSQL instance your Terraform provisioned. Ask your team to measure current row counts and table sizes in a staging copy restored from a recent backup, run the upgrade there, and record how long each migration takes. Confirm with Medplum how rollback works for each step, because a migration that has already changed the schema may not be reversible by redeploying the previous Helm release.

Kubernetes changes belong in the same change window, not a separate one. The Kubernetes version skew policy requires kube-apiserver to be upgraded one minor version at a time, before kube-controller-manager, kube-scheduler and kubelets, and allows kubelets to be up to three minor versions older than kube-apiserver. GKE manages the control plane and node pools, but your team still chooses the target version, the node pool upgrade strategy and the maintenance window. Before any upgrade, take a verified backup of the Cloud SQL instance and confirm who owns GKE control plane backups and etcd recovery in your environment, since Google's managed etcd does not replace a documented restore plan you have tested.

Questions buyers ask before deploying Medplum on GCP

Who pays for the Google Cloud resources, and what do they cost each month?

The organization pays Google Cloud directly for every resource in its own project, including the GKE cluster nodes, Cloud SQL for PostgreSQL, Redis, Cloud Storage, load balancing, Cloud Armor and logging. Google bills those resources, so the figure depends on node counts, database size and traffic, and Google's pricing calculator is the right tool for an estimate. A partner's fee is separate and covers planning, Terraform work and handover. Ask any partner to show which cloud costs are included in its quote and which stay with your account. Recurring costs continue after launch, while the build fee is usually one-time.

What skills does the team need to run Medplum on GKE?

Plan for people who can operate Terraform state, a Google Cloud project with IAM, and a Kubernetes cluster with Helm releases. The team also needs PostgreSQL and Redis knowledge for troubleshooting, and someone who can read Medplum's upgrade notes. Kubernetes is open source under Apache 2.0, and its version skew policy requires control plane components to be upgraded one minor version at a time, so upgrades need a named owner. Medplum's GCP deployment is marked Beta, so your team should also be comfortable reviewing Terraform changes before applying them.

How long does a Medplum deployment on GCP take to build?

Duration depends on scope: whether you need a single environment or separate staging and production, how many identity providers you connect, how email and binary storage are configured, and whether your compliance team must review the infrastructure before go-live. Cloud account approvals, domain and certificate validation, and security review often take longer than the Terraform apply itself. Ask a partner for a written schedule tied to named milestones and client dependencies. Your own team's availability is often the main driver of the calendar.

What do we need to provide before the work starts?

Expect to provide a Google Cloud organization or project with billing enabled, IAM roles that let the implementers create networking, GKE, Cloud SQL, storage and secrets, and a domain you control for the Medplum base URL and app URL. You also need a working email sender for invites, password resets and MFA codes, and named owners for compliance, security review and sign-off on identity settings. Name the person who approves infrastructure changes and the person who receives the handover. Confirm these items in the written scope before work begins.

Can our internal team deploy Medplum on GCP without a partner?

Yes, if your team has the cloud, Kubernetes and healthcare compliance skills to own the result. Medplum publishes Terraform-based GCP deployment material and a Helm chart, so an experienced platform team can follow the documentation. The harder work is the decisions around them: network boundaries, Secret Manager ownership, Cloud Armor rules, backup and restore testing, and evidence for auditors. A partner is most useful when your team lacks capacity, needs an independent review, or wants a documented handover. DeployOpen implements and hardens self-hosted platforms in your own cloud accounts, and its scope is agreed in writing before work starts.

What changes if we use a Medplum hosted plan instead?

A hosted plan moves infrastructure operation, upgrades and much of the hosting work to Medplum, so your team no longer runs the GKE cluster, databases or certificates. Medplum's pricing page lists hosted plans, including Production at $2,000 per month and Premium at $6,000 per month, plus custom-priced Enterprise, and it lists standard BAA and MSA agreements on paid cloud plans. Self-hosting is available as a free Community option or as custom-priced Enterprise Self-Hosted. Compare the recurring hosted fee with your own cloud, staffing and operations cost, and confirm which identity providers and compliance evidence each plan includes. Medplum's compliance documentation states that compliance is a shared responsibility between Medplum and its customers, so self-hosting keeps more of that work with you.

What does ongoing operation of a self-hosted Medplum on GCP involve?

Ongoing work includes applying Medplum releases in the documented sequence, since self-hosted Medplum must be upgraded through each minor version and skipping versions causes startup failures. Medplum ships patch versions weekly and targets security patches within 7 days for critical vulnerabilities and 14 days for high ones, so you need a patching window and an owner. You also need tested backups of PostgreSQL, monitoring of GKE and Cloud SQL, cloud cost reviews and periodic access reviews. A retainer can cover this work, and the scope and response expectations should be written before it starts.

How DeployOpen works on this

DeployOpen plans and implements self-hosted Medplum inside your own Google Cloud projects, so your team keeps control of the VPC, GKE cluster, Cloud SQL data and secrets. The work starts with a written scope that sets out which parts of the Beta Terraform path are used, what is customized, and what your team operates afterward.

How we scope

  • Written scope covers the Google Cloud projects, regions, VPC layout and GKE cluster design you approve before build starts.
  • Scope names each Terraform module, Cloud SQL, Cloud Storage and Redis choice, and the Cloud Armor WAF rules included.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing; a quote follows from that written scope.

How we build

  • Infrastructure is built as Terraform code in your repository, with plans reviewed by your platform and security teams.
  • Helm chart values, Google-managed certificates and Secret Manager entries are configured and tested in a non-production project first.
  • Security testing of the ingress, WAF rules, service accounts and network paths is carried out before go-live.

How we hand over

  • You receive the Terraform code, Helm values, runbooks and a record of configuration decisions, stored in your version control.
  • Handover includes a documented Medplum upgrade path that follows each minor version in sequence, with your team walked through it.
  • Compliance evidence such as access settings, logging and change records is organized for your own assessors; DeployOpen does not issue certifications.

How we support

  • Ongoing support, upgrades and continuous security testing are available as retainers after handover.
  • Retainer scope is agreed in writing and can cover Medplum version upgrades, GKE node pool and Kubernetes version changes, and patch review.
  • Ask for the retainer terms, response expectations and included testing before you commit, so your team knows what is covered.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.