Skip to main content
formae runs as a client and an agent. The agent lives in your infrastructure, executes changes, and keeps state in sync with your cloud; you use your local CLI to provision it once, then point the CLI at it with a profile and hand off. See Architecture for the client/agent model. The recommended path is the open-source formae-bootstrap installer. One apply stands up the whole agent (a VPC, a Cloud SQL for PostgreSQL datastore, and a GCE VM running the agent container), secure by default.
This guide covers the GCP bootstrap path. For other clouds, see Install on AWS and Install on Azure.

Choose an access mode

Compute is always a GCE VM on Container-Optimized OS, running the agent container plus a Cloud SQL Auth Proxy sidecar. --access decides how clients reach it. Basic auth is on in both modes.
  • Tailscale (tailnet, default): private, reachable only over your Tailscale tailnet; the agent serves a trusted *.ts.net certificate. No public ingress.
  • Public (public): a global external HTTPS load balancer fronts the agent. Requires a domain you own.

Prerequisites

  • The formae CLI, matching the agent image version. If you have not installed it, see the Quick start.
  • A GCP project, with the required APIs enabled:
  • Local credentials for the formae GCP plugin: either gcloud auth application-default login (user ADC, simplest) or export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa-key.json. Restart the agent after setting them so the plugin picks them up.
  • Tailscale (tailnet mode only): a reusable auth key tagged tag:formae, with HTTPS certificates enabled on your tailnet.
Clone the installer:

Install

You also need a Tailscale tailnet with a tag:formae tag, HTTPS certificates enabled, and a reusable auth key carrying that tag:
  • Sign in at login.tailscale.com/start with an identity provider (the free Personal plan is enough) and note your tailnet name (e.g. tailXXXX.ts.net).
  • DNS tab: enable MagicDNS and HTTPS Certificates (required for the *.ts.net certificate).
  • Access controls → Tags: create a tag named formae (no tag: prefix), owned by yourself.
  • Settings → Keys → Generate auth key: Reusable on, Ephemeral off, Tagstag:formae. Copy the tskey-auth-... value.
1

Generate the API credential

Basic auth validates a bcrypt hash, produced locally:
Keep the printed password for the connect step; the hash goes to the apply. Also pick a stable Cloud SQL postgres password.
2

Apply

Cloud SQL spin-up is the long pole; --watch streams progress.
The agent joins your tailnet as <ts-hostname>.<your-tailnet>.ts.net and serves the API over a trusted certificate on port 49684. Confirm it joined in the Tailscale admin console under Machines.
3

Connect

Your CLI machine must be on the same tailnet (a device can be on only one at a time; use tailscale switch / tailscale login to reach it):
That writes a profile carrying the agent’s URL so your CLI can reach it.

Operate the agent

Day-2 procedures for a bootstrapped agent.

Update

Upgrade the agent the same way you created it: re-apply bootstrap.pkl with a newer image. --formae-image is the version knob; find a target tag on GitHub Releases.
Pass the same flags you applied with (access mode, region, credentials) so the reconcile changes only the image. Then match your local CLI to the new version:
To roll back, re-apply with the previous image tag.
Keep the install you bootstrapped from. The local install you ran bootstrap.pkl from holds the agent’s own infrastructure (the VPC, Cloud SQL database, and VM that are the agent) in its state. That state lives only there, so re-applying bootstrap.pkl to upgrade or change the agent depends on keeping that install and its datastore.

Add extra plugins

The bootstrap image ships the standard plugin set (AWS, Azure, GCP, OCI, OVH, and auth-basic). To manage anything else, build a derived image and pass it as --formae-image. See Extend the agent image.

Tune for production

The bootstrap installer favors a lean default. For production, choose a larger --size as your inventory grows (see the sizing table below), and scope public ingress to your load balancer with a Google-managed certificate rather than a self-signed one.

Tear down

Destroy the stack, then deregister the target:
You may need to run destroy twice. The first pass deletes the agent VM, but its Cloud SQL Auth Proxy connections take a moment to drain, so the formae database delete can fail with pq: database "formae" is being accessed by other users. Re-running destroy once the sessions have been reaped completes the teardown.

Reference

Flags for formae apply ... gcp/bootstrap.pkl:Passing a flag that belongs to another mode fails fast with a clear message.--size maps to a GCE machine type. Memory has a ~2 GB floor regardless of inventory size, because the agent image loads all its bundled resource plugins at once.

See also

  • Manage profiles: connect the CLI to the agent you just started, and switch between environments.
  • Configuration: agent and CLI settings, including authentication.
  • Architecture: how the client, agent, and plugins fit together.