DEV Community

João Pedro Silva Setas
João Pedro Silva Setas

Posted on

I Run 5 Elixir Apps on Fly.io for Under €50/Month — Here's the Breakdown

I'm a solo founder running 5 SaaS products. All Elixir/Phoenix. All on Fly.io. Total infrastructure cost: under €50/month.

Here's exactly how.

The Products

I'm building these 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 built with the same stack: Elixir, Phoenix, LiveView, PostgreSQL.

Why Fly.io

I evaluated several hosting options before settling on Fly.io. Here's why it won:

1. Pay for what you run

No "instance hours" padding. I pay per machine, per second of uptime.

2. Auto-stop is a game-changer

[http_service]
  auto_stop_machines = true
  auto_start_machines = true
  min_machines_running = 0
Enter fullscreen mode Exit fullscreen mode

My low-traffic apps sleep when nobody's using them. They wake up on the first request — cold start is about 2 seconds for a Phoenix app. Staging environments cost literally nothing.

3. Elixir is a first-class citizen

Fly.io has official Elixir support. fly launch detects Phoenix, generates a working Dockerfile, and handles releases. Libraries like dns_cluster for distributed Erlang just work out of the box.

4. Multi-region with zero re-architecture

Start with one region (Amsterdam for me — closest to Portugal). Need US coverage later? One fly scale command. No infrastructure redesign.

A Typical fly.toml

Here's the config I use across most of my apps:

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"
Enter fullscreen mode Exit fullscreen mode

Key decisions:

  • 256MB RAM — Phoenix is incredibly memory-efficient. A full app with LiveView, PubSub, and Oban (background jobs) runs comfortably in 256MB.
  • shared-cpu-1x — perfect for early-stage apps. Shared CPU is cheap and Phoenix doesn't need much compute for typical web workloads.
  • min_machines_running = 1 for production, 0 for staging.

Cost Breakdown

Here's the actual math:

Item Count Monthly Cost
shared-cpu-1x machines (256MB) 8 ~€32
Fly Postgres (single node) 3 clusters ~€10
Bandwidth Free tier
SSL certificates Free (auto)
Total ~€42

Some apps share a Postgres cluster. I started with separate databases for everything, then consolidated. Three clusters handle all five apps comfortably.

For comparison

  • Heroku: 5 apps × $7 Eco dyno = $35, plus databases = $50+ — and Eco dynos sleep unpredictably
  • Railway: Similar compute pricing, less mature Elixir support
  • AWS ECS: Minimum viable setup easily $80+/month after load balancers, NAT gateways, and CloudWatch

What Makes Elixir Special Here

This setup works because the BEAM VM is unusually efficient for web applications.

Memory: A Phoenix app with LiveView, background jobs, and real-time PubSub runs in 256MB. A comparable Node.js/Express setup with Socket.io and Bull queues needs 512MB+ to breathe.

Concurrency: Each request gets a lightweight BEAM process (~2KB of memory). I can handle thousands of concurrent WebSocket connections on a single 256MB machine.

Resilience: OTP supervision trees restart crashed processes in milliseconds. No health check polling. No container-level restarts. If a GenServer handling webhook processing dies, its supervisor brings it back before anyone notices.

Lessons Learned

1. Share databases early

I wasted money running separate Postgres instances for every app. Most early-stage apps can share a database cluster with schema-level isolation. This cut my database costs by more than half.

2. Use auto-stop from day one

I ran machines 24/7 for a while before enabling auto-stop. For apps with fewer than 100 daily active users, there's no good reason to keep machines hot at night.

3. Set up internal networking

Fly gives you a private WireGuard network between all your apps for free. I use it for internal API calls between services — no public internet, no extra latency, no auth overhead for service-to-service communication.

4. Monitor memory, not CPU

For BEAM apps, memory is the constraining resource, not CPU. Set up alerts for when an app consistently uses >200MB of its 256MB allocation. That's your signal to bump to 512MB.

The Solo Founder Advantage

The real point isn't the €42. It's the flexibility.

When I want to test a new product idea, I spin up a new app on Fly.io. Added cost: about €8/month. If the idea doesn't work after a month, I fly apps destroy it and my bill drops right back down.

There's no minimum infrastructure investment keeping bad ideas alive. No long-term cloud commitments. No Kubernetes cluster that costs the same whether I run 1 app or 10.

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.


I'm João, a solo developer building SaaS products from Portugal. I write about Elixir, infrastructure, and the solo founder journey. Follow for more.

Top comments (0)