Installation

This page walks through setting up Captain BYOC in your own cloud account. Your team does the whole install with one script, and the Captain team supports you at every step, without needing access to your project for the install itself.

For an introduction to what BYOC is and how it works, read What is BYOC? first.

Requesting an install

Before anything is installed, tell the Captain team two things: which cloud you are using (Google Cloud or AWS) and which region the install should go into, for example us-central1.

In return Captain sends you the release: the installer, which is install.sh with its Terraform module, the Helm chart, and an offline bundle of the container images that you load into a registry in your own project. Captain does not need a credential for your project to install it.

Deploying the install

The BYOC Quickstart walks through a first install step by step, from the tools you need to a search against the running install, with every command and what it prints. The sections below explain what the installer creates and every option the Quickstart leaves at its default.

Infrastructure

The cloud step of the installer creates, in your project:

  • A private network whose firewall refuses the internet, except HTTPS through the install's proxy to the hosts its settings name
  • A GKE cluster with private nodes and three node pools
  • A Postgres database (Cloud SQL) with a private address only
  • A Cloud Storage bucket for files, work files and snapshots
  • A private image registry (Artifact Registry)
  • One Google service account for each group of pods, bound through workload identity
  • The install's secrets in Secret Manager, and a Cloud KMS key that seals the credentials of your source buckets
  • A private endpoint for the US model host, and a log bucket in the install's region

If people reach the install from another region of your network, for example through a VPN or an interconnect that lands in a different region, set global_access = true in terraform.tfvars. It is off by default and changes no address.

Terraform runs on your machine, under your identity, and keeps its record of what it created in a state bucket in your project. Captain takes no part in this step.

StepWhat happensTime
1Shows the Terraform plan and asks to continue1 minute
2Creates the network, identities, secrets, registry and bucket2 minutes
3Creates the cluster and its node pools10 minutes
4Creates the database, alongside step 35 minutes
5Checks that the chart in your registry is the one the release namesSeconds
6Installs the software and runs database changes3 to 4 minutes
7Runs the install checkUnder 1 minute

Application

When the cloud resources exist, the software step puts these components on the cluster:

  • API and MCP server: collections, indexing, query, sync and sign-in
  • Web app: the signed-in application
  • Workers and Captain workflows: read, chunk, tag and embed files, as tracked jobs
  • Parser: turns PDFs into text, tables and figures
  • Captain Vector DB: stores vectors, chunk text and the keyword index

The last step is the install check. It calls every service the install depends on once: Postgres, the bucket, each model and each fallback, Captain workflows and Captain Vector DB. If any of them refuses, the install stops and tells you which one refused and why. Run it again whenever you like:

./install.sh check

Once the check passes, the first person to open the app creates the admin account.

Sync sources

A sync keeps a collection in step with a bucket or a library. Nothing outside your network ever calls the install: each source puts its changes where the install can read them over outbound HTTPS, and a scheduled pass catches anything that was missed. An Admin creates a sync in the app's Sync page, or with the API.

Google Cloud Storage. A bucket in the install's project, or in another project, works with the install's own Google identity and no key. Its changes arrive through a Pub/Sub subscription.

Amazon S3 and Azure Blob. The install signs in as itself, because AWS and Azure are set to trust the install's Google identity, so no access key is stored. To set one up:

  1. Set sync_other_clouds = true in terraform.tfvars and run ./install.sh cloud. This lets the install's outbound proxy, captain-sync-proxy, send HTTPS to your sources.
  2. Apply the Terraform module for your cloud (byoc/terraform/sync-sources/aws or byoc/terraform/sync-sources/azure) in the account that holds the bucket. It creates the change queue and a read-only role that trusts the install.
  3. Add the module's helm_sync_source output to sync.sources in values.customer.yaml and run ./install.sh software.
  4. Create the sync in the app, or with POST /v2/collections/<collection>/sync/s3 or /sync/azure.

SharePoint. Captain reads a document library, or one folder in it, with your own Entra ID app registration and read access only. To set one up:

  1. Register an app in Entra ID and give it the Graph permission Sites.Selected, with a read grant on each site Captain should see.

  2. Add your tenant to values.customer.yaml and run ./install.sh software. This allows Entra ID sign-in, Microsoft Graph and your SharePoint host, and nothing else.

    sync:
      sources:
        - {name: policies, provider: sharepoint, tenant_host: contoso.sharepoint.com}
  3. Open Sync as an Admin, choose Add SharePoint source, enter the tenant id, the client id, the secret or certificate and the site's address, and choose Test connection. Then pick the library and the collection, and the first sync starts.

GET /v2/sync-sources shows when each source last read its changes and its last error.

How the release reaches your project

