The supplied GitHub Actions workflow deploys manually. Enable its commented push
trigger if you want deployments on master changes. fly.toml configures a web
process only; it does not start a Celery worker.
Sign up at https://fly.io and install the CLI:
# macOS
brew install flyctl
# Linux/WSL
curl -L https://fly.io/install.sh | shLogin:
flyctl auth loginflyctl apps create your-app-nameProvision PostgreSQL for your app and obtain its connection URI from the database
setup. ReadyKit reads SQLALCHEMY_DATABASE_URI, not DATABASE_URL; set it explicitly
using the postgresql:// scheme. Keep the database provider's required TLS options.
# Required secrets
flyctl secrets set -a your-app-name \
SECRET_KEY="$(openssl rand -hex 32)" \
SECURITY_PASSWORD_SALT="$(openssl rand -hex 32)" \
SECURITY_TOTP_SECRETS="$(openssl rand -hex 32)" \
SESSION_COOKIE_SECURE=True
# Use the actual connection URI from your database setup:
flyctl secrets set -a your-app-name \
SQLALCHEMY_DATABASE_URI="postgresql://user:pass@database-host/database-name"flyctl secrets list shows names and digests, not secret values. See the
Fly secrets reference.
Edit fly.toml and change the app name:
app = 'your-app-name' # Change this-
Create deploy token:
flyctl tokens create deploy -x 999h -a your-app-name
-
Add to GitHub:
- Go to your repo → Settings → Secrets and variables → Actions
- New repository secret:
FLY_API_TOKEN= (paste token)
Go to Actions tab in your GitHub repo → "Deploy to Fly.io" → "Run workflow"
Your app will be live at: https://your-app-name.fly.dev
Optional: Auto-deploy on push
Edit .github/workflows/deploy-fly.yml and uncomment the push trigger:
on:
workflow_dispatch:
push:
branches: [master]SSH into your app and create the admin:
flyctl ssh console -a your-app-name
# Inside the deployed container, for a fresh database:
flask create-db
flask installFor existing databases, run flask db upgrade instead of flask create-db.
Provision a Redis service reachable from the app for Redis sessions. Without Redis, sessions use the configured SQLAlchemy database. Background jobs also need a separate Celery worker; setting broker variables does not start one.
Then set the Redis secrets:
flyctl secrets set -a your-app-name \
REDIS_URL="redis://..." \
CELERY_BROKER_URL="redis://..." \
CELERY_RESULT_BACKEND="redis://..."flyctl logs -a your-app-nameflyctl ssh console -a your-app-nameflyctl status -a your-app-nameflyctl deploy -a your-app-name