Docs / Multi-Cloud Runners / Google Cloud

Self-hosted CI runners on Google Cloud

Create a Compute Engine VM that installs the Ferro agent from its startup script and connects out to your control plane. No ingress firewall rule is needed.

Outbound HTTPS only, and no cloud credentials in Ferro

ferro-agent is a single static Linux binary for x86_64 and aarch64. In the default Relay Mode it connects out to your Ferro control plane over HTTPS (443), so the runner needs no inbound ports, and Ferro never holds Google Cloud API credentials for a server you install yourself.

Before you start

  • A Ferro account. The Free plan covers one runner; see the quickstart if you have not signed up yet.
  • The gcloud CLI, authenticated and pointed at the project that will hold the runner.
  • Outbound internet access for the VM: an external IP address, which gcloud assigns by default, or Cloud NAT.

1. Register a node and copy its token

In the dashboard, open Fleet Nodes and choose Add Linux server. Name the node (for example gcp-usc1-c3-01) and leave the direct URL blank to stay in Relay Mode.

Ferro shows the node's frn_... token once, together with a generated bootstrap script, and stores only the token's SHA-256 hash. Copy the token now. In the snippets below, replace https://ferro.example.com with your control plane URL and frn_YOUR_NODE_TOKEN with that token.

2. Create the VM

The command below creates an Ubuntu 24.04 VM whose startup script installs the prerequisites, blocks the metadata server for non-root users, and runs your control plane's installer. Fill in your control plane URL and node token first.

Create the runner with gcloud
# Create an Ubuntu 24.04 runner on Google Cloud Compute Engine (zero inbound VPC firewall rules required)gcloud compute instances create ferro-runner-gcp-01 \  --zone=us-central1-a \  --machine-type=c3-standard-8 \  --image-family=ubuntu-2404-lts-amd64 \  --image-project=ubuntu-os-cloud \  --boot-disk-size=100GB \  --boot-disk-type=pd-ssd \  --no-service-account \  --no-scopes \  --metadata=startup-script='#!/usr/bin/env bashset -euo pipefailexport FERRO_CONTROL_PLANE="https://ferro.example.com"export FERRO_NODE_TOKEN="frn_YOUR_NODE_TOKEN"export FERRO_LABELS="linux,gcp"export DEBIAN_FRONTEND=noninteractiveapt-get update -y && apt-get install -y --no-install-recommends curl ca-certificates git nftables polkitd# Block GCP metadata server (169.254.169.254) for non-root UIDs (ferro / ferro-job)nft add table inet ferro_metadata_guardnft "add chain inet ferro_metadata_guard output { type filter hook output priority 0; policy accept; }"nft flush chain inet ferro_metadata_guard outputnft add rule inet ferro_metadata_guard output ip daddr 169.254.169.254 meta skuid != 0 reject# Install ferro-agent via your Control Plane hosted verified installer (LoadCredential + Polkit + OS sandbox)curl -fsSL --proto "=https" --tlsv1.2 "${FERRO_CONTROL_PLANE}/install-agent.sh" | bash'# Or pass the generated bootstrap script directly from Dashboard → Fleet Nodes → Add Linux server:# gcloud compute instances create ferro-runner-gcp-01 \#   --zone=us-central1-a --machine-type=c3-standard-8 \#   --image-family=ubuntu-2404-lts-amd64 --image-project=ubuntu-os-cloud \#   --metadata-from-file=startup-script=./ferro-bootstrap.sh
  • --no-service-account --no-scopes gives the VM no Google Cloud identity, so a build has no cloud credentials to find.
  • Fleet Nodes also generates a ready-made bootstrap script. Pass it with --metadata-from-file=startup-script= instead of pasting the script inline, as the commented lines at the end of the snippet show.
  • For Arm, pick an Arm machine type and the ubuntu-2404-lts-arm64 image family. The installer detects the architecture.

The node token lives in instance metadata

Instance metadata is readable from inside the VM and by project members who can view the instance. The startup script blocks 169.254.169.254 for non-root users, so CI jobs running as ferro-job cannot read it. If the token is ever exposed, rotate it from Fleet Nodes.

3. Review the VPC firewall

Ferro needs no ingress rule. If the VM is on the default network, that network's pre-populated default-allow-ssh rule still accepts SSH from the internet. Delete the rule, or put the runner on a custom VPC without ingress rules, if you want it closed to inbound traffic.

4. Check that the runner is online

Within a few seconds of the service starting, the node turns online in Fleet Nodes. If it does not, connect over SSH or the serial console and check the service:

Check the agent service, its logs, and the local health endpoint
sudo systemctl status ferro-agentsudo journalctl -u ferro-agent -n 50 --no-pagercurl -kfsS https://127.0.0.1:7420/health

Still offline? See Troubleshooting.

Good to know

  • Ferro does not create or scale Compute Engine VMs for you. Each VM is a runner you register once and keep warm, which is also what keeps its dependency and build caches on local disk.
  • You pay Google Cloud for the VM and Ferro a flat monthly fee, with no per-minute charge from Ferro.

Next steps