Documentation Frameworks and migration

Migrate from Fly.io

Translate fly.toml, secrets, process groups, volumes and Managed Postgres to Gregale, step by step.

~4 min read
On this page

A Fly.io app usually moves to Gregale without code changes: Gregale runs your Dockerfile as is, sets PORT, and passes configuration as environment variables. fly.toml settings do not carry over; this page maps them to gregale.yaml and walks through a move.

How Fly.io maps to Gregale

Fly.ioGregale
AppApp, deployed with gregale deploy
MachineInstance: a Firecracker microVM per instance. Idle apps park and wake on the next request.
DockerfileYour Dockerfile, as is (Container compatibility), or a source build without one (Deploy a web framework)
[http_service] internal_portPORT, which Gregale sets for every app; pin a fixed port with hosting.port in gregale.yaml
[[http_service.checks]] pathhosting.health in gregale.yaml
[deploy] release_commandA release command: release.command in gregale.yaml
auto_stop_machines and auto_start_machinesThe default: about a second after its last request an idle instance pauses and stops being billed, and it parks after the app's idle timeout (Scale to zero)
min_machines_runninggregale app scale my-api --min 1, billed like any running instance
[[vm]] memorygregale app scale my-api --ram 512, within your plan's limit (Plans)
[processes]Services in a project: a Compose service without ports: that no other service calls runs all the time as a worker
[env]Environment variables
Secrets (fly secrets set)Secrets (gregale env set)
[mounts] and volumesNo persistent disk: keep state in managed PostgreSQL or object storage
<app>.internal and <app>.flycastServices in the same project call each other by name: http://api.internal:10081
Managed PostgresManaged PostgreSQL, bound to the app as DATABASE_URL
Tigris object storageObject storage, S3-compatible, or keep Tigris over HTTPS
Scheduled Machines, supercronic, Cron ManagerA cron that calls a path on your app, or a scheduled job that runs an image to completion
fly logsgregale logs my-api (Logs)
Redeploying an earlier imagegregale rollback my-api --to v41 (Safe releases)

Translate fly.toml

An app configured like this:

toml
# fly.toml
app = "my-api"

[deploy]
  release_command = "python manage.py migrate"

[http_service]
  internal_port = 8000
  auto_stop_machines = "stop"
  auto_start_machines = true
  min_machines_running = 0

  [[http_service.checks]]
    method = "GET"
    path = "/healthz"
    interval = "15s"
    timeout = "5s"

becomes:

yaml
# gregale.yaml
hosting:
  health: /healthz
release:
  command: python manage.py migrate

Stopping idle instances and starting them on the next request is what Gregale does by default, so those settings need no translation. If the app reads PORT, the internal_port needs none either. If it always listens on the same port, set that port as hosting.port (8000 here); see Deployment overrides. The app must listen on 0.0.0.0.

Check what Gregale detects, from the repository root:

bash
gregale deploy --dry-run

Copy the configuration and deploy

Fly does not show secret values (fly secrets list shows only names and digests), so build a KEY=VALUE file from wherever you keep them, one per line, with values exactly as they should arrive (no quotes). Add the [env] values from fly.toml, and leave out the variables Fly sets itself, such as FLY_APP_NAME, FLY_REGION and PRIMARY_REGION. Then deploy:

bash
gregale deploy --name my-api --secrets-file fly.env
rm fly.env

The values are sealed before the first deployment starts. Values that span several lines do not fit this format; set those with gregale env set after the first deploy. If the deploy fails:

bash
gregale app health my-api --errors
gregale logs my-api

The database

Gregale has no one-step import from Fly Managed Postgres. Create a database and bind it:

bash
gregale add postgres --app my-api --region <region>
gregale postgres attach my-api-postgres my-api --access migration --env MIGRATION_DATABASE_URL

Run fly mpg proxy, which forwards a local port to the Fly database, and take a pg_dump through it. Restore the dump through Connect from your laptop (it needs app tasks on your plan), then point the app's migrations at MIGRATION_DATABASE_URL, the credential that can change the schema. DATABASE_URL goes through a connection pooler in transaction mode; see Managed PostgreSQL for what that changes.

An app that keeps SQLite on a Fly volume needs a new home for that data: Gregale gives instances no persistent disk, so move it to managed PostgreSQL or object storage.

Process groups and scheduled tasks

  • Process groups. Each group in [processes] becomes a service in a project. Describe them in a Compose file that builds the same Dockerfile with a different command: per service, and deploy it with gregale deploy. The group that serves HTTP publishes ports:; a worker does not. Services that build from the same directory cannot share a release.command, so write the release_command as a Compose step the web service waits for (Start order and migrations).
  • Scheduled tasks. Fly schedules Machines hourly, daily, weekly or monthly; Gregale takes a five-field cron expression. Expose the task as a route your app protects and call it with a cron, or push the task's image to a registry and run it as a scheduled job (gregale job create --image ... --schedule "0 3 * * *"). A supercronic process group becomes one of these too.
  • Calls between apps. An app that reaches another over .internal or .flycast calls it by name inside the project: http://api.internal:10081.

Switch traffic

Add your domain to the Gregale app and verify it as Custom domains describes, then move DNS. When the Gregale app has served traffic for a while, scale the Fly app's Machines to zero and destroy the app.

Fly.io alternatives in 2026 compares the main platforms people move to from Fly.io.

Spotted a problem on this page? Tell us