Skip to main content
Illustration by Annie Ruygt of a whale carrying containers with fish looking on Fly Launch can deploy your app from a Dockerfile. The fly launch command detects your Dockerfile, builds it, and then deploys your app. Need some extra config? No sweat, we’ve got you covered.

Create and configure your app

Run fly launch from your project’s source directory.
If you want to configure more than the basic settings, things like secrets or environment variables for example, run fly launch --no-deploy so that you can edit the fly.toml file before the first deployment.
Type n if you’re happy with the defaults listed, otherwise type y to open the Fly Launch web page and edit your settings, including:
  • Name: Keep the default app name or enter your own.
  • Region: Keep the fastest region (the value of primary_region in the fly.toml file) as chosen by Fly Launch, or select a different region to deploy to.
  • Services: The port for services (the value of internal_port in the fly.toml file) depends on the EXPOSE instruction in your Dockerfile. The default port when the fly launch command doesn’t find ports set in a Dockerfile is 8080.
  • You can also set a default Machine size and memory, and add and configure Postgres or Redis.
After you click Confirm Settings, Fly Launch creates your app, generates a fly.toml file for your project with the settings, and then deploys the app.

Add environment variables and secrets

Most Dockerfiles expect some configuration settings through ENV. Add your custom ENV settings to the [env] section of the generated fly.toml file. For example:
Add the values your Dockerfile requires. Sometimes you have secrets that shouldn’t be checked in to git or shared publicly. You can set secrets using the fly secrets command. For example:
You can list the secrets you’ve already set using fly secrets list. For example:
The values aren’t displayed, since they’re secret!

Deploy your app

If you didn’t deploy the new app, or you’ve made changes and want to redeploy, then you can do that now.
By default, fly deploy builds the image using a remote builder. If you have Docker running locally and want to build locally, then run fly deploy --local-only. After the image is built, the app gets deployed.

Open your app

Run fly apps open, or just go to the URL specified in the output, to open your deployed app in a browser.

Stateful apps

Lots of apps have some state that they want to keep. Learn more about the options for databases and storage on Fly.io.

Grow and scale

Check out some of the ways you can increase availability, capacity, and performance with Fly.io: If you have questions, need help, or want to talk about what you’re building, visit our community forum.