I’m also failing to get my first deployment out which is a hello world. My fly.toml is the default detected for golang projects.
This is most likely one of two things: either the Go app is exiting (possibly because of a crash) or the health checks aren’t passing because we can’t connect to the service.
If you run fly status --all you should see a list of instances in a failed state. fly vm status <id> should give you more details about what actually went wrong. We have more troubleshooting docs here: Troubleshooting your Deployment · Fly Docs
I reread the docs. The port 8080 bit was easy to gloss over.
As with most Go applications, a simple
go buildwill create a hellofly binary which we can run. It’ll default to using port 8080 and you can view it on localhost:
I would put this at the top or give it a heading. Something like:
Default Port
Fly.io generates a
fly.tomlwith the default port of 8080, so your Go application’s port should match what exists in thefly.toml. From our example:
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
