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.
| Step | What happens | Time |
|---|---|---|
| 1 | Shows the Terraform plan and asks to continue | 1 minute |
| 2 | Creates the network, identities, secrets, registry and bucket | 2 minutes |
| 3 | Creates the cluster and its node pools | 10 minutes |
| 4 | Creates the database, alongside step 3 | 5 minutes |
| 5 | Checks that the chart in your registry is the one the release names | Seconds |
| 6 | Installs the software and runs database changes | 3 to 4 minutes |
| 7 | Runs the install check | Under 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 checkOnce 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:
- Set
sync_other_clouds = trueinterraform.tfvarsand run./install.sh cloud. This lets the install's outbound proxy,captain-sync-proxy, send HTTPS to your sources. - Apply the Terraform module for your cloud (
byoc/terraform/sync-sources/awsorbyoc/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. - Add the module's
helm_sync_sourceoutput tosync.sourcesinvalues.customer.yamland run./install.sh software. - Create the sync in the app, or with
POST /v2/collections/<collection>/sync/s3or/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:
-
Register an app in Entra ID and give it the Graph permission
Sites.Selected, with a read grant on each site Captain should see. -
Add your tenant to
values.customer.yamland 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} -
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 installThe 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 installThe 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 softwareEncryption 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 uninstallOn a trial install the uninstall took 16 minutes. It removes everything the installer created, with the exceptions in the right-hand column.
| Removed | Left behind |
|---|---|
| The software and its namespace | The 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 disks | The encryption key ring. Google never deletes key rings. Its keys are scheduled for destruction |
| The database and its backups | Google's Admin Activity audit logs, which Google keeps 400 days |
| The bucket, with uploads, work files and snapshots | Files in your own source buckets. The install never deletes them |
| The cluster, network, identities, secrets and registry | Anything 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 symptom | Cause | What to do |
|---|---|---|
The installer stops before it changes anything and names TF_STATE_BUCKET | No state bucket was named | Export the same bucket name on every run |
| A model line in the install check says it was not found or the project has no access | Google closes older models to projects that never used them, or Claude is not switched on | Name a current model, or switch Claude on in Model Garden |
| The chat line starts with "FALLBACK IN USE" | Claude is not enabled for the project | Enable it, or keep the fallback |
| An organization policy blocks the apply | A policy the install does not expect | Send the policy's name to your Captain team |
| The registry was not loaded | The offline bundle was chosen and load.sh has not run | Run the load.sh line the installer prints |