Skip to main content

EspoCRM on GKE Autopilot

EspoCRM on GKE Autopilot

EspoCRM is an open-source, GPLv3-licensed Customer Relationship Management (CRM) platform built on PHP and Apache. This module deploys EspoCRM on GKE Autopilot on top of the App_GKE foundation, which provisions and manages the shared Google Cloud and Kubernetes infrastructure.

This guide focuses on the cloud services EspoCRM uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics that are common to every GKE application — Workload Identity, ingress, autoscaling, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_GKE foundation guide rather than repeating them here.


What EspoCRM costs on RAD, and how that compares​

In a Google Cloud project you own, EspoCRM on RAD's GKE Autopilot module costs about US$110 a month, plus US$11 once per deployment and no per-user licence. For the lowest cost, the Cloud Run module runs the same EspoCRM for about US$84 a month. EspoCRM is a free, open-source CRM that manages accounts, contacts, leads, opportunities and cases. Figures are as at 8 October 2026; sources are listed at the end of this section.

If this runs in a project RAD manages for you, it can be deleted and restored within 30 days for a few credits instead of sitting there running — so an occasional-use deployment costs a few dollars a month, not US$110. See Pause it for free, below.

What you pay on RAD​

In a Google Cloud project you ownIn a project RAD manages for you
Module fee, once per deployment110 credits (US$11 at the top-up price)99 credits (10% lower)
Build timeA few credits per buildThe same
Google Cloud running costBilled by Google to your own billing account, about US$110 a month for the default configuration (table below)Metered hourly in credits; RAD publishes 99 credits a day, about 2,970 a month (about US$297 at the top-up price)
Who owns whatYou own the project and its billing; RAD deploys and updates itRAD owns the project, with guardrails, quotas and budget alerts; you get console access, and a minimum purchased balance is held in reserve

10 credits cost US$1 on a one-off top-up, and less on a monthly plan. In a project RAD manages, the database, file server and network are shared by every application in the project, so a second application does not add a second database.

Default running cost in your own project (us-central1, Google list prices):

Resource (module default)Per month
GKE Autopilot pod, 1 vCPU / 2 GiB, running all the timeUS$40
Cloud SQL for MySQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSDUS$51
NFS/cache file server: a small VMUS$13
Cloud NAT gateway and IP addressUS$5
Cloud Storage for add-ons and backupsUS$1
Totalabout US$110

GKE's free tier covers the management fee of one Autopilot or zonal cluster per billing account, so the total above assumes this is that cluster; otherwise add about US$73 a month.

How it compares​

EspoCRM has its own official hosted plan, EspoCRM Cloud: EspoCRM's own official hosted plans are £11/user/month (Basic, minimum 3 users), £19/user/month (Enterprise, minimum 5 users) and £49/user/month (Ultimate, minimum 10 users) — read 8 October 2026.

OptionPer monthWho runs it
EspoCRM Cloud, Basic (3 users min.)£33/mo (3 × £11)EspoCRM
EspoCRM Cloud, Enterprise (5 users min.)£95/mo (5 × £19)EspoCRM
RAD, GKE Autopilot, your own projectUS$110, plus US$11 onceRAD's automation, in your project
RAD, GKE Autopilot, a RAD-managed projectabout 2,970 credits (US$297)RAD
RAD, Cloud Runabout US$84; see the Cloud Run guideRAD

EspoCRM Cloud's price was read from its own pricing page on 8 October 2026 and may have changed since — check the source before relying on the figure.

  • EspoCRM Cloud is the fixed comparison; a self-managed server is the flexible one. On your own Hetzner or DigitalOcean box (2 vCPU/4GB, about US$24/month) or a GCP Compute Engine e2-standard-2 (2 vCPU/8GB, about US$49/month) you would pay less in cash than either option, but you run the operating system, the database, backups, security patches and upgrades yourself — exactly what RAD's managed Cloud SQL, Secret Manager and monitoring do for you.
  • A cheap server is cheap until something breaks. On RAD, backups, point-in-time recovery, password rotation through Secret Manager, and logging and monitoring come from Google Cloud by default. On your own server, or on a fixed-price hosted plan with no infrastructure control, each of those is a job someone still has to do or a limit you cannot change.

Pause it for free: delete a RAD-managed project, restore it when you need it​

