Launch the App
Fly Launch helps you quickly deploy almost any kind of app using a Docker image. To learn more about the different ways to get your app ready to deploy, refer to Fly Launch.
For this example, you can use our pre-built Docker image,
flyio/hellofly:latest, to create and deploy an app.
Each Fly Launch application uses a
fly.toml file to tell the system how to deploy it. The
fly.toml file can be automatically generated with the
fly launch command, which will provide some useful defaults that you can tweak through a web interface before deploying the app.
fly launch --image flyio/hellofly:latest
You’ll get a summary of the defaults chosen for your app:
Using image flyio/hellofly:latest Creating app in /Users/username/my-app-name We're about to launch your app on Fly.io. Here's what you're getting: Organization: MyName (fly launch defaults to the personal org) Name: my-app-name (derived from your directory name) Region: Secaucus, NJ (US) (this is the fastest region for you) App Machines: shared-cpu-1x, 1GB RAM (most apps need about 1GB of RAM) Postgres: <none> (not requested) Redis: <none> (not requested) ? Do you want to tweak these settings before proceeding? (y/N)
y at the prompt to open the Fly Launch page, where you can make changes to your app config.
For this example, the only settings you might want to change are the app name and the region to deploy in. App names can include only numbers, lowercase letters, and dashes.
Click Confirm Settings to confirm and deploy the example app.
You can return to your terminal to view the progress of the app deployment:
Waiting for launch data... Done Created app 'my-app-name' in organization 'personal' Admin URL: https://fly.io/apps/my-app-name Hostname: my-app-name.fly.dev Wrote config file fly.toml Validating /Users/username/my-app-dir/fly.toml Platform: machines ✓ Configuration is valid ==> Building image Searching for image 'flyio/hellofly:latest' remotely... image found: img_z1nr0lpjz9v5q98w Watch your deployment at https://fly.io/apps/my-app-name/monitoring Provisioning ips for my-app-name Dedicated ipv6: 2a09:8280:1::42:a8f4 Shared ipv4: 184.108.40.206 Add a dedicated ipv4 with: fly ips allocate-v4 This deployment will: * create 2 "app" machines No machines in group app, launching a new machine Creating a second machine to increase service availability Finished launching new machines ------- NOTE: The machines for [app] have services with 'auto_stop_machines = true' that will be stopped when idling ------- Visit your newly deployed app at https://my-app-name.fly.dev/
When you run a command, flyctl always checks to see if
fly.toml exists in the current directory, and then checks the
app value at the start of the file. Many commands use this app name to determine which Fly App to apply to by default. The
fly.toml file also defines how the app will be built (from a pre-built Docker image, in this case), the ports for services, and further configuration to be applied to the app when it deploys.