Set a region with `fly apps create`

Hi, I’m trying to script a deployment process. When creating a database with fly postgres create, you can specify a region with the --region flag. That flag doesn’t exist for the fly apps create command.

If I want to specify the region for a new app, should I call fly apps create, and then set the region through the app’s config?

Maybe I’m overthinking this. Does fly apps create automatically choose an appropriate region for the user?

Apps don’t have a region - they’re basically a way to group machines together (apps hold some common stuff like fly.toml config, secrets, etc.). Machines are the things that need to live in a specific region, because they’re the things that actually run on physical hardware.

fly postgres create is essentially a convenience for creating an app and some machines, so it accepts a region so that you can specify where to place the machines. I suppose the analogous command for non-Postgres would be fly launch which also accepts --region.

Does that clarify things a bit?

2 Likes

Thank you, this is really helpful. :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.