Fly.io
Fly.io provides a simple deployment path with automatic HTTPS, global regions, and persistent volumes.
fly.toml
Section titled “fly.toml”app = "openmotoko"primary_region = "fra"
[build] dockerfile = "docker/Dockerfile"
[http_service] internal_port = 3457 force_https = true auto_stop_machines = true auto_start_machines = true
[env] NODE_ENV = "production"
[[vm]] memory = "512mb" cpu_kind = "shared" cpus = 1Initial deployment
Section titled “Initial deployment”Create the app
Section titled “Create the app”fly launch --no-deployThis creates the app on Fly.io without deploying. Review the generated fly.toml and adjust the region and VM size as needed.
Create a persistent volume
Section titled “Create a persistent volume”fly volumes create openmotoko_data --size 1 --region fraAdd the volume mount to fly.toml:
[mounts] source = "openmotoko_data" destination = "/app/data"Set secrets
Section titled “Set secrets”fly secrets set OPENMOTOKO_PASSWORD="your-secure-password"fly secrets set ANTHROPIC_API_KEY="sk-ant-..."Add any additional provider keys or channel tokens:
fly secrets set OPENAI_API_KEY="sk-..."fly secrets set TELEGRAM_BOT_TOKEN="123:ABC..."Deploy
Section titled “Deploy”fly deployCustom domain
Section titled “Custom domain”fly certs add openmotoko.example.comThen point your DNS CNAME to openmotoko.fly.dev.
Scaling
Section titled “Scaling”Vertical (VM size)
Section titled “Vertical (VM size)”Edit fly.toml:
[[vm]] memory = "1gb" cpu_kind = "shared" cpus = 2Horizontal
Section titled “Horizontal”OpenMotoko uses SQLite, so horizontal scaling requires a shared volume or switching to a networked database. For personal use, a single instance is recommended.
Monitoring
Section titled “Monitoring”fly logsfly statusfly ssh consoleUpdating
Section titled “Updating”fly deployFly.io performs a rolling update with zero downtime.
Regions
Section titled “Regions”Change primary_region in fly.toml to deploy closer to you:
| Region | Code |
|---|---|
| Frankfurt | fra |
| Amsterdam | ams |
| London | lhr |
| New York | ewr |
| San Francisco | sjc |
| Tokyo | nrt |
| Sydney | syd |