Railway / Render / Fly.io Deployment
Expert in deploying to indie-friendly PaaS platforms with optimal cost, autoscaling, and developer experience.
Activation Triggers
Activate on: "Railway deploy", "Render setup", "Fly.io", "indie hosting", "affordable cloud", "PaaS deployment", "side project hosting", "hobby project", "scale to zero"
NOT for: Enterprise K8s → kubernetes-manifest-generator | AWS/GCP IaC → terraform-module-builder | Cloudflare Pages → cloudflare-pages-cicd
Quick Start
- Choose platform — Railway for simplicity, Fly.io for edge compute, Render for free tier services
- Connect repo — Git push deploys with automatic build detection
- Add services — database, Redis, cron jobs from platform marketplace
- Configure scaling — scale-to-zero for cost, autoscale for traffic
- Set custom domain — CNAME to platform, automatic TLS
Core Capabilities
| Domain |
Technologies |
| Railway |
Nixpacks builds, volumes, cron, TCP/HTTP services, templates |
| Render |
Native runtimes, Blueprints (IaC), disk storage, free tier |
| Fly.io |
fly.toml, Machines API, volumes, edge regions, Litefs (SQLite) |
| Databases |
Railway Postgres/MySQL/Redis, Render managed Postgres, Fly Postgres |
| Cost |
Scale-to-zero, usage-based billing, spend alerts |
Architecture Patterns
Platform Decision Matrix
┌──────────────┬────────────┬────────────┬────────────┐
│ Criteria │ Railway │ Render │ Fly.io │
├──────────────┼────────────┼────────────┼────────────┤
│ Ease of use │ Best │ Great │ Good │
│ Free tier │ $5 trial │ Yes (750h) │ Yes (3 VMs)│
│ Scale-to-0 │ Yes │ No (paid) │ Yes │
│ Edge regions │ No │ No │ Yes (35+) │
│ Databases │ Built-in │ Managed PG │ Fly PG │
│ Docker │ Nixpacks │ Dockerfile │ Dockerfile │
│ SQLite │ Volumes │ Disk │ LiteFS │
│ Best for │ Full-stack │ Static+API │ Edge apps │
└──────────────┴────────────┴────────────┴────────────┘
Fly.io Multi-Region with LiteFS
# fly.toml
app = "my-app"
primary_region = "iad"
[build]
dockerfile = "Dockerfile"
[http_service]
internal_port = 3000
auto_stop_machines = "stop" # Scale to zero
auto_start_machines = true
min_machines_running = 0
[mounts]
source = "data"
destination = "/data"
[[vm]]
size = "shared-cpu-1x"
memory = "256mb"
Railway Service Composition
┌─────────────────────────────────────────┐
│ Railway Project │
├─────────────┬────────────┬──────────────┤
│ Web API │ Worker │ Cron │
│ (Node.js) │ (Python) │ (Go binary) │
│ Port 3000 │ No port │ Schedule │
├─────────────┴────────────┴──────────────┤
│ PostgreSQL │ Redis │ S3 (R2) │
│ (Plugin) │ (Plugin) │ (External) │
└─────────────────────────────────────────┘
All services share internal networking.
Environment variables auto-injected for database URLs.
Deploy via `railway up` or Git push.
Anti-Patterns
- Running databases on Fly.io without backups — Fly Postgres is unmanaged. Set up
pg_dump cron or use managed databases (Supabase, Neon) instead.
- Not enabling scale-to-zero — paying for idle compute. Configure
auto_stop_machines on Fly.io or Railway's scale-to-zero for low-traffic services.
- Storing state in ephemeral containers — containers restart and lose local data. Use volumes (persistent disk) or external storage (S3/R2, managed DB).
- Ignoring egress costs — data transfer out can be expensive. Fly.io includes 100GB; Railway meters it. Cache aggressively and compress responses.
- Over-provisioning for hobby projects — starting with 2GB RAM instances for a blog. Start with the smallest tier and scale up based on actual metrics.
Quality Checklist
[ ] Git-push deploy configured and tested
[ ] Health check endpoint defined
[ ] Scale-to-zero enabled for non-critical services
[ ] Database has automated backups (managed or cron pg_dump)
[ ] Custom domain with automatic TLS
[ ] Environment variables set (not hardcoded)
[ ] Spend alerts configured at budget threshold
[ ] Dockerfile optimized (multi-stage, minimal final image)
[ ] Persistent storage on volumes, not ephemeral filesystem
[ ] Preview environments for PRs (Railway/Render)
[ ] Monitoring via platform dashboard or external (Sentry, Axiom)
[ ] Migration strategy documented for platform lock-in escape
1---
2license: Apache-2.0
3name: railway-render-deployment
4description: "Indie-friendly cloud deployment on Railway, Render, and Fly.io with autoscaling and cost optimization. Activate on: Railway deployment, Render deploy, Fly.io setup, indie hosting, affordable cloud, PaaS deployment, hobby project hosting, side project infrastructure. NOT for: enterprise Kubernetes (use kubernetes-manifest-generator), AWS/GCP infrastructure (use terraform-module-builder), Cloudflare Pages (use cloudflare-pages-cicd)."
5allowed-tools: Read,Write,Edit,Bash(docker:*,kubectl:*,terraform:*,npm:*,npx:*)
6category: DevOps & Infrastructure
7tags:
8 - railway
9 - render
10 - flyio
11 - deployment
12pairs-with:
13 - skill: vercel-deployment
14 reason: Vercel for frontend; Railway/Render/Fly for backend services
15 - skill: docker-multi-stage-optimizer
16 reason: Optimized Docker images reduce costs on metered platforms
17metadata:
18 source: https://skillmd.com/skills/curiositech/railway-render-deployment
19---
20
21# Railway / Render / Fly.io Deployment
22
23Expert in deploying to indie-friendly PaaS platforms with optimal cost, autoscaling, and developer experience.
24
25## Activation Triggers
26
27**Activate on:** "Railway deploy", "Render setup", "Fly.io", "indie hosting", "affordable cloud", "PaaS deployment", "side project hosting", "hobby project", "scale to zero"
28
29**NOT for:** Enterprise K8s → `kubernetes-manifest-generator` | AWS/GCP IaC → `terraform-module-builder` | Cloudflare Pages → `cloudflare-pages-cicd`
30
31## Quick Start
32
331. **Choose platform** — Railway for simplicity, Fly.io for edge compute, Render for free tier services
342. **Connect repo** — Git push deploys with automatic build detection
353. **Add services** — database, Redis, cron jobs from platform marketplace
364. **Configure scaling** — scale-to-zero for cost, autoscale for traffic
375. **Set custom domain** — CNAME to platform, automatic TLS
38
39## Core Capabilities
40
41| Domain | Technologies |
42|--------|-------------|
43| **Railway** | Nixpacks builds, volumes, cron, TCP/HTTP services, templates |
44| **Render** | Native runtimes, Blueprints (IaC), disk storage, free tier |
45| **Fly.io** | fly.toml, Machines API, volumes, edge regions, Litefs (SQLite) |
46| **Databases** | Railway Postgres/MySQL/Redis, Render managed Postgres, Fly Postgres |
47| **Cost** | Scale-to-zero, usage-based billing, spend alerts |
48
49## Architecture Patterns
50
51### Platform Decision Matrix
52
53```
54┌──────────────┬────────────┬────────────┬────────────┐
55│ Criteria │ Railway │ Render │ Fly.io │
56├──────────────┼────────────┼────────────┼────────────┤
57│ Ease of use │ Best │ Great │ Good │
58│ Free tier │ $5 trial │ Yes (750h) │ Yes (3 VMs)│
59│ Scale-to-0 │ Yes │ No (paid) │ Yes │
60│ Edge regions │ No │ No │ Yes (35+) │
61│ Databases │ Built-in │ Managed PG │ Fly PG │
62│ Docker │ Nixpacks │ Dockerfile │ Dockerfile │
63│ SQLite │ Volumes │ Disk │ LiteFS │
64│ Best for │ Full-stack │ Static+API │ Edge apps │
65└──────────────┴────────────┴────────────┴────────────┘
66```
67
68### Fly.io Multi-Region with LiteFS
69
70```toml
71# fly.toml
72app = "my-app"
73primary_region = "iad"
74
75[build]
76 dockerfile = "Dockerfile"
77
78[http_service]
79 internal_port = 3000
80 auto_stop_machines = "stop" # Scale to zero
81 auto_start_machines = true
82 min_machines_running = 0
83
84[mounts]
85 source = "data"
86 destination = "/data"
87
88[[vm]]
89 size = "shared-cpu-1x"
90 memory = "256mb"
91```
92
93### Railway Service Composition
94
95```
96┌─────────────────────────────────────────┐
97│ Railway Project │
98├─────────────┬────────────┬──────────────┤
99│ Web API │ Worker │ Cron │
100│ (Node.js) │ (Python) │ (Go binary) │
101│ Port 3000 │ No port │ Schedule │
102├─────────────┴────────────┴──────────────┤
103│ PostgreSQL │ Redis │ S3 (R2) │
104│ (Plugin) │ (Plugin) │ (External) │
105└─────────────────────────────────────────┘
106
107All services share internal networking.
108Environment variables auto-injected for database URLs.
109Deploy via `railway up` or Git push.
110```
111
112## Anti-Patterns
113
1141. **Running databases on Fly.io without backups** — Fly Postgres is unmanaged. Set up `pg_dump` cron or use managed databases (Supabase, Neon) instead.
1152. **Not enabling scale-to-zero** — paying for idle compute. Configure `auto_stop_machines` on Fly.io or Railway's scale-to-zero for low-traffic services.
1163. **Storing state in ephemeral containers** — containers restart and lose local data. Use volumes (persistent disk) or external storage (S3/R2, managed DB).
1174. **Ignoring egress costs** — data transfer out can be expensive. Fly.io includes 100GB; Railway meters it. Cache aggressively and compress responses.
1185. **Over-provisioning for hobby projects** — starting with 2GB RAM instances for a blog. Start with the smallest tier and scale up based on actual metrics.
119
120## Quality Checklist
121
122```
123[ ] Git-push deploy configured and tested
124[ ] Health check endpoint defined
125[ ] Scale-to-zero enabled for non-critical services
126[ ] Database has automated backups (managed or cron pg_dump)
127[ ] Custom domain with automatic TLS
128[ ] Environment variables set (not hardcoded)
129[ ] Spend alerts configured at budget threshold
130[ ] Dockerfile optimized (multi-stage, minimal final image)
131[ ] Persistent storage on volumes, not ephemeral filesystem
132[ ] Preview environments for PRs (Railway/Render)
133[ ] Monitoring via platform dashboard or external (Sentry, Axiom)
134[ ] Migration strategy documented for platform lock-in escape
135```