Fly.io Deployment

VerifiedCaution

Deploy applications to Fly.io using a 6-phase lifecycle: authentication, build, provisioning, deployment, verification, and rollback.

Sby Skills Guide Bot
DevOpsIntermediate
8/3/2026
Claude CodeCursorCodex
#deployment#fly-io#docker#rollback#health-checks

Recommended for

Automated summary

Governs deploying an application to Fly.io through six ordered phases, from authentication to validation, with rollback on failure.

Strengths

  • Explicit 6-phase sequence with the matching fly commands for each step
  • Covers provisioning (fly launch, secrets, Postgres/Redis) rather than only the push
  • Includes a concrete verification phase (fly status, fly info, curl 200) and a rollback path using fly deploy -i
  • Advises building the Docker image locally first to catch errors early

Limitations

  • Assumes flyctl is already installed and the project has a working Dockerfile or fly.toml
  • Discourages --detach for automated agents without offering an alternative monitoring mechanism
  • Rollback is rudimentary: the previous image must be identified manually, no automation
When to use it

Use it when an agent needs to deploy or redeploy a containerized app to Fly.io in a repeatable, verifiable way.

When not to use it

Not suitable for deployments to other platforms (Vercel, AWS, Kubernetes) or for projects with no existing Fly.io configuration.

Security analysis

Caution
Quality score84/100

The skill is procedural guidance for deploying to Fly.io. It uses powerful tooling (docker, fly deploy, curl) but only for its stated, legitimate purpose. There are no destructive commands, no curl|sh piping, no base64/obfuscated payloads, no attempts to send tokens or secrets to third parties, and no instructions to disable safety controls. The only mild concern is one example that could expose secret values on the command line; overall it warrants 'caution' rather than 'risky'.

Findings
  • •Instructs use of the fly CLI and docker build to build and deploy infrastructure (legitimate but powerful)
  • •Phase 3 suggests `fly secrets set KEY=value`, which can expose secret values in shell history or process listings; a safer pattern would be prompting or reading from a file/stdin
  • •References the FLY_API_TOKEN environment variable for authentication (read-only usage, no exfiltration)
How this analysis is made

Examples

First deploy
Deploy this Node.js app to Fly.io — set up the fly.toml, push the required secrets, and confirm the health check returns 200.
Failed health check
My fly deploy finished but the instances keep crashing. Check fly status and fly logs, then roll back to the previous release if it's not healthy.
Add a database
Provision a Postgres database on Fly.io for my app, attach it, and redeploy so the connection string is available as a secret.

name: fly-deployment description: Deep knowledge about deploying applications to Fly.io (MicroVMs, Docker). type: transform tier: library domain: deploy trigger: "when deploying to Fly.io"

Context

Deploying {{project_name}} ({{project_type}}) to Fly.io. You will follow a strict 6-phase Deployment Lifecycle Contract.

Instructions

Execute the following phases in order:

Phase 1: Authentication

  1. Ensure the FLY_API_TOKEN environment variable is set to a valid token.
  2. If running locally, authenticate interactively with fly auth login. For automated agents, ensure the token is provided.
  3. Validate by running fly auth whoami.

Phase 2: Build

  1. Prepare the artifacts for deployment.
  2. Fly.io uses a fly.toml configuration file and a Dockerfile (or buildpacks) to build your application on their builders.
  3. Ensure the Dockerfile builds successfully locally (docker build .) to catch any errors early.
  4. If your project requires generating static assets before pushing, run your framework's build command (e.g., npm run build).

Phase 3: Install / Provisioning

  1. Ensure the target Fly.io application exists. If not, initialize it using fly launch --no-deploy.
  2. Check the fly.toml file to ensure the application name, regions, and environment variables are correctly configured.
  3. Ensure required secrets are set using fly secrets set KEY=value.
  4. If your application requires a database (Postgres, Redis), ensure it's provisioned via fly postgres create or fly redis create and attached to the app.

Phase 4: Deploy

  1. Ship the artifact to Fly.io.
  2. Run fly deploy to build and deploy your application. You can append --remote-only to force the build on Fly's remote builders.
  3. Use --detach if you do not want to wait for health checks to pass in the foreground (not recommended for automated agents unless monitoring separately).

Phase 5: Checking

  1. Verify the deployment was successful.
  2. Run fly status to check the application's instances and their health status.
  3. Retrieve the public URL using fly info and use curl -sSf <URL> to ensure the application returns a 200 OK status code.
  4. Check logs via fly logs if the deployment fails or instances are crashing.

Phase 6: Update / Rollback

  1. If Phase 5 fails, immediately initiate a rollback.
  2. Fly.io supports rolling back to previous deployments. Identify the previous image or release version and run fly deploy -i <previous-image-ref>.
  3. Note the failure in the progress log.

Validation

  • [ ] Fly.io authentication (fly auth whoami) succeeds.
  • [ ] Build succeeds (locally or remote).
  • [ ] Application instances are running (fly status).
  • [ ] Health check (curl) returns 200 OK.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/fly-io-deployment-mscrezry/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/fly-io-deployment-mscrezry' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/fly-io-deployment-mscrezry/download' --output '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md.part' && mv '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md.part' '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md' && test -s '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/fly-deployment' && cp -R '.skill-downloads/fly-io-deployment-mscrezry' '.claude/skills/fly-deployment'

Cursor
test -f '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md' && test -s '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/fly-deployment' && cp -R '.skill-downloads/fly-io-deployment-mscrezry' '.cursor/skills/fly-deployment'

Codex
test -f '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md' && test -s '.skill-downloads/fly-io-deployment-mscrezry/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/fly-deployment' && cp -R '.skill-downloads/fly-io-deployment-mscrezry' '.agents/skills/fly-deployment'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/fly-io-deployment-mscrezry'

openskills read 'fly-io-deployment-mscrezry'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/fly-io-deployment-mscrezry/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills