nixfredFLY.IOFIELD GUIDE · BY NIX UNOFFICIAL
LEARN / FLYCTL, MACHINES API, TOKENS

Automation: flyctl, the Machines API, tokens and MCP

Fly.io is a CLI-first platform: flyctl does everything, the Machines REST API is the lower-level path for custom orchestration, and tokens are macaroons you can scope down to one app or one command. There is no Terraform provider, and Fly.io says that is intentional (https://docs.fly.io/blueprints/infra-automation-without-terraform/).

This page is drawn from https://docs.fly.io/flyctl/, https://docs.fly.io/flyctl/install/, https://docs.fly.io/flyctl/integrating/, https://docs.fly.io/launch/create/, https://docs.fly.io/launch/deploy/, https://docs.fly.io/launch/continuous-deployment-with-github-actions/, https://docs.fly.io/machines/api/working-with-machines-api/, https://docs.fly.io/security/tokens/, https://docs.fly.io/networking/dynamic-request-routing/, https://docs.fly.io/model-context-protocol/, https://docs.fly.io/model-context-protocol/agent-skills/, https://docs.fly.io/model-context-protocol/setup-agent/ and https://mcp.fly.io/guide.md (fetched 2026-11-04).

flyctl: install, sign in, the core loop

fly launch and fly deploy

fly launch is run from the project’s source directory. For most languages and frameworks it generates a Dockerfile and usually a .dockerignore, and you edit and commit that Dockerfile yourself (https://docs.fly.io/launch/create/). Framework scanners are strongest for Elixir/Phoenix, Laravel, Rails and Django (https://docs.fly.io/launch/create/). fly launch --no-deploy creates the app and fly.toml without releasing (https://docs.fly.io/launch/deploy/).

fly deploy builds or fetches the image, then updates Machines as a group using the local fly.toml (https://docs.fly.io/launch/deploy/). Facts a support engineer needs:

TopicWhat the docs say
Image choice--image or [build] in fly.toml wins over any Dockerfile; then the [build] method; then --dockerfile; then a Dockerfile in the working directory (https://docs.fly.io/launch/deploy/)
First deployWith no process groups defined, the first deployment gives two Machines for process groups with services, one Machine when a volume is mounted, and one started plus one stopped standby Machine for groups without services (https://fly.io/docs/launch/deploy/, https://fly.io/docs/apps/app-availability/)
Strategiesrolling (default), immediate, canary, bluegreen (https://docs.fly.io/launch/deploy/)
Release commandA one-off command in a temporary VM before release, good for migrations, with no access to mounted volumes (https://docs.fly.io/launch/deploy/)
BuildsRemote by default; --local-only uses local Docker; --image skips building; --buildkit is experimental (https://docs.fly.io/flyctl/integrating/)

Say: “Setting a secret restarts your Machines.” The docs state that fly secrets set triggers a new deployment, and --stage defers it (https://docs.fly.io/launch/deploy/, https://docs.fly.io/apps/secrets/).

Tokens and scopes

Fly.io access tokens are macaroons with predefined scopes, from org-wide down to running one command on one app’s Machines (https://docs.fly.io/security/tokens/).

CommandScopeSource
fly tokens create deployOne app; the default for CIhttps://docs.fly.io/flyctl/integrating/
fly tokens create orgEvery app in one organizationhttps://docs.fly.io/security/tokens/
fly tokens create readonlyRead-only across one orghttps://docs.fly.io/flyctl/integrating/
fly tokens create sshSSH to one app (also allowed on the org WireGuard network)https://docs.fly.io/security/tokens/
fly tokens create machine-execOnly the command you name, via --commandhttps://docs.fly.io/flyctl/integrating/

CI/CD with GitHub Actions

The documented path is: create a deploy token, store it as the repository secret FLY_API_TOKEN, and run superfly/flyctl-actions/setup-flyctl then flyctl deploy --remote-only (https://docs.fly.io/launch/continuous-deployment-with-github-actions/). The same flyctl docs show a monorepo matrix using FLY_APP and a staging-on-push, production-on-release pattern (https://docs.fly.io/flyctl/integrating/). For GitLab CI, CircleCI, Jenkins or Buildkite the setup is the same three steps: install flyctl, set FLY_API_TOKEN, run commands (https://docs.fly.io/flyctl/integrating/).

Infrastructure as code

“Fly.io has no Terraform provider” is the blueprint’s own description, and it recommends flyctl plus GitHub Actions for most users (https://docs.fly.io/blueprints/infra-automation-without-terraform/). A 2022 changelog entry says an official Terraform provider was released (https://fly.io/blog/logbook-2022-06-01/); treat the current docs as the answer and the old post as history. Scripts of flyctl commands are “linear and imperative, not declarative or idempotent” (https://docs.fly.io/blueprints/infra-automation-without-terraform/). Pulumi: not in the corpus [verify].

The Machines REST API

MCP and agent skills

Lead with: “Use a deploy token in CI, a readonly token for dashboards, and the hosted MCP when an agent only needs to look.”

← Proxy, networking, domains, TLS · Data and integrations →