Deploy MergeWatch in environments with no external network access.
Some organizations require all software to run without any external network access — no outbound API calls, no container registry pulls, no telemetry. MergeWatch supports this by using a local LLM via Ollama as an embedded sidecar container.
This guide covers preparing container images and model weights on a connected machine, transferring them to an air-gapped environment, and running MergeWatch with Ollama for fully offline code reviews.
Review quality with local models is lower than with external API providers like Anthropic or OpenAI. Local models (e.g. Qwen 2.5 Coder 7B) work well for straightforward code reviews but may miss subtle issues that larger models catch. Test thoroughly before relying on air-gapped reviews for critical repositories.
You need a machine with internet access to download container images and model weights before transferring them to the air-gapped environment.
docker --version # 20.10+
2
Air-gapped machine
The target machine needs Docker and Docker Compose installed (these can be installed from offline packages).
docker --versiondocker compose version
3
Transfer medium
A USB drive, external disk, or internal file transfer mechanism with at least 15 GB of free space (container images + model weights).
4
Gather your GitHub App credentials
Variable
Description
GITHUB_APP_ID
Numeric App ID from the GitHub App settings page
GITHUB_PRIVATE_KEY
PEM-formatted private key generated for the App
GITHUB_WEBHOOK_SECRET
Secret used to validate incoming webhook payloads
In an air-gapped environment, your GitHub Enterprise Server instance must be reachable from the MergeWatch host on the internal network. Configure GITHUB_API_URL to point to your GHE instance.
Download the model weights using the Ollama CLI or container:
docker run --rm -v ollama-models:/root/.ollama ollama/ollama pull qwen2.5-coder:7b
qwen2.5-coder:7b provides a good balance of quality and resource usage for code review. For servers with more RAM and GPU, consider qwen2.5-coder:14b or qwen2.5-coder:32b.
3
Save images to tar files
docker save ghcr.io/santthosh/mergewatch:latest -o mergewatch.tardocker save ollama/ollama:latest -o ollama.tardocker save postgres:15-alpine -o postgres.tar
4
Export the Ollama model volume
docker run --rm -v ollama-models:/source -v $(pwd):/backup alpine \ tar czf /backup/ollama-models.tar.gz -C /source .
5
Copy files to transfer medium
Copy these four files to your USB drive or transfer medium:
Postgres runs as a container in the docker-compose stack above. Data is persisted to the pgdata Docker volume.
If your air-gapped environment has an existing PostgreSQL instance, remove the postgres service from docker-compose.yml and set DATABASE_URL in your .env file to the existing database connection string.
Set the webhook URL on your GitHub Enterprise Server App to the MergeWatch host followed by /webhook:
https://mergewatch.internal.example.com/webhook
You still need a TLS-terminated reverse proxy (nginx or Caddy) in front of port 3000 if your GitHub Enterprise Server requires HTTPS webhooks. See the VPS / Bare Metal guide for reverse proxy configuration.