DEV Community

Alex Spinov
Alex Spinov

Posted on

Fly.io Has Free Micro VMs — Deploy Containers to 35+ Regions in Seconds

Serverless has cold starts. VMs are slow to provision. Fly.io Machines boot a full Linux VM in 300ms — closer to your users than any cloud region.

What is Fly.io?

Fly.io runs your containers as micro VMs (Firecracker) in 35+ regions worldwide. Your app starts in milliseconds, runs wherever your users are, and costs nothing when idle.

Why Fly.io

1. Deploy Any Docker Container

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

# Launch
fly launch
# Detects your app, creates Dockerfile if needed, deploys globally
Enter fullscreen mode Exit fullscreen mode
FROM node:20-slim
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
CMD ["node", "server.js"]
Enter fullscreen mode Exit fullscreen mode

2. Machines API (Programmatic VMs)

# Create a machine via API
curl -X POST "https://api.machines.dev/v1/apps/myapp/machines" \
  -H "Authorization: Bearer $FLY_API_TOKEN" \
  -d '{
    "config": {
      "image": "myapp:latest",
      "guest": { "cpus": 1, "memory_mb": 256 },
      "auto_destroy": true
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Create VMs on-demand. Per-request compute. Pay only while running.

3. Global Anycast Networking

# fly.toml
[http_service]
  internal_port = 3000
  force_https = true

[[http_service.checks]]
  path = "/health"
  interval = "10s"
  timeout = "2s"
Enter fullscreen mode Exit fullscreen mode

One IP address routes to the nearest region. Automatic TLS. Automatic health checks.

4. Volumes (Persistent Storage)

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

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

5. Postgres (Managed)

fly postgres create --name mydb
fly postgres attach mydb

# DATABASE_URL automatically set in your app
Enter fullscreen mode Exit fullscreen mode

6. Scale to Zero

# fly.toml
[http_service]
  auto_start_machines = true
  auto_stop_machines = "stop"
  min_machines_running = 0
Enter fullscreen mode Exit fullscreen mode

Machine stops when idle. Starts in 300ms on next request. Zero cost while sleeping.

Free Tier (Hobby Plan)

Resource Free
Shared CPU VMs Up to 3
RAM 256MB each
Bandwidth 100GB/month
Volumes 1GB

Fly.io vs Vercel vs Railway vs AWS Lambda

Fly.io Vercel Railway Lambda
Type Micro VMs Serverless Containers Functions
Cold start 300ms (VM boot) ~250ms None (always on) 100ms-5s
Persistent storage Volumes No Volumes EFS (slow)
Regions 35+ Edge (limited compute) US, EU 25+
Docker Native No Yes Via Lambda containers
WebSocket Yes Limited Yes No
SSH access Yes No No No

Getting Started

curl -L https://fly.io/install.sh | sh
fly auth signup
fly launch
fly deploy
Enter fullscreen mode Exit fullscreen mode

The Bottom Line

Fly.io gives you VMs that feel like serverless. Boot in 300ms, run anywhere, scale to zero. If you need more control than serverless but less overhead than traditional VMs, Fly is the sweet spot.


Need data tools? I build scraping solutions. Check my Apify actors or email spinov001@gmail.com.

Top comments (0)