LinuxCommandLibrary

flyctl

Manage Fly.io applications

TLDR

Sign into a Fly account

$ flyctl auth login
copy

Launch an application from a specific Dockerfile (the default path is the current working directory)
$ flyctl launch --dockerfile [path/to/dockerfile]
copy

Open the current deployed application in the default web browser
$ flyctl open
copy

Deploy the Fly applications from a specific Dockerfile
$ flyctl deploy --dockerfile [path/to/dockerfile]
copy

Open the Fly Web UI for the current application in a web browser
$ flyctl dashboard
copy

List all applications in the logged-in Fly account
$ flyctl apps list
copy

View the status of a specific running application
$ flyctl status --app [app_name]
copy

Display version information
$ flyctl version
copy

SYNOPSIS

flyctl [global-options] command [subcommand] [options] [arguments]

Examples:
flyctl launch
flyctl deploy
flyctl apps list
flyctl logs
flyctl ssh console

PARAMETERS

--access-token
    Authenticates commands using a specific API access token, overriding any locally stored token.

--app
    Specifies the application name to operate on. If omitted, it's often inferred from the current directory's 'fly.toml' file.

--config
    Provides an alternative path to the 'flyctl' configuration file, typically 'fly.toml'.

--debug
    Enables debug logging, printing detailed information about command execution for troubleshooting.

--help, -h
    Displays help information for the 'flyctl' command itself or a specific subcommand.

--json
    Formats the command's output as JSON, which is highly useful for scripting and programmatic consumption.

--org
    Specifies the organization context under which the command should operate.

--verbose, -v
    Enables verbose output, providing more detailed status messages and progress updates during command execution.

DESCRIPTION

flyctl is the official command-line interface (CLI) for interacting with the Fly.io platform. Fly.io provides a global application delivery network, allowing users to deploy and run full-stack applications closer to their users, reducing latency.

flyctl empowers developers to manage every aspect of their Fly.io applications, from initial setup and deployment to scaling, monitoring, and debugging. It facilitates tasks such as creating new applications, deploying code updates, configuring services, managing databases, viewing logs, setting up custom domains, and much more. The CLI abstracts away complex infrastructure details, enabling developers to focus on their code.

It's a crucial tool for anyone building and operating internet-facing applications on the Fly.io infrastructure, providing a streamlined workflow for development and operations.

CAVEATS

flyctl requires an active Fly.io account and successful authentication (e.g., via flyctl auth login) for most operations. An internet connection is essential as it interacts with the remote Fly.io platform. The behavior of commands often depends heavily on the presence and content of the fly.toml configuration file in your application directory. Due to Fly.io's rapid development, certain commands, flags, or features may evolve or be deprecated over time, requiring users to keep their flyctl version updated.

CONFIGURATION FILE (FLY.TOML)

Many flyctl commands rely heavily on the fly.toml file, which resides in your application's root directory. This TOML-formatted file defines your application's build process, services, environment variables, regions, and other deployment configurations. Understanding and correctly configuring fly.toml is crucial for effective application management on Fly.io.

AUTHENTICATION

To use flyctl, you must authenticate with your Fly.io account. The most common method is running flyctl auth login, which typically opens a browser window for a secure OAuth login flow. Upon successful authentication, an access token is stored locally, allowing subsequent flyctl commands to interact with your Fly.io resources.

HISTORY

Fly.io, originally known as Nanobox, relaunched in 2019 with a renewed focus on edge deployments and global application distribution. flyctl has been a cornerstone of this transformation, continuously evolving to support the platform's expanding capabilities, including Fly Machines, Volumes, built-in Postgres, and more. Its development reflects Fly.io's commitment to simplifying the deployment and management of web applications (such as Node.js, Ruby on Rails, Phoenix, etc.) across a global infrastructure. It is actively maintained and frequently updated to keep pace with platform innovations and user needs.

SEE ALSO

kubectl(1), heroku(1), aws(1), docker(1)

Copied to clipboard