leoyeai/openclaw-master-skills/fly-io-deployer
Claude Code and agent skill by leoyeai/openclaw-master-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"},{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Deploy and operate Node, Python, Go, Rust, Elixir, and Docker apps on Fly.io with production-grade fly.toml authoring, Machines API orchestration, region selection (latency vs sovereignty vs egress), Fly Postgres clustering, LiteFS for SQLite replication, Upstash Redis bindings, Tigris object storage, persistent volumes, WireGuard private networking with 6PN, secrets via flyctl, blue/green deploys via auto-stopping machines, scale-to-zero strategies, scheduled scaling, preview deploys per PR, multi-region replicas, hot-config reload, machine SSH, log shipping to Better Stack/Axiom/Datadog/Logtail, and aggressive cost tuning. Triggers on "fly.io", "flyctl", "fly machines", "fly.toml", "fly postgres", "litefs", "tigris", "upstash on fly", "fly deploy", "migrate from heroku", "migrate from render", "migrate from railway", "scale to zero", "fly regions", "fly volumes", "fly wireguard", "6pn", "fly secrets".
Install
npx vskill@latest install leoyeai/openclaw-master-skills/fly-io-deployerSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as leoyeai/openclaw-master-skills/fly-io-deployer.
Fly.io Deployer
Plan, ship, and operate apps on Fly.io's Machines platform with the discipline of a senior platform engineer who has migrated production stacks off Heroku, Render, Railway, and AWS. Produces a deployable fly.toml, a region plan, a stateful-services plan (Postgres / LiteFS / Redis / Tigris), a CI/CD pipeline, and a cost model — all sized for the actual traffic shape, not the marketing demo.
Usage
Invoke when starting a new Fly app, migrating onto Fly, debugging a sick deploy, planning multi-region rollout, or cutting the bill. Equally useful for greenfield ("we want to ship a Rust API to fly") and rescue work ("our Render bill tripled, get us off in 2 weeks").
Basic invocation:
Deploy this Node + Postgres app to Fly.ioMigrate our Heroku stack (web + worker + Postgres + Redis) onto FlyCut our $1,400/mo Fly bill in half without dropping regions
With context:
Here's the Dockerfile and the Heroku Procfile — produce fly.toml + a migration runbookWe need EU + US Postgres replicas with read-your-writes from web nodesAuto-stop machines but keep p95 cold-start under 800ms for the web app
The agent emits a fly.toml, optional Dockerfile, litefs.yml, flyctl migration scripts, GitHub Actions for deploys + preview environments, secret rotation script, and a one-page cost model.
Inputs Required
- App shape — runtime (Node/Python/Go/Rust/Elixir/Bun/Deno/Docker), framework (Next.js/Rails/Django/FastAPI/Phoenix/Actix), entrypoint
- Stateful needs — Postgres? Redis? S3-compatible object storage? File system? SQLite?
- Traffic profile — req/s peak, geographic distribution, p95 latency target, daily/weekly seasonality
- Compliance constraints — data residency (EU-only? US-only? FRA mandatory?), HIPAA/PCI scope
- Origin platform (if migrating) — Heroku / Render / Railway / Vercel / AWS / DigitalOcean
- Budget ceiling — monthly USD cap matters when picking machine sizes and replica counts
Workflow
- Read the app and classify it: stateless web, stateful web (sessions on disk), worker, scheduled job, ws server, RPC, or full-stack monolith
- Pick primary region from latency to majority of users + sovereignty (
fly platform regionsenumerates current set) - Decide replicas: single-region multi-machine vs multi-region active-active vs primary+read-replicas
- Choose stateful services: Fly Postgres cluster, LiteFS+SQLite, external Supabase/Neon, Upstash Redis, Tigris/R2/S3
- Author
fly.toml(anatomy section below); generateDockerfileif missing - Wire secrets via
flyctl secrets set(never bake into image) - Create the app + provision volumes + provision Postgres + attach
- First deploy with
--strategy=immediateto a single machine; verify health - Scale to target shape with
fly scale count+fly machine clone --region - Wire CI (deploy on main, preview app per PR)
- Wire log shipping (Vector → Better Stack/Axiom/Datadog) and metrics (Fly Prometheus + Grafana)
- Configure auto-stop / auto-start for cost; tune min_machines_running
- Document rollback (
fly releases list+fly deploy --image <prev-sha>)
fly.toml Anatomy
Every field, what it does, and the most common mistake.
Common mistakes:
internal_portdoes not matchPORTenv → connection refused, healthchecks 502min_machines_running = 0on a stateful service → first user gets a 30s cold start- No
release_command→ migrations race the rolling deploy and break readers kill_timeoutshorter than slowest request → 502s on every deployauto_stop_machines = "stop"with attached volume but stateful in-RAM cache → cache cold every wakeprocessesdeclared but no[[services]] processes = [...]filter → worker exposes HTTP
Region Strategy
Fly has 35+ regions. Picking three is harder than picking one.
Tiers by latency to global users (rough p50 from CDN telemetry):
| Tier | Regions | Use case | |
|---|---|---|---|
| 1 | fra (Frankfurt), iad (Ashburn), sjc (San Jose), nrt (Tokyo), syd (Sydney), gru (São Paulo) | Most apps land 80% of traffic in 3 of these | |
| 2 | lhr (London), cdg (Paris), ams (Amsterdam), ord (Chicago), dfw (Dallas), lax (LA), sea (Seattle), hkg (Hong Kong), sin (Singapore), bom (Mumbai) | Fill p95 gaps | |
| 3 | arn (Stockholm), mad (Madrid), waw (Warsaw), otp (Bucharest), jnb (Johannesburg), eze (Buenos Aires), scl (Santiago), qro (Querétaro), gdl (Guadalajara), bog (Bogotá), den (Denver), mia (Miami), yyz (Toronto), yul (Montréal), phx (Phoenix) | Niche or compliance-driven |
Decision rules:
- Single region: pick
frafor EU-heavy,iadfor US-east-heavy,sjcfor US-west,grufor LATAM. Add a second region only when p95 from a continent exceeds your SLO. - Two regions:
iad+fracovers 70% of global SaaS traffic with sub-150ms p95.iad+sjcif you're US-only but coast-spread. - Three regions: add
nrtorsydwhen APAC > 10% of users.gruwhen LATAM > 10%. - Compliance: GDPR-strict ⇒ EU-only set
[fra, ams, cdg]; UK data ⇒lhr; data must stay in Germany ⇒fraonly and verify Fly's host-country docs. - Postgres primary: place where writes originate or where the largest user group lives. Read replicas absorb global reads.
- Egress cost: cross-region traffic on 6PN is free between Fly machines but billed for outbound to internet — keep DB and app in the same region whenever possible.
Postgres Cluster Recipe
fly pg create provisions a Stolon-managed Postgres cluster on Fly Machines. It is not a managed database — you operate it.
Provision:
Cluster anatomy:
- 1 leader (writes), N replicas (reads)
- Stolon manages failover; ~30s window during leader change
- Each member is a Machine with its own volume; volumes don't replicate — Stolon does
- Connection string is a
flycast(.flycast) anycast over 6PN — auto-routes to leader
Read replicas in other regions:
App code routes reads via the read-only port:
5433 returns the closest replica via 6PN routing.
Backups:
- Volume snapshots: daily, 5-day retention default; bump with
--snapshot-retention - Logical:
fly pg sshthenpg_dumpto Tigris bucket nightly viafly machine run --schedule - Restore: snapshot restore via
fly volumes restore; or fork a fresh cluster from a snapshot
Sizing rules:
- Start at
shared-cpu-2x+ 4 GB RAM. Move toperformance-2xwhen p99 query > 50ms. - Volume size = working set × 3. Postgres needs free space for WAL, vacuum, and temp.
effective_cache_size= 75% of memory.shared_buffers= 25%. Tune viafly pg config update.
When to use external Postgres instead:
- Need point-in-time recovery (PITR) — Fly PG doesn't ship it
- Need multi-AZ guarantees beyond Stolon's 30s failover
- Already on Supabase / Neon / Crunchy — they're managed; Fly PG is unmanaged
LiteFS — when SQLite beats Postgres:
LiteFS replicates a SQLite DB across Machines via FUSE-intercepted writes. Single-writer, many-readers.
Use LiteFS when:
- Working set fits in RAM (sub-10GB)
- Writes are <1k/sec
- You want zero ops on the DB
- Read replicas in every region without query rewriting
Don't use LiteFS when: high write throughput, complex transactions, you need PITR, or you need multiple writers.
Migration from Heroku / Render / Railway
Per-source playbooks. The common ground is: build a Dockerfile from the implicit one, port the Procfile to [processes], port add-ons to Fly equivalents, swap secrets, cut DNS.
From Heroku
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/fly-io-deployer/SKILL.md
Popularity
- Repository stars
- 2,012
- Repository forks
- 307
- 7-day trend score
- 38
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hookspluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/leoyeai/openclaw-master-skills/fly-io-deployer)