Skip to content

Fly.io

Fly.io provides a simple deployment path with automatic HTTPS, global regions, and persistent volumes.

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 = 1
Terminal window
fly launch --no-deploy

This creates the app on Fly.io without deploying. Review the generated fly.toml and adjust the region and VM size as needed.

Terminal window
fly volumes create openmotoko_data --size 1 --region fra

Add the volume mount to fly.toml:

[mounts]
source = "openmotoko_data"
destination = "/app/data"
Terminal window
fly secrets set OPENMOTOKO_PASSWORD="your-secure-password"
fly secrets set ANTHROPIC_API_KEY="sk-ant-..."

Add any additional provider keys or channel tokens:

Terminal window
fly secrets set OPENAI_API_KEY="sk-..."
fly secrets set TELEGRAM_BOT_TOKEN="123:ABC..."
Terminal window
fly deploy
Terminal window
fly certs add openmotoko.example.com

Then point your DNS CNAME to openmotoko.fly.dev.

Edit fly.toml:

[[vm]]
memory = "1gb"
cpu_kind = "shared"
cpus = 2

OpenMotoko uses SQLite, so horizontal scaling requires a shared volume or switching to a networked database. For personal use, a single instance is recommended.

Terminal window
fly logs
fly status
fly ssh console
Terminal window
fly deploy

Fly.io performs a rolling update with zero downtime.

Change primary_region in fly.toml to deploy closer to you:

RegionCode
Frankfurtfra
Amsterdamams
Londonlhr
New Yorkewr
San Franciscosjc
Tokyonrt
Sydneysyd