If EspoCRM runs in a project RAD manages for you, you have an option beyond scaling down: delete the whole project, and restore it within 30 days for close to nothing. This suits a deployment you only need occasionally — studying for a certification, a demo, a seasonal need — far better than running it continuously.

  • How it works. Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project. Google does not remove it immediately: it keeps it, recoverable, for 30 days, and because billing is already unlinked, nothing is charged while it waits. Unlike deleting one module, this does not tear down Cloud SQL, the VM or GKE Autopilot one by one — the whole project, and everything in it, simply stops.
  • Restoring costs a handful of credits, not a rebuild. Within 30 days, the project's owner can restore it. RAD asks Google to undelete the project and reattaches its billing account, then asks you to run Update on each deployment to confirm everything came back. Because nothing was individually destroyed, that Update finds the same resources already there — it is a check, not a rebuild, and an Update never charges the module fee again. That costs a handful of build-time credits in total (under US$1) for a typical 2–3-deployment chain.
  • So a month of occasional use can cost a few dollars, not US$110. Deploy EspoCRM, use it for a session, delete the project. Restore it next time you want it, confirm with Update, and delete it again when you're done. You pay only for the module fee once, the builds, and whatever hours it was actually live.
  • What this needs. You must own the project (not a bring-your-own one RAD only manages billing for), and you restore it yourself within the 30 days — after that, Google deletes it for good. Restoring is admitted like creating a new project: your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study/demo use fits). Google says most services are fully working again within 36 hours of a restore.
  • One real gap: nightly backups do not survive. Backups are written to a bucket inside the project, and that bucket has Cloud Storage's soft-delete explicitly turned off, so it is very likely gone as soon as you delete the project — even though the project itself is recoverable for 30 days. If you've customised this deployment and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before deleting. For a default install with nothing irreplaceable in it, this does not matter.

Pay only while you use it, the other way: delete and redeploy​

GKE keeps at least one pod running, so EspoCRM never scales to zero on its own. The option above only applies to a RAD-managed project; in your own project, or once the 30-day window has passed, the way to stop paying is to delete the deployment and deploy it again when you need it.

  • What a redeploy costs. The module fee again plus the builds: about 115 credits (US$11.50). Deleting saves money if EspoCRM would otherwise sit unused for about 4 days or more in your own project (about US$3.67 a day), or about 2 days or more in a RAD-managed one (99 credits a day).
  • Delete everything EspoCRM uses. Most of the running cost is usually the database and any shared file/cache VM. They stop only when nothing else in the project uses them, so deleting this app while something else shares the project saves only this app's own compute part.
  • Keep data first. Nightly backups go to a bucket inside the deployment and are deleted with it, so copy the latest backup out before deleting if you want to keep it.
  • Note your settings. RAD does not recreate a deleted deployment for you; you enter the settings again when you deploy.

Lab sessions and Managed Environments​

  • Lab sessions, for training. A trainer runs a session for a class. Each participant gets EspoCRM in their own Google Cloud project for 15 minutes to 24 hours, within an allowance the trainer sets. Either the trainer funds every place, or each participant pays for their own. Everything is deleted when the session ends and unused credits go back to the trainer.
  • Managed Environments, for consultancies. A partner runs the app for a client from a ring-fenced wallet it funds, and settles with the client directly. If the wallet runs low, billing pauses and the data is kept, so nobody receives an unexpected charge. At the end the partner hands the project over and the deployments become the client's own.

Credits can be bought in more than 20 currencies, including XAF, XOF, NGN, GHS, KES and ZAR, by card, bank transfer or mobile money.

Sources (8 October 2026): Google Cloud list prices from the Cloud Billing Catalog API; RAD's own fees and daily-credit estimate from radmodules.dev/pricing; Delete and restore projects for the pause/restore mechanism; EspoCRM Cloud pricing. Prices change; check each source before relying on a figure.

1. Overview​

EspoCRM runs as a PHP/Apache web workload. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeGKE AutopilotApache/PHP pods, 1 vCPU / 2 GiB by default, horizontally autoscaled
DatabaseCloud SQL for MySQL 8.0Required — EspoCRM does not support PostgreSQL; reached via the Auth Proxy sidecar
Object storageCloud Storage + NFS (Filestore)gcs-espocrm<tenant-prefix>-espocrm-data bucket; shared NFS mounted at /var/www/html/data for uploads
CacheRedis (optional)Optional object cache; disabled by default
SecretsSecret ManagerAuto-generated ESPOCRM_ADMIN_PASSWORD; database password
IngressCloud Load BalancingExternal LoadBalancer, optional custom domain + managed certificate

