mcpField
F
flyctl

flyctl

github.com/sebastiaanwoutersCloud & DevOps178 installsUpdated 29w ago
Repository

About flyctl

A command-line workflow guide for developers deploying and operating applications on Fly.io. It covers configuration, scaling, storage, databases, monitoring, and troubleshooting.

Key features

  1. 01Launch and deploy applications
  2. 02Manage secrets and configuration
  3. 03Adjust VM and instance counts
  4. 04Create and resize persistent volumes
  5. 05Check status, logs, and health checks
  6. 06Use SSH and diagnose issues

Use cases

  1. 01Deploy a new application to Fly.io
  2. 02Update an app and adjust its scale
  3. 03Manage app secrets and persistent storage
  4. 04Troubleshoot deployment or machine issues

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/sebastiaanwouters/dotagents --skill flyctl

After installing, type/flyctlin Claude Code to confirm it loaded.

Bundled filesreference/dockerfile.mdreference/laravel.md

Details

From the project README

Fly.io Deployment (flyctl)

Deploy applications to Fly.io's global edge infrastructure.

Quick Reference

TaskCommand
New appfly launch
Deployfly deploy
Statusfly status
Logsfly logs
SSHfly ssh console
Openfly apps open

Core Workflows

1. New App Deployment
cd /path/to/project
fly launch              # Interactive setup
fly launch --now -y     # Accept defaults, deploy immediately
fly launch --no-deploy  # Configure only, deploy later

Creates: fly.toml (config), Dockerfile (if needed)

2. Subsequent Deploys
fly deploy                    # Standard deploy
fly deploy --strategy rolling # Rolling update (default)
fly deploy --local-only       # Build locally instead of remote
3. Secrets Management
fly secrets set KEY=value           # Set secret
fly secrets set K1=v1 K2=v2        # Multiple
fly secrets list                    # List (values hidden)
fly secrets unset KEY               # Remove
cat .env | fly secrets import       # Import from file
4. Scaling
fly scale show                      # Current config
fly scale vm shared-cpu-1x          # Change VM size
fly scale memory 512                # Set memory (MB)
fly scale count 3                   # Set instance count
fly scale count web=2 worker=1      # Per process group

VM sizes: shared-cpu-1x, shared-cpu-2x, performance-1x, performance-2x

5. Volumes (Persistent Storage)
fly volumes create mydata --size 10 --region ord  # Create 10GB
fly volumes list                                   # List volumes
fly volumes extend <id> --size 20                  # Resize

Mount in fly.toml:

[mounts]
source = "mydata"
destination = "/data"
6. Databases

Managed Postgres (recommended):

fly mpg create                      # Create managed postgres
fly mpg list                        # List clusters

Unmanaged Postgres:

fly postgres create                 # Create cluster
fly postgres attach <pg-app>        # Attach to app (sets DATABASE_URL)
fly postgres connect <pg-app>       # Connect via psql

Redis (Upstash):

fly redis create                    # Create instance
7. Monitoring
fly status                # App status
fly logs                  # Tail logs
fly logs -i <machine-id>  # Specific machine
fly checks list           # Health checks
fly dashboard             # Open web UI
8. SSH & Console
fly ssh console           # Interactive shell
fly ssh console -C "cmd"  # Run command
fly sftp shell            # SFTP access

fly.toml Essentials

app = "my-app"
primary_region = "ord"

[env]
APP_ENV = "production"

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = "stop"
auto_start_machines = true
min_machines_running = 1

[[vm]]
memory = "512mb"
cpu_kind = "shared"
cpus = 1

Framework-Specific

For Laravel apps: Read reference/laravel.md For Dockerfile apps: Read reference/dockerfile.md

Troubleshooting

fly doctor              # Diagnose issues
fly releases            # List releases
fly releases show <v>   # Release details
fly machine list        # List machines
fly machine restart <id> # Restart specific machine

Common Flags

FlagDescription
-a <app>Specify app name
-c <path>Config file path
-r <region>Target region
--yesSkip confirmations
--verboseVerbose output

Comments

Markdown supported