100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

Fly.io Deployment Cheat Sheet

Fly.io Deployment Cheat Sheet

flyctl commands, fly.toml configuration, and scaling patterns for deploying apps and machines to Fly.io regions.

2 PagesBeginnerJun 1, 2026

Launch a New App

Bootstrap a fly.toml and provision an app from an existing project directory.

bash
fly auth login# Detects your framework/Dockerfile and generates fly.tomlfly launch --name my-app --region iad --no-deploy# Deploy itfly deploy

fly.toml Essentials

Minimal config for an HTTP service with a health check.

toml
app = "my-app"primary_region = "iad"[build]  dockerfile = "Dockerfile"[http_service]  internal_port = 8080  force_https = true  auto_stop_machines = true  auto_start_machines = true  min_machines_running = 1[[http_service.checks]]  interval = "15s"  timeout = "2s"  grace_period = "5s"  method = "GET"  path = "/health"

Scaling & Secrets

Adjust machine count/size and manage runtime secrets.

bash
# Scale out to 3 machines and set VM sizefly scale count 3fly scale vm shared-cpu-2x --memory 512# Set a secret (triggers a redeploy with the new value)fly secrets set DATABASE_URL="postgres://user:pass@host/db"# Attach a managed Postgres clusterfly postgres create --name my-app-dbfly postgres attach my-app-db

Core Concepts

Terminology specific to Fly.io's Machines-based platform.

  • Machine- a fast-booting Firecracker microVM running your container
  • Region- deploy the same app across multiple regions for low latency
  • fly.toml- per-app config: build, services, checks, mounts
  • Volumes- persistent, region-pinned storage attached to a machine
  • flyctl- the CLI for deploy, scale, logs, ssh, and secrets
Pro Tip

Set `auto_stop_machines = true` with `min_machines_running = 0` for low-traffic services — Fly.io will suspend idle machines and resume them on the next request, cutting compute cost to near zero without changing your deploy config.

Was this cheat sheet helpful?

Explore Topics

#FlyIoDeployment#FlyIoDeploymentCheatSheet#CloudComputing#Beginner#LaunchANewApp#FlyTomlEssentials#ScalingSecrets#CoreConcepts#DevOps#CheatSheet#SkillVeris