Fly.io Deployment

LaunchFast deployment is designed to be handled by the LaunchFast installer. This document explains what gets deployed and why, how the infrastructure works, and how to reason about it when debugging or customizing.

What the installer does

When you opt into deployment during installation, LaunchFast automates the full deployment setup:

  • Injects deployment configuration files (fly.toml, Dockerfile, CI workflow)
  • Configures region-aware Fly.io settings
  • Verifies Fly.io billing and CLI availability
  • Sets up CI-based deploys for production and staging
  • Ensures secrets and infrastructure are created in the correct order
  • Prevents partial or inconsistent deployment states

Architecture overview

LaunchFast deploys to Fly.io using:

  • A containerized Node.js application
  • SQLite databases replicated with LiteFS
  • Fly-managed volumes for persistent storage
  • Fly-managed Consul for primary/replica coordination
  • GitHub Actions for CI-driven deploys

Fly.io applications

A typical setup consists of two Fly apps:

  • Productionyour-app-name
  • Stagingyour-app-name-staging

Each app has its own persistent volume, secrets, and deployment lifecycle. The installer ensures naming, regions, and configuration are consistent.

Secrets

Required secrets are set automatically during installation:

  • SESSION_SECRET
  • HONEYPOT_SECRET

Environment-specific: ALLOW_INDEXING=false is recommended for non-production environments. Secrets are managed via fly secrets, not .env files.

LiteFS replication

LiteFS manages SQLite replication across Fly instances. A single primary instance handles writes, and all replicas serve reads. Consul determines the primary, and LaunchFast configures it to only allow instances in the primary region to become primary.

For local development or non-Fly environments, LiteFS automatically becomes a no-op. No code changes are required.

CI-based deployment

By default, LaunchFast uses CI-driven deployment:

  • main branch deploys to production
  • dev branch deploys to staging

Each deployment builds the container image, runs migrations, and deploys via Fly.io. This ensures deployments are repeatable and auditable.

Scaling regions

Deploy two instances in the primary region for zero-downtime deploys. Add more regions with fly scale count:

fly scale count 2 --region sjc
fly scale count 1 --region ams

Related