Skip to main content

Deploy

1

Install the Fly CLI and authenticate

Install flyctl using the official instructions, then log in:
2

Clone the repo and create the app

When prompted, keep the existing fly.toml configuration. The --no-deploy flag prevents deploying before secrets are set.
3

Set secrets

Agent Vault supports additional configuration for SMTP email notifications, domain restrictions, and more. See Environment variables for the full reference.
4

Deploy

On first deploy, Fly will prompt you to create the persistent volume. If it doesn’t, create one manually:
5

Register the owner

The first user to register becomes the instance owner with full admin privileges, auto-granted admin on the default vault.
6

Verify

Key details

  • Config: fly.toml exposes port 14321 via Fly’s HTTP service (force HTTPS, auto-stop/auto-start). The MITM proxy on port 14322 is only reachable via Fly’s private networking (.internal DNS over IPv6) — it is not exposed to the public internet. The server must bind to :: (all interfaces) so the proxy is reachable via Fly’s 6PN IPv6 mesh — pass --host :: instead of --host 0.0.0.0.
  • Agent connectivity: agents connect to the proxy via the private network. Agents running on Fly (same org) use http://<token>:<vault>@your-app.internal:14322. Agents outside Fly connect via WireGuard (fly wireguard create).
  • Entrypoint: scripts/docker-entrypoint.sh forwards arguments to the agent-vault binary, which natively reads AGENT_VAULT_MASTER_PASSWORD from the environment
  • Storage: Persistent volume agent_vault_data mounted at /data — all state is in a single SQLite file
  • Cold starts: min_machines_running defaults to 0, so the app scales to zero when idle. The first request after sleep incurs a few seconds of cold-start latency. Set it to 1 in fly.toml if you need always-on availability.

PostgreSQL with Fly Postgres

For production deployments or to run multiple Agent Vault machines, switch from SQLite to PostgreSQL:
Fly sets DATABASE_URL automatically. Agent Vault detects it and uses Postgres on the next deploy. See the PostgreSQL guide for full setup, migration steps, and configuration details.

Connecting agents

Agents running as Fly apps in the same organization reach the proxy via .internal DNS — no public internet involved.
Fetch the root CA so the agent trusts MITM-signed upstream certificates:
Changing the master password re-wraps the data encryption key without re-encrypting credentials. For single-instance (SQLite) deployments, use agent-vault master-password change while the server is stopped. When using Fly Postgres, scale to zero (fly scale count 0), run agent-vault master-password change --force with DATABASE_URL set, then update the secret with fly secrets set AGENT_VAULT_MASTER_PASSWORD=... and scale back up.