# fly.io

static shell

flyctl picks up the canonical Dockerfile automatically. Just a small fly.toml and `fly secrets set AGENTSITE_TOKEN=...` to deploy.

**Start here first.** Every platform recipe below assumes the canonical Express + Docker install at [/install/express-docker](/install/express-docker). The snippets on this page are the platform-specific deltas on top of that baseline.

Use the canonical Dockerfile. `flyctl` picks it up automatically; you only need a small `fly.toml`.

fly.tomlcopy

```toml
# fly.toml
app = "yoursite"
primary_region = "sjc"

[build]
  dockerfile = "Dockerfile"

[env]
  AGENTSITE_SITE = "https://yoursite.com"
  DIST_DIR       = "/dist"

[http_service]
  internal_port = 3000
  force_https   = true
  auto_stop_machines  = true
  auto_start_machines = true
```

terminalcopy

```bash
# 1. flyctl detects the Dockerfile from the canonical layout.
fly launch --no-deploy --copy-config

# 2. Token as a secret (encrypted, not visible in fly.toml).
fly secrets set AGENTSITE_TOKEN=asit_xxxxxxxxxxxx

# 3. Deploy.
fly deploy
```

**Use `fly secrets set`, not `[env]`.** Secrets are encrypted and don't appear in `fly.toml`; `[env]` is for non-sensitive config (site URL, paths).

[Need help with this recipe? →](/contact)