← Back to tools

Fly.io CLI

Deploy and manage apps on Fly.io's global platform

Cloud & Services linuxmacoswindows Go Apache-2.0

Description

flyctl is the command-line interface for Fly.io, a platform that runs applications close to users by deploying them to servers around the world. It handles deploying Docker containers, managing volumes, scaling, secrets management, and connecting to Fly Postgres databases.

Install

homebrewbrew install flyctl
shellcurl -L https://fly.io/install.sh | sh

AI Summary

Deploy and manage applications on Fly.io's global edge platform. Launch Docker containers, scale across regions, manage secrets and volumes, and connect to managed Postgres — all from the terminal.

Capabilities

  • + Deploy Docker containers to Fly.io's global edge network
  • + Scale applications across multiple geographic regions
  • + Manage persistent volumes for stateful applications
  • + Store and inject secrets as environment variables
  • + Provision and manage Fly Postgres databases
  • + Open interactive SSH sessions to running machines
  • + Stream application logs in real time

Use When

  • Deploying containerized applications close to users globally
  • Need a simpler alternative to Kubernetes for container deployment
  • Running full-stack apps with databases and persistent storage
  • Want geographic distribution without complex infrastructure

Avoid When

  • x Deploying static frontend sites only (use Vercel or Netlify)
  • x Need fine-grained infrastructure control (use AWS or GCP)
  • x Applications locked into another cloud provider's ecosystem

Usage Patterns

Launch a new app

fly launch

Detects the project type, generates fly.toml config, and deploys

Deploy after changes

fly deploy

Builds and deploys the application using the existing fly.toml

Set a secret

fly secrets set DATABASE_URL=postgres://user:pass@host/db

Stores an encrypted secret and restarts the app to inject it

Scale to multiple regions

fly scale count 3 --region iad,lhr,nrt

Runs 3 machines across US East, London, and Tokyo

Input / Output

stdin: Not typically used
stdout: Deployment status, app info, and log output
Exit codes:
0 Success
1 Error

Typical Pipelines

fly deploy && fly status
fly logs --json | jq -r '.message'
fly machines list --json | jq '.[] | {id, state, region}'

Related Tools

View AGENTS.md for Fly.io CLI