DEV Community

Alex Spinov
Alex Spinov

Posted on

Fly.io Has Free Edge Deployment — Here's How to Deploy Your App Globally in 60 Seconds

Heroku died. Vercel is for frontends. Fly.io runs your full-stack app at the edge — Docker containers close to your users.

What is Fly.io?

Fly.io runs your app in micro-VMs on servers around the world. Your users get sub-50ms latency because the app runs near them.

Quick Start

# Install
curl -L https://fly.io/install.sh | sh

# Login
fly auth login

# Launch (auto-detects your framework)
fly launch

# Deploy
fly deploy
Enter fullscreen mode Exit fullscreen mode

Deploy a Node.js App

# Dockerfile
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]
Enter fullscreen mode Exit fullscreen mode
fly launch  # Creates fly.toml automatically
fly deploy  # Builds and deploys
Enter fullscreen mode Exit fullscreen mode

fly.toml Configuration

app = "my-app"
primary_region = "iad"

[build]
  dockerfile = "Dockerfile"

[http_service]
  internal_port = 3000
  force_https = true
  auto_stop_machines = "stop"
  auto_start_machines = true
  min_machines_running = 1

[env]
  NODE_ENV = "production"
Enter fullscreen mode Exit fullscreen mode

Scale Globally

# Add regions
fly scale count 2 --region iad,ams

# List regions
fly regions list

# Scale VM size
fly scale vm shared-cpu-2x
Enter fullscreen mode Exit fullscreen mode

Databases on Fly.io

# PostgreSQL
fly postgres create
fly postgres attach my-db

# Redis
fly redis create

# SQLite with LiteFS (distributed SQLite!)
fly launch --from https://github.com/superfly/litefs-example
Enter fullscreen mode Exit fullscreen mode

Secrets Management

fly secrets set DATABASE_URL="postgres://..." JWT_SECRET="my-secret"
fly secrets list
Enter fullscreen mode Exit fullscreen mode

Volumes (Persistent Storage)

# Create a volume
fly volumes create data --size 10 --region iad

# Mount in fly.toml
[mounts]
  source = "data"
  destination = "/data"
Enter fullscreen mode Exit fullscreen mode

Free Tier

  • 3 shared-cpu-1x VMs with 256MB RAM
  • 3GB persistent storage
  • 160GB outbound bandwidth
  • Unlimited inbound

Fly.io vs Alternatives

Feature Fly.io Railway Render Heroku
Edge Deploy Yes No No No
Docker Yes Yes Yes Yes
Global Regions 35+ 1 4 2
Free Tier Generous $5 credit Yes Eliminated
SQLite LiteFS No No No
GPU Yes No No No
Auto-scaling Yes No Yes No

Need to deploy scraping infrastructure? Check out my Apify actors — already deployed globally, no DevOps needed. For custom solutions, email spinov001@gmail.com.

Top comments (0)