Sensible defaults worth knowing up front:

  • MySQL 8.0 is mandatory. The database engine is fixed by the shared application layer (database_type = "MYSQL_8_0"); EspoCRM does not support PostgreSQL.
  • The database is reached through the Auth Proxy sidecar on loopback. The GKE variant overrides DB_HOST = "127.0.0.1" so EspoCRM dials the co-located Cloud SQL Auth Proxy sidecar on 127.0.0.1:3306; enable_cloudsql_volume = true by default.
  • The admin account is bootstrapped automatically. The upstream installer creates the admin user with the auto-generated ESPOCRM_ADMIN_PASSWORD on first boot — retrieve it from Secret Manager to log in.
  • Schema is created on first boot, not by a migrate job. db-init creates the database and user; the upstream docker-entrypoint.sh then runs the install/migrate action automatically when the pod starts.
  • NFS is enabled by default. enable_nfs = true mounts a shared Filestore volume at /var/www/html/data, so EspoCRM's uploaded attachments and runtime data persist across pod restarts and are shared between replicas.
  • Single replica by default. min_instance_count = 1, max_instance_count = 1 — GKE keeps at least one pod running (no scale-to-zero) so the CRM is always reachable.
  • Session affinity is ClientIP by default, routing a client's requests to the same pod — useful once you scale beyond one replica.
  • ESPOCRM_SITE_URL is derived from the service URL so EspoCRM's absolute links and installer checks use the reachable host rather than localhost.

2. Google Cloud Services & How to Explore Them​

All commands assume you have run gcloud container clusters get-credentials <cluster> --region <region> --project <project> and that PROJECT, REGION, and NAMESPACE are set. The namespace and other identifiers are reported in the deployment Outputs.

A. GKE Autopilot — the EspoCRM workload​

EspoCRM pods are scheduled on Autopilot, which bills for the CPU/memory the pods actually request. Horizontal Pod Autoscaling sizes the deployment between the minimum and maximum replica counts. Because the app is NFS-backed, the foundation uses the Recreate update strategy so two pods never write the same NFS volume during a rollout.

  • Console: Kubernetes Engine → Workloads → select the EspoCRM workload to see pods and events. Kubernetes Engine → Services & Ingress shows the external IP.
  • CLI:
    kubectl get pods,svc,hpa -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" deploy/<service-name> --tail=100
    kubectl describe hpa -n "$NAMESPACE" # current vs target utilisation

See App_GKE for how Autopilot, scaling, and the workload type (Deployment vs StatefulSet) are managed.

B. Cloud SQL for MySQL 8.0​

EspoCRM stores all application data (contacts, leads, opportunities, activities, users) in a managed Cloud SQL for MySQL 8.0 instance. Pods reach it privately through the Cloud SQL Auth Proxy sidecar bound to 127.0.0.1:3306; no public IP is exposed. On first deploy an initialization Job creates the application database and user.

  • Console: SQL → select the instance for connections, backups, flags, and metrics.
  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql instances describe <instance-name> --project "$PROJECT"
    # Open an interactive shell to inspect schema/data:
    gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"

The instance name, database name, user, and the Secret Manager secret holding the password are all surfaced in the Outputs. For the connection model, automated backups, and password rotation, see App_GKE.

C. Cloud Storage & NFS​

A dedicated Cloud Storage bucket (gcs-espocrm<tenant-prefix>-espocrm-data) is provisioned automatically, and a shared NFS (Filestore) volume is mounted at /var/www/html/data for EspoCRM's uploaded attachments and runtime data. The workload service account is granted access to the bucket.

  • Console: Cloud Storage → Buckets; Filestore → Instances.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"
    gcloud filestore instances list --project "$PROJECT"
    kubectl exec -n "$NAMESPACE" deploy/<service-name> -- ls -la /var/www/html/data

See App_GKE for CMEK options, GCS Fuse mounts, and the NFS server model.

D. Redis (object cache)​

Redis is disabled by default. When enable_redis = true is set, REDIS_HOST and REDIS_PORT are injected and EspoCRM uses Redis as its object cache backend to reduce database load. When redis_host is left empty and enable_nfs is true, the NFS server VM's IP is used as the Redis endpoint.

  • Console: Memorystore → Redis (if using a managed instance).
  • CLI:
    redis-cli -h <redis-host> ping
    # Confirm the Redis env injected into the running pod:
    kubectl exec -n "$NAMESPACE" deploy/<service-name> -- env | grep REDIS

E. Secret Manager​

The first-run admin password (ESPOCRM_ADMIN_PASSWORD) is generated automatically and stored in Secret Manager, then injected into the pod as a secret env var via the Secret Store CSI driver. The database password is managed separately by the foundation.

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT" --filter="name~espocrm-admin-password"
    gcloud secrets versions access latest --secret=<secret-name> --project "$PROJECT"

The database password secret name is in the Outputs. See App_GKE for the Secret Store CSI integration and rotation.

