Skip to main content
Fly.io runs Docker containers on lightweight VMs at edge locations around the world. Its CLI-driven workflow feels like running docker-compose but with built-in TLS, global networking, and managed Postgres.

Overview

This guide covers deploying MergeWatch to Fly.io, provisioning a managed Fly Postgres cluster, setting secrets, and configuring the GitHub App webhook.

Prerequisites

1

Install the Fly CLI

2

Gather your GitHub App credentials

3

Choose an LLM provider

Set LLM_PROVIDER to your preferred provider. For the default Anthropic provider, you also need ANTHROPIC_API_KEY.

Deploy to Fly.io

1

Launch the app

From a directory containing a Dockerfile (or use the MergeWatch image directly), run:
This creates a fly.toml configuration file. The --no-deploy flag lets you configure secrets before the first deploy.
fly launch auto-detects Dockerfiles and suggests sensible defaults. You can accept the defaults and customize later.
2

Set environment variables and secrets

Use fly secrets set for sensitive values. Fly encrypts these at rest and injects them as environment variables at runtime.
fly secrets set triggers a redeploy by default. Since we used --no-deploy above, the first deploy happens in the next step.
3

Configure the internal port

Edit fly.toml to set the internal port to 3000:
4

Deploy

Fly builds (or pulls) the image, starts the VM, and provisions a TLS certificate automatically.
5

Verify the deployment

Set up Postgres

Fly.io offers a managed Postgres service that runs as a Fly app in the same private network as your MergeWatch instance.
1

Create a Fly Postgres cluster

Fly prints the connection string when the cluster is ready:
2

Attach the database to MergeWatch

This automatically sets the DATABASE_URL secret on your MergeWatch app with the correct internal connection string.
Fly Postgres runs inside the same private network (6PN) as your app. No public internet exposure or firewall rules needed.

Configure the webhook URL

Your Fly.io app is available at https://your-app.fly.dev. Set the webhook URL on your GitHub App to:
Replace mergewatch with whatever name you chose during fly launch.
Make sure force_https = true is set in your fly.toml. GitHub requires HTTPS for webhook delivery.

Next steps

Configure review behavior

Tune sensitivity, ignored paths, and review focus areas.

Environment variables

Full list of supported environment variables.

Troubleshooting

Common issues and how to fix them.

Upgrading

How to update MergeWatch to the latest version.