SkillOpen
fly-cli
Use the Fly.io CLI (flyctl) to deploy applications to edge locations, manage machines, volumes, secrets, and databases.
Front matter
name: fly-cli
description: Use the Fly.io CLI (flyctl) to deploy applications to edge locations, manage machines, volumes, secrets, and databases.Fly.io CLI (flyctl / fly)
Official CLI for Fly.io. Deploy apps globally to edge locations with Firecracker VMs.
- Official repo: https://github.com/superfly/flyctl
- Docs: https://fly.io/docs/flyctl/
Authentication
fly auth login # Browser-based login
fly auth token # Print auth token
fly auth whoami # Check current userCommon Commands
Apps
fly launch # Create and configure new app
fly deploy # Deploy current directory
fly deploy --image my-registry/my-app:v1 # Deploy specific image
fly apps list
fly status # Current app status
fly open # Open app in browserMachines
fly machine list
fly machine start MACHINE_ID
fly machine stop MACHINE_ID
fly machine restart MACHINE_ID
fly machine status MACHINE_IDScaling
fly scale count 3 # Set instance count
fly scale vm shared-cpu-1x # Change VM size
fly scale memory 512 # Set memory (MB)
fly scale show # Show current scale
fly regions add ord # Add region
fly regions list # List regionsSecrets
fly secrets set DATABASE_URL=postgres://...
fly secrets list
fly secrets unset DATABASE_URLLogs and SSH
fly logs # Stream logs
fly ssh console # SSH into running machine
fly ssh console -C "ls /app" # Run command via SSHDatabases
fly postgres create # Create managed Postgres
fly postgres list
fly postgres connect -a my-db # Connect to PostgresVolumes
fly volumes create my_data --size 10 # Create 10GB volume
fly volumes listAgent Best Practices
- Use
fly statusto check app health and deployment status - Use
fly deploy --strategy rollingfor zero-downtime deploys - Use
fly logsto debug issues after deployment - Set secrets before deploying:
fly secrets settriggers a redeploy - Use
fly ssh console -C "command"for one-off remote commands - Use
fly scale countto manage instance count per region
Example Workflows
Deploy and verify
fly deploy
fly status
fly logs --instance INSTANCE_IDScale to multiple regions
fly regions add lax ord ams
fly scale count 2Source: written by One Giant Leap.
Related entries
There are more like this in the members library
The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.