F. Networking & ingress​

By default the workload is exposed through an external Cloud Load Balancing IP (service_type = LoadBalancer). A custom domain with a Google-managed certificate can be enabled, and a static IP can be reserved so the address survives redeploys.

  • Console: Network services → Load balancing; VPC network → IP addresses.
  • CLI:
    kubectl get ingress,svc -n "$NAMESPACE"
    gcloud compute addresses list --project "$PROJECT"

See App_GKE for custom domains, Cloud CDN, and static IP details.

G. Cloud Logging & Monitoring​

Pod stdout/stderr flow to Cloud Logging; GKE and Cloud SQL metrics flow to Cloud Monitoring. Optional uptime checks and alert policies are available. The cloud-entrypoint.sh prints the resolved ESPOCRM_DATABASE_* and ESPOCRM_SITE_URL values at pod start — a quick way to confirm the DB host and site URL.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud logging read 'resource.type="k8s_container" AND resource.labels.namespace_name="'"$NAMESPACE"'"' \
    --project "$PROJECT" --limit 50

3. EspoCRM Application Behaviour​

  • First-deploy database setup. An initialization Job runs db-init.sh using mysql:8.0-debian. It resolves the Cloud SQL connection (Auth Proxy socket if present, otherwise TCP), idempotently creates the application database and user, grants privileges, and verifies the app user can connect (warming the MySQL 8 caching_sha2_password auth cache). The job runs on apply and is safe to re-run.
  • Schema created on first boot. There is no separate migrate job. Once db-init has provisioned the database, the upstream EspoCRM docker-entrypoint.sh runs the install/migrate action automatically on pod start, creating the schema and the admin user.
  • Admin login is auto-generated. The admin user's password comes from the ESPOCRM_ADMIN_PASSWORD secret. Retrieve it before your first login:
    gcloud secrets versions access latest \
    --secret="secret-<resource_prefix>-espocrm-admin-password" --project "$PROJECT"
    Change it in the EspoCRM UI (Administration → Users) once you are in.
  • Uploads persist on NFS. With enable_nfs = true (default), EspoCRM's attachments and runtime data live under the shared /var/www/html/data Filestore mount, surviving pod restarts and shared across replicas.
  • Site URL must match the reachable host. EspoCRM builds absolute links from ESPOCRM_SITE_URL; the entrypoint sets it from the service URL. After the LoadBalancer IP or custom domain is known, ensure the site URL reflects the external host so links and OAuth redirects are correct.
  • Health path. Both the startup and liveness probes are HTTP GET / — EspoCRM serves its login page there unauthenticated (200). The startup probe (startup_probe_config) defaults to a 10-second initial delay, 10-second period, and 3-failure threshold; the liveness probe (health_check_config) defaults to a 15-second initial delay, 30-second period, and 3-failure threshold. These are noticeably tighter than the Cloud Run variant's defaults — on a slow first boot (the install/migrate step), pods can flap before EspoCRM finishes initializing; raise the initial delay / failure threshold via startup_probe_config / health_check_config if you see this.
  • Inspect job execution:
    kubectl get jobs -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" job/<job-name>

4. Configuration Variables​

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for EspoCRM are listed; every other input is inherited from App_GKE with its standard behaviour and defaults.

Group 3 — Application Identity​

VariableDefaultDescription
application_nameespocrmBase name for resources. Do not change after first deploy.
application_versionlatestImage tag for espocrm/espocrm; latest is pinned internally to 10.0.2. Pin to a specific release in production.
php_memory_limit512MPHP memory limit; raise for heavy plugins or large media.
upload_max_filesize / post_max_size64MUpload / POST size limits; post_max_size must be ≥ upload_max_filesize.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
cpu_limit1000mCPU per pod; minimum 1 vCPU for EspoCRM + MySQL.
memory_limit2GiMemory per pod; minimum 512Mi (PHP 8.x).
min_instance_count1Minimum replicas; GKE keeps ≥ 1 so the CRM is always reachable.
max_instance_count1Maximum replicas. Increase only with shared NFS + ClientIP affinity confirmed.
container_port80Apache listens on port 80.
enable_cloudsql_volumetrueCloud SQL Auth Proxy sidecar (loopback 127.0.0.1:3306).

Group 6 — GKE Backend & Cluster​

VariableDefaultDescription
service_typeLoadBalancerHow the Kubernetes Service is exposed.
workload_typenull (Deployment)Deployment (default) or StatefulSet with per-pod PVCs.
session_affinityClientIPSticky routing to the same pod.

Group 13 — Filesystem (NFS)​

