Fly.io
Fly runs the server image for you. There is no operating system to patch. One community costs about $4 a month.
Steps
-
Install
flyctland sign in:fly auth login -
Copy
server/fly.tomlfrom the repository. Changeapp,SBLURP_NAME,SBLURP_BASE_URLandBACKUP_NAME. -
Make the app, a volume and addresses. Replace
my-communitywith your app name:fly apps create my-community fly volumes create sblurp_data -a my-community -r sjc -s 1 --snapshot-retention 14 -y fly ips allocate-v4 --shared -a my-community fly ips allocate-v6 -a my-community -
Add DNS records for your domain: an
Arecord with the shared IPv4 address and anAAAArecord with the IPv6 address. On Cloudflare, set them to "DNS only" (grey cloud) so Fly can get the certificate. -
Add the certificate and wait for "Issued":
fly certs add chat.example.com -a my-community fly certs check chat.example.com -a my-community -
Deploy a released image:
fly deploy --ha=false --image ghcr.io/OWNER/sblurp-server:stable -
Join your community first. The first person to join becomes the owner.
Backups on Fly
Without R2 secrets the image runs with no backups. To turn them on, set the secrets before the first deploy:
fly secrets set --stage -a my-community \
AWS_ACCESS_KEY_ID='<R2 access key ID>' \
AWS_SECRET_ACCESS_KEY='<R2 secret access key>' \
R2_ENDPOINT='https://<ACCOUNT_ID>.r2.cloudflarestorage.com' \
BACKUP_PASSWORD='<backup password>'
See Backups for what gets copied and how to restore.
Why the settings in fly.toml
- One machine. SQLite allows one writer. Never scale past one machine.
--ha=falsestops Fly from making a second. - Always on.
auto_stop_machines = "off"andmin_machines_running = 1, because the machine holds every open Subscribe stream. - h2c.
h2_backend = truemakes Fly's proxy speak HTTP/2 to the server, so Connect streams and gRPC work. - High concurrency. Each open Subscribe is one request. The limit is 5,000 soft and 10,000 hard. The default soft limit of 20 is far too low.
- Idle timeout of 600 s. Subscribe also sends a heartbeat every 25 s.
- Health check on
/healthz, with a 30 s grace period because the first boot may restore from R2. - 512 MB. A file backup run can use 50 to 100 MB.
Updates
Fly does not update by itself. Run the deploy command again for each release. To grow, raise the memory with fly scale memory 1024 or the volume with fly volumes extend <volume ID> -s 3.
Cost
About $4 a month for one community on a 512 MB shared-cpu-1x machine with a 1 GB volume. Fly has no free tier for new accounts. Check fly.io for current prices.
View this page as Markdown · Glossary · API schema.json · openapi.json