A release is a fixed set of container images and one Helm chart, and Captain sends it to you as the installer kit and an offline image bundle. The file release.yaml in the installer kit names the chart and every image by digest, and the cluster pulls all of them from one registry in your own project, so nothing is fetched from Captain while the install runs. Set release_source = "bundle" in the variables file, then load the registry yourself between the cloud step and the software step:

sha256sum -c captain-<version>.tar.sha256
./install.sh cloud
tar -xf captain-<version>.tar && cd captain-<version>
./load.sh <region>-docker.pkg.dev/<project>/<name>-release
cd ../byoc && ./install.sh install

The loader, load.sh, pushes each image and the chart into your registry, reads each one back, and compares it with the digest in release.yaml. It stops at the first one that does not match. Once an install has chosen where its images come from, a later run that would change that choice stops before it changes anything, because switching would replace the registry your pods pull from.

Ongoing updates

Captain prepares each patch and each new version of the Helm chart and the images, and sends it to you in the same form as every release. It is applied with the same installer, either by your team or by Captain's support team with access that you grant for that purpose, which is limited to the install and which you can withdraw at any time.

An upgrade uses the same command as an install. Unpack the new installer kit, load its image bundle with load.sh, set the same state bucket, and run:

./install.sh install

The installer applies an upgrade in an order that keeps the install serving:

  • Database changes run before any new pod starts. If a change fails, the upgrade stops and the old version keeps serving.
  • Pods are then replaced one at a time, and each part keeps a disruption budget so that it is never left without a running copy.
  • A release never edits a database change that an earlier release already shipped, so an upgrade does not rewrite history that your database has applied.

GKE itself is upgraded by Google on the release channel you set (release_channel, which is REGULAR by default).

The install can also tell you when a newer release exists, without updating itself. Captain publishes a signed release list, and an Admin sees the version the install runs and any newer one in Settings, Installation, Updates. Either upload the list file that comes with each release, or name the address Captain support gives you under updates.url in values.customer.yaml and the install reads it on a schedule. The install accepts a list only when one of Captain's release keys signed it.

To change a single setting without upgrading, edit values.customer.yaml and run only the software step:

./install.sh software

Encryption keys

With cmek = { enabled = true }, every store the install keeps data in is encrypted with a key in your Cloud KMS instead of a key that Google holds. The installer creates one key for each store and sets each to rotate every 90 days. The Security page lists the stores and their keys.

cmek = { enabled = true }
# or, a key ring you made, in the install's region:
# cmek = { enabled = true, key_ring = "projects/KMS_PROJECT/locations/REGION/keyRings/RING" }

Choose CMEK at the first install. It has run on installs made from scratch, one under an organization policy that refuses any store without a customer key, and one together with the US-only model endpoint. Turning it on for an install that is already running makes Terraform replace the following resources, because Google cannot change their key in place:

  • The database (Cloud SQL). The replacement is a new, empty database, so export the data first and import it afterwards.
  • The image registry (Artifact Registry).
  • The node pools (GKE), which restarts every pod.

Captain Vector DB's disks cannot take a new key either. The upgrade stops with a message, and the disks have to be rebuilt from a snapshot. Bucket objects and secret values that already exist keep Google's key until they are rewritten.

Uninstall

Deletion protection is on by default, so that a mistaken command cannot remove the database or the bucket. To uninstall, first set deletion_protection = false in terraform.tfvars, apply that change with the cloud step, and then run the uninstall:

./install.sh cloud
./install.sh uninstall

On a trial install the uninstall took 16 minutes. It removes everything the installer created, with the exceptions in the right-hand column.

RemovedLeft behind
The software and its namespaceThe Terraform state bucket. It holds the record of what was removed, and every generated secret. Delete it once you are sure
Captain Vector DB's disksThe encryption key ring. Google never deletes key rings. Its keys are scheduled for destruction
The database and its backupsGoogle's Admin Activity audit logs, which Google keeps 400 days
The bucket, with uploads, work files and snapshotsFiles in your own source buckets. The install never deletes them
The cluster, network, identities, secrets and registryAnything you created yourself: DNS records, the VPN, model provider keys

Troubleshooting a first install

These are the messages most often seen on a first install, with what causes each one.

Message or symptomCauseWhat to do
The installer stops before it changes anything and names TF_STATE_BUCKETNo state bucket was namedExport the same bucket name on every run
A model line in the install check says it was not found or the project has no accessGoogle closes older models to projects that never used them, or Claude is not switched onName a current model, or switch Claude on in Model Garden
The chat line starts with "FALLBACK IN USE"Claude is not enabled for the projectEnable it, or keep the fallback
An organization policy blocks the applyA policy the install does not expectSend the policy's name to your Captain team
The registry was not loadedThe offline bundle was chosen and load.sh has not runRun the load.sh line the installer prints
Was this page helpful?