flag92 flag92
Deploy

Global edge deploy on fly.io

fly.io runs your Chatwoot + Dify in multiple regions and routes each request to the nearest node automatically.

fly.io 60 min

What makes fly.io different#

  • Global edge — instances in 30+ regions, routed per user location
  • Firecracker microVMs — cold start < 1 s, faster than typical containers
  • GPU support — A100 / H100 instances available
  • Static IPv4 / IPv6 — email deliverability is respected
  • Per-region Volumes

When it fits#

  • Customers across multiple regions (NA + EU + APAC)
  • Need globally low first-response latency
  • Want to experiment with GPUs without owning hardware

Deploy Chatwoot#

1. Install flyctl#

curl -L https://fly.io/install.sh | sh
fly auth signup

2. Postgres#

fly postgres create --name flag92-pg --region nrt

3. Deploy Chatwoot#

git clone https://github.com/chatwoot/chatwoot
cd chatwoot
fly launch  # detects Dockerfile, generates fly.toml

Edit fly.toml:

app = "flag92-chatwoot"
primary_region = "nrt"
[build]
  image = "chatwoot/chatwoot:v4"
[env]
  RAILS_ENV = "production"
  FRONTEND_URL = "https://flag92-chatwoot.fly.dev"
[[services]]
  internal_port = 3000
  protocol = "tcp"
  [[services.ports]]
    handlers = ["http"]
    port = 80
    force_https = true
  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443
[[vm]]
  size = "shared-cpu-2x"
  memory = "2gb"

Wire DBs:

fly postgres attach flag92-pg --app flag92-chatwoot
fly redis create --name flag92-redis --region nrt
fly redis attach flag92-redis --app flag92-chatwoot
fly deploy

4. Multi-region scale#

fly regions add fra lax
fly scale count 3 --region nrt=1,fra=1,lax=1

Dify#

Same pattern — fly launch per service (api, worker, web, weaviate).

Cost#

ResourceSpecMonthly
Chatwoot Web × 1shared-cpu-2x 2GB$5
Chatwoot Sidekiq × 1shared-cpu-1x 1GB$2
Postgres (basic)1 vCPU 256MB$2
Redis$1
Dify services4-6 instances$20-40
Egress100GBfree
Total$30-50 / mo

GPU instances (A10) at ~$1/hr — start-on-demand cuts 70%+ vs always-on.

Gotchas#

  • Volumes don’t sync across regions — for multi-region Postgres, configure replication manually
  • Cold start — set min_machines_running = 1 on critical services
  • No China region — use Tokyo / Singapore + Cloudflare for mainland visitors
  • GPU quota — A100 / H100 need approval, 2-7 days

Search

Press ⌘ K to open