
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
Runfly 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.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_regionin thefly.tomlfile) as chosen by Fly Launch, or select a different region to deploy to. -
Services: The port for services (the value of
internal_portin thefly.tomlfile) depends on theEXPOSEinstruction in your Dockerfile. The default port when thefly launchcommand doesn’t find ports set in a Dockerfile is8080. - You can also set a default Machine size and memory, and add and configure Postgres or Redis.
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 throughENV. Add your custom ENV settings to the [env] section of the generated fly.toml file. For example:
git or shared publicly. You can set secrets using the fly secrets command. For example:
fly secrets list. For example:
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.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
Runfly 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:- Follow the blueprint for extra Machines for more resilient apps
- Read up on App availability and resiliency
- Autoscale Machines based on load or custom metrics
- Scale Machine CPU and RAM
- Scale Machine count