fly deploy Command Reference
Build and release a Fly.io application.
fly deploy builds your app image (locally or on a remote builder) and releases it to your Fly.io app per fly.toml. In CI you authenticate with a deploy token and pin the image.
What it does
fly deploy builds the container image, pushes it to the Fly registry, and rolls it out to your apps machines using the strategy in fly.toml. It is the single command that ships a new version of a Fly app.
Common flags and usage
- --remote-only: build on Fly remote builders (no local Docker needed)
- --app NAME: target a specific app
- --image REF: deploy a prebuilt image instead of building
- --strategy: rolling, immediate, bluegreen, or canary
- --config FILE: use a non-default fly.toml
- --access-token reads FLY_API_TOKEN from the environment
Example
- name: Fly Deploy
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
run: flyctl deploy --remote-only --app my-app --strategy rollingIn CI
Export FLY_API_TOKEN (a scoped deploy token) from secrets; flyctl reads it automatically and runs non-interactively. Prefer --remote-only so the runner needs no Docker daemon, and pin an image or strategy so deploys are predictable across environments.
Key takeaways
- fly deploy builds the image and rolls it out to your Fly.io app.
- Use --remote-only so the CI runner needs no local Docker daemon.
- Authenticate with a scoped FLY_API_TOKEN deploy token from secrets.