
Fly Machines Has a Free API: Deploy Containers Globally With Sub-Second Cold Starts
Lambda functions run in one region. Docker containers take seconds to start. Fly Machines deploy globally and start in 300ms. What Are Fly Machines? Fly Machines are fast-launching VMs that run Docker containers on Fly.io's global network. They combine the flexibility of containers with the speed of serverless. # Deploy a Docker image globally fly launch --image nginx:latest # Running in 20+ regions, accessible via Anycast The Machines API # Create a machine curl -X POST "https://api.machines.dev/v1/apps/my-app/machines" \ -H "Authorization: Bearer $FLY_API_TOKEN " \ -d '{ "config": { "image": "my-app:latest", "guest": {"cpus": 1, "memory_mb": 256}, "services": [{"ports": [{"port": 443, "handlers": ["tls", "http"]}]}] } }' # Stop a machine (scale to zero) curl -X POST "https://api.machines.dev/v1/apps/my-app/machines/{id}/stop" \ -H "Authorization: Bearer $FLY_API_TOKEN " # Start it again (300ms cold start) curl -X POST "https://api.machines.dev/v1/apps/my-app/machines/{id}/start" \ -H
Continue reading on Dev.to DevOps
Opens in a new tab