VariableDefaultDescription
enable_nfstrueMount a shared Filestore volume for EspoCRM uploads/runtime data.
nfs_mount_path/var/www/html/dataContainer mount path for the NFS volume.

Group 15 — Redis Cache​

VariableDefaultDescription
enable_redisfalseEnable Redis as EspoCRM's object cache backend.
redis_host""Redis endpoint. Leave empty to use the NFS server IP.
redis_port6379Redis port.

Group 16 — Database Backend​

VariableDefaultDescription
database_typeMYSQL_8_0 (EspoCRM_Common also sets MYSQL_8_0 in its config output)Cloud SQL engine. EspoCRM requires MySQL — do not select PostgreSQL.
application_database_nameespocrmMySQL database name. Immutable after first deploy.
application_database_userespocrmApplication database user. Password auto-generated in Secret Manager.

All other inputs follow standard App_GKE behaviour.


5. Outputs​

These values are returned on a successful deployment and are the quickest way to locate and explore the running resources.

OutputDescription
service_nameKubernetes Service name.
namespaceNamespace the workload runs in.
service_cluster_ipIn-cluster ClusterIP.
stage_service_cluster_ipsMap of ClusterIPs for stage-specific services.
service_external_ipExternal LoadBalancer IP (when a static IP is reserved).
service_urlURL to reach EspoCRM.
database_instance_nameCloud SQL instance name.
database_nameApplication database name.
database_userApplication database user.
database_password_secretSecret Manager secret holding the DB password.
database_host / database_portDB endpoint (127.0.0.1 via the Auth Proxy) / port.
storage_bucketsCreated Cloud Storage buckets.
network_name / network_exists / regionsVPC network, presence, available regions.
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / monitoring_notification_channelsMonitoring status and channels.
initialization_jobs / db_import_jobNames of the setup (db-init) and (optional) import jobs.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / cicd_configurationCI/CD status and details (repo, trigger, registry).
github_repository_url / github_repository_owner / github_repository_nameCI/CD GitHub details.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.
kubernetes_readyWhether the cluster/workload is ready.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC status.
audit_logging_enabled / artifact_registry_cmek_enabledAudit logging and CMEK status.

6. Configuration Pitfalls & Sensible Defaults​

Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).

Inherited plan-time validation. This module passes its configuration through the App_GKE foundation engine, which validates values and combinations at plan time — binary-unit memory quotas, a StatefulSet conflict, IAP with no authorized identities, an out-of-range redis_port/backup_retention_days. Invalid configuration fails the plan with a clear, named error before any resource is created, so most mistakes below are caught up front rather than at apply or runtime.

SettingSensible valueRiskConsequence if wrong
database_typeMYSQL_8_0CriticalEspoCRM only supports MySQL; selecting PostgreSQL breaks startup.
application_database_name / application_database_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all data.
ESPOCRM_ADMIN_PASSWORD (auto-generated)Retrieve from Secret Manager; change in UICriticalOnly sets the admin password on the first install; losing it locks you out until reset via DB.
enable_nfstrueCriticalDisabling it stores uploads on ephemeral pod disk — attachments are lost on pod restart/reschedule.
DB_HOST (overridden to 127.0.0.1)Leave as-isHighEspoCRM dials the Auth Proxy sidecar on loopback; changing it breaks DB connectivity.
enable_cloudsql_volumetrueHighThe Auth Proxy sidecar is required for MySQL connectivity on GKE.
ESPOCRM_SITE_URL (auto-derived)External LoadBalancer / custom-domain URLHighA wrong site URL breaks absolute links, the installer check, and OAuth redirects.
memory_limit2GiHighBelow 512Mi PHP 8.x OOM-kills during install/migrate and under load.
max_instance_count1 unless affinity + NFS confirmedHighScaling with a RollingUpdate on an NFS-backed app can deadlock; the foundation uses Recreate for NFS apps.
session_affinityClientIPMediumWithout stickiness, multi-replica sessions bounce between pods.
quota_memory_requests / _limitsbinary units (4Gi, 8192Mi)CriticalBare integers are bytes and block all pod scheduling in the namespace.
enable_iaponly when public UI not neededMediumIAP requires Google sign-in for every request, including API integrations.
application_versionPin in productionMediumlatest maps to a pinned tag internally, but pinning explicitly avoids surprise upgrades on redeploy.

For the foundation behaviour referenced throughout — IAM and Workload Identity, autoscaling, ingress and certificates, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_GKE. EspoCRM-specific application configuration shared with the Cloud Run variant is described in EspoCRM_Common.

Need RAD to do something it does not do yet? Request it on the roadmap, or vote on what is already there.