Configuring Fly

Each Fly application needs a fly.toml file to tell the system how we'd like to deploy it. That file can be automatically generated with the command flyctl apps create command.

flyctl apps create
? App Name (leave blank to use an auto-generated name) hellofly
? Select organization: Demo (demo)
New app created
  Name     = hellofly
  Owner    = demo
  Version  = 0
  Status   =
  Hostname = <empty>

app = "hellofly"

Wrote config file fly.toml

Note: We recommend that you go with the autogenerated names for apps to avoid namespace collisions. We're using hellofly here so you can easily spot it in configuration files.

The fly.toml file now contains a default configuration for deploying your app. In the process of creating that file, flyctl has also created a Fly-side application slot of the same name, "hellofly". If we look at the fly.toml file we can see the name in there:

app = "hellofly"

  concurrency = "20,25"
  internal_port = 8080
  protocol = "tcp"


      handlers = ["tls","http"]

      handlers = ["http"]

    interval = 10000
    timeout = 2000

The flyctl command will always refer to this file in the current directory if it exists, specifically for the app name value at the start. That name will be used to identify the application on the Fly platform. The rest of the file contains settings to be applied to the application when it deploys.

We'll have more details about these properties as we progress, but for now, it's enough to say that they mostly configure which ports the application will be visible on.