What this thread does
The problem
You (or your agent) ran fly launch and fly deploy. The build passes, then Fly prints a warning that the app is "not listening on the expected address", the health check never goes green, or the URL answers 502 or times out. Fly's deployment troubleshooting guide covers this warning and checks the listen address, port and startup logs.
What Fly's docs say
- Fly Proxy services are configured in
fly.toml;fly deployflags can override certain configuration settings. The Dockerfile scanner used byfly launchreadsEXPOSEwhen present to populate the service port; proxy services are configured infly.toml(fly launch docs). - In
[http_service],internal_portdefaults to 8080 and the docs recommend keeping the default (config reference). Whatever you set must be the port your process really listens on. - Top-level
[checks]need aportthat is available on0.0.0.0.grace_periodis the wait before checks start and should be long enough for your app to boot. The docs say HTTP service checks run over the app's private network, not your public hostname; they do not say this for top-level[checks]. - Deploy strategy defaults to
rolling;fly statusshows current application and deployment status;fly logsshows application logs and can filter by Machine (status reference, logs reference).
What the forum threads show (secondary, community answers)
- One cause is a bind address of
127.0.0.1/localhostinside the container. Bind to0.0.0.0. - Another cause is a port mismatch. A Laravel answer recommends aligning the application port with
internal_port; a Phoenix poster reports success after correcting the config for their app's port 4000. A Next.js thread instead suggests aHOSTvariable; its visible replies do not confirm that this resolved the issue. - In an April 2026 FastAPI thread, the poster reported fixing a Redis-dependent health check and scheduler startup so the app could bind its port faster. The poster found a health endpoint that depended on Redis through rate-limit middleware, and a scheduler that ran during startup; the poster excluded
/pingfrom rate limiting and scheduledsetup_scheduler()right after startup begins so it would not block app boot. One community answer notes the warning alone does not abort a deploy, so a failing health check is the likelier blocker. - The FastAPI thread suggests running the image locally in Docker, then inspecting the listener with
psandnetstator similar inside the Machine; Fly's troubleshooting guide documentsfly ssh consoleand log inspection.
A checklist you can give your agent
Our recommendation:
My Fly.io deploy finished but the app is unreachable. Do not change anything yet. 1) Runfly config showandfly status. 2) Read the last 100 lines offly logs. 3) Tell me which address and port the process binds (from our start command and framework config) and compare withinternal_portin fly.toml. 4) Check that any health check path does not depend on a database, cache or scheduler that starts later, and thatgrace_periodcovers startup time. 5) Propose the smallest fix as a diff to fly.toml or the start command. Do not touch secrets, volumes orfly scale.
Common mistakes
Our recommendation: check for these mistakes.
- Trusting
EXPOSEor the framework's dev default instead ofinternal_port. - Health check path that returns 500 until a dependency is ready, or goes through auth or rate-limit middleware.
- Our recommendation: when running
fly deployfrom the project root, verify that the selected config and Dockerfile are the intended files; pass explicit paths when needed (deploy reference). - Letting the agent run
fly deployin a loop. A normal successful deployment creates or updates the app's Machines. Our recommendation: read the logs between attempts.
Letting an agent drive flyctl
fly mcp server can expose flyctl commands (status, logs, secrets, volumes, machines) to a client such as Claude, Cursor or VS Code with flags like --claude. The server authenticates with a Fly access token; supported MCP operations are limited by that token's permissions. Our recommendation: use a narrowly scoped token where you can and keep destructive commands behind approval.
Limits
Our recommendation: check the current config reference for your flyctl version.
Sources
- Fly.io configuration reference and the fly launch docs.
- Confirms:
internal_portdefaults to 8080 and Fly recommends keeping it; thefly launchDockerfile scanner usesEXPOSEwhen present to populate the service port; runtime proxy services are configured infly.toml; the checksportmust be reachable on0.0.0.0;grace_periodshould be at least the startup time; the default deploy strategy isrolling. - Corrected above: the docs say HTTP service checks run over the app's private network, but they do not say that for top-level
[checks]. - The linked forum posts for the stated causes and outcomes; the flyctl MCP reference for command groups, client flags and token handling; Fly's agent guide for token scope; and the linked troubleshooting, status, logs, deploy and
fly mcp serverreferences. Community reports are accounts of those apps, not a frequency ranking.
Started from a post by @Fly.io docs and community forum, packaged by the editor. Original post