Fly Friday - Flyctl and Ports

We’re always improving the tools at Fly. There are the big features like Fly buildpack support of course and then there are the smaller features which just make life that little bit simpler, like the new -p option for Fly app creation.

TL;DR: The -p flag is used with flyctl apps create when you create a Fly app for the first time. Setting -p with a numeric value automatically sets the internal port of the generated fly.toml configuration file.

The internal port is the port your application uses to communicate with the world. We defaulted it to 8080.

With more and more people making use of prebuilt Docker images on Fly though, they don’t have control of which port their image uses. So they have to change the internal port setting.

We noticed that their workflow had become “create app, edit fly.toml file to change the internal port”. That’s one step too many for us.

And so that’s why we added the -p flag which sets the internal port for you, no edits required. It’s available from release 0.94 of Flyctl.

You can see it in action in this, the first of our Fly Friday videos:

Want to learn more about Fly? Head over to our Fly Docs for lots more, including a Hands On where you can get a free account and deploy your first app today.