flyctl deploy: Deploy to Fly.io from CI
flyctl deploy builds your app's image and rolls it out to Fly.io machines according to fly.toml.
fly deploy is the main release command. In CI it authenticates with a token and usually builds remotely so the runner does not need Docker.
What it does
flyctl deploy builds a container image (locally, or remotely with --remote-only on a Fly builder), pushes it to the Fly registry, and performs a rolling release across the app's machines. The app, image, and process config come from fly.toml.
Common usage
# build on Fly's remote builder, no local Docker needed
flyctl deploy --remote-only --app my-app
# the fly alias is identical
fly deploy --remote-onlyOptions
| Flag | What it does |
|---|---|
| --remote-only | Build on a Fly remote builder (no local Docker) |
| --local-only | Build with the local Docker daemon |
| --app <name> | Target app (or the app field in fly.toml) |
| --config <file> | Use a specific fly.toml |
| --strategy <s> | Rollout strategy: rolling, immediate, canary |
| --build-arg K=V | Pass a Docker build argument |
In CI
Set FLY_API_TOKEN (from flyctl tokens create deploy) as an env var; flyctl reads it automatically, so no fly auth login is needed. Use --remote-only so the runner does not require a Docker daemon. flyctl is non-interactive when the token and app are resolvable.
Common errors in CI
"Error: No access token available. Please login with 'flyctl auth login'" means FLY_API_TOKEN is unset. "Error: failed to fetch an image or build from source: app not found" means --app or fly.toml names an app the token cannot see. A failed build step prints the Docker error from the remote builder.