I Run 5 Elixir Apps on Fly.io for Under €50/Month — Here's the Breakdown
Source: Dev.to
The Products
These are the apps I run under AIFirst, my solo software company based in Portugal:
- SondMe – survey platform (Phoenix + LiveView)
- Countermark – bot detection without CAPTCHAs
- OpenClawCloud – managed hosting for AI agents
- Vertate – verification platform
- Agent‑Inbox – AI agent communication interface
All share the same stack: Elixir, Phoenix, LiveView, PostgreSQL.
Why Fly.io
Pay for what you run
Fly charges per machine, per second of uptime—no “instance‑hours” padding.
Auto‑stop is a game‑changer
[http_service]
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
Low‑traffic apps sleep when idle and wake on the first request (≈ 2 s cold start for a Phoenix app). Staging environments cost virtually nothing.
Elixir is a first‑class citizen
Fly provides official Elixir support. fly launch detects Phoenix, generates a working Dockerfile, and handles releases. Libraries such as dns_cluster for distributed Erlang work out of the box.
Multi‑region with zero re‑architecture
Start in a single region (Amsterdam for me, closest to Portugal). Need US coverage later? One fly scale command adds a region—no infrastructure redesign required.
A Typical fly.toml
app = "my-app"
primary_region = "ams"
[build]
[env]
PHX_HOST = "my-app.fly.dev"
PORT = "8080"
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
Key decisions
- 256 MB RAM – Phoenix runs comfortably with LiveView, PubSub, and Oban.
- shared‑cpu‑1x – cheap and sufficient for early‑stage web workloads.
- min_machines_running = 1 for production, 0 for staging.
Cost Breakdown
| Item | Count | Monthly Cost |
|---|---|---|
| shared‑cpu‑1x machines (256 MB) | 8 | ~€32 |
| Fly Postgres (single node) | 3 clusters | ~€10 |
| Bandwidth | — | Free tier |
| SSL certificates | — | Free (auto) |
| Total | ~€42 |
Some apps share a Postgres cluster. After consolidating from separate databases, three clusters handle all five apps comfortably.
For Comparison
- Heroku: 5 apps × $7 Eco dyno = $35, plus databases = $50+ – Eco dynos sleep unpredictably.
- Railway: Similar compute pricing, but less mature Elixir support.
- AWS ECS: Minimum viable setup easily $80+/month after load balancers, NAT gateways, and CloudWatch.
What Makes Elixir Special Here
- Memory efficiency – A Phoenix app with LiveView, background jobs, and real‑time PubSub fits in 256 MB. A comparable Node.js/Express + Socket.io + Bull setup needs 512 MB+.
- Concurrency – Each request runs in a lightweight BEAM process (~2 KB). Thousands of concurrent WebSocket connections fit on a single 256 MB machine.
- Resilience – OTP supervision trees restart crashed processes in milliseconds, eliminating the need for health‑check polling or container restarts.
Lessons Learned
- Share databases early – Consolidating into shared clusters cut database costs by more than half.
- Use auto‑stop from day one – For apps with < 100 daily active users, there’s no reason to keep machines hot overnight.
- Set up internal networking – Fly’s free WireGuard network lets services talk privately, reducing latency and auth overhead.
- Monitor memory, not CPU – For BEAM apps, memory is the limiting factor. Alert when usage exceeds ~200 MB of a 256 MB allocation to know when to upgrade.
The Solo Founder Advantage
The real win isn’t the €42 bill; it’s the flexibility. Spinning up a new app costs about €8/month, and if the idea fails, fly apps destroy drops the cost instantly. There’s no minimum infrastructure investment, no long‑term cloud commitments, and no heavyweight Kubernetes cluster that costs the same whether you run one app or ten.
Elixir + Fly.io lets infrastructure costs scale linearly—and down just as easily as up. For a solo founder bootstrapping multiple products with zero funding, that’s everything.