
1. Install flyctl
flyctl is a command-line utility that lets you work with Fly.io usingfly commands, from creating your account to deploying your applications. It runs on your local device so you’ll want to install the version that’s appropriate for your operating system.
macOS
If you have the Homebrew package manager installed, flyctl can be installed by running:fly command from any directory.
Linux
Run the install script:Windows
Run the PowerShell install script:pwsh command is not found, powershell can be used instead, though we recommend installing the latest version of PowerShell.
Uninstall flyctl
How you remove flyctl depends on how you installed it. Homebrew (macOS): Uninstall withbrew uninstall flyctl.
Install script (macOS and Linux): Remove the flyctl directory (~/.fly by default), then delete the lines the install script added to your shell rc file (for example ~/.bashrc or ~/.zshrc) to put flyctl on your PATH.
Windows (PowerShell): Remove the flyctl install directory (~\.fly by default) and remove its entry from your PATH.
2. Sign up or sign in
Sign up for an account or sign in to your existing account.Sign up for a Fly.io account
If it’s your first time using Fly.io, you’ll need to create an account. To sign up, run:
After signing up you’ll be returned to your command line, ready to use Fly.io.
Sign in to your Fly.io account
If you already have a Fly.io account, all you need to do is sign in with flyctl. To sign in, run:Sign in with GitHub to sign in.
After logging in you’ll be returned to your command line, ready to use Fly.io.
Microsoft WSL users may need to run the following command, which creates a symbolic link that allows the browser to open:
ln -s /usr/bin/wslview /usr/local/bin/xdg-open3. Launch the demo app
Fly Launch helps you quickly deploy almost any kind of app using a Docker image. For this example, you’ll use our pre-built Docker image,flyio/hellofly:latest, to create and deploy the demo app.
Running fly launch to create a new app generates a fly.toml config file with some useful defaults that you can tweak through a web interface before deploying the app. When you run a command post-deploy, flyctl looks for a fly.toml file to get the app name and the configuration to apply.
To create the demo app, run:
y at the prompt to open the Fly Launch page, then click Confirm Settings to confirm and deploy the demo app.
Or just type n to accept the default and deploy the app.
Example fly launch output:
- Check your app’s status
After the app is deployed, use the fly status command to get the basic details about your new app. For example:
hellofly.fly.dev. The app has two Machines running in the ord (Chicago) region. We recommend running at least two Machines to improve availability.
5. Visit your app
You can connect to your deployed app with thefly apps open command, which opens a browser to https://<my-app-name>.fly.dev/ for a secure connection.
You’ve successfully launched your first app on Fly.io!
For fun, add /<your-name> to fly apps open and your name will be appended to the app’s path to add an extra greeting from the hellofly application.