Skip to main content
Compiler ships as a single container image, so it runs on any platform that can run a container and give it PostgreSQL and Redis. This guide walks through deploying it on your own platform, such as Kubernetes, Amazon ECS, Nomad or Cloud Run. The steps use your platform’s usual building blocks. On Kubernetes, that’s a Deployment, Service, Ingress and Secret. On ECS, it’s a task definition and service behind an Application Load Balancer.

Prerequisites

  • A container platform that can pull public images from ghcr.io
  • A domain or subdomain for Compiler, such as compiler.yourdomain.com, and a TLS certificate for it
  • A way to provision PostgreSQL and Redis, either managed services or your own

Step 1: Provision PostgreSQL and Redis

PostgreSQL 16 or later

Create an empty database that Compiler owns. Managed services such as Amazon RDS, Aurora PostgreSQL, Cloud SQL and Azure Database for PostgreSQL work.The database user must be able to create tables and the pg_trgm extension, which a migration adds when Compiler starts. On RDS, the master user can.

Redis 7 or later

Managed services such as Amazon ElastiCache and Memorystore work. Compiler refuses to start without Redis.
Note both connection strings for the next step. Use a rediss:// URL when Redis requires TLS.

Step 2: Create the secrets

Generate an encryption key for stored credentials:
Store these values in your platform’s secret store, such as a Kubernetes Secret, AWS Secrets Manager or SSM Parameter Store:
Back up TOKEN_ENCRYPTION_KEY. If it is lost, every stored credential (GitHub App key, GitLab access token, AI provider keys, storage keys, Slack app secrets, connector tokens) has to be entered again, and Slack has to be reconnected.

Step 3: Run the container

Run one replica of the image with the secrets from step 2 and these settings: The image is public and built for linux/amd64 and linux/arm64, so no registry credentials are needed. The other environment variables are optional.
main is the latest build from the main branch; pull it again to update. Every build of main also has a sha-<commit> tag. Each release has an exact version tag, such as 3.0.0, and a minor version tag, such as 3.0, that moves to the latest patch release. Use an exact version or sha- tag to pin a version and roll back predictably. Settings in Compiler shows the commit your instance is running.
Without PORT, the app uses 3000 when that port is free and picks another when it isn’t. Setting it keeps the port your platform routes to fixed.
Compiler clones the repositories it reads into /repos. The contents can be lost safely: when someone asks a question, Compiler first fetches the project’s repositories and re-clones any that are missing. The first question after the contents are lost takes longer while this happens.Ephemeral storage, such as an emptyDir volume or ECS task storage, works. A persistent volume avoids re-cloning after every restart or deployment, which matters for large repositories. Size it for full clones of every repository in every project.
Database migrations run automatically when the container starts, so no separate migration job is needed.

Step 4: Configure the deployment lifecycle

Keep to one replica, and make sure an old and a new one never run side by side. Each replica runs migrations on startup and keeps its own clones of your repositories. When it receives SIGTERM, Compiler stops taking new work and gives in-progress answers up to 25 seconds to finish, so allow at least 30 seconds before the container is killed.
  • Set replicas: 1 and strategy.type: Recreate
  • Set terminationGracePeriodSeconds: 30 or more

Step 5: Add health checks

GET /up on port 3000 returns 200 OK when the app can reach its database, and 503 when it can’t. Use it for liveness and readiness probes, and for load balancer target health checks. Requests wait until startup migrations finish, so give the first check some room with an initial delay, a startup probe or an ECS health check grace period.

Step 6: Expose it over HTTPS

The container serves plain HTTP. Put a load balancer, ingress or reverse proxy in front of it to terminate TLS, and point your domain at it.
  • Route https://compiler.yourdomain.com to port 3000 on the container
  • Pass the public hostname through. For its MCP endpoint, Compiler compares the X-Forwarded-Host header, or the Host header when X-Forwarded-Host is absent, with the host in PUBLIC_URL. When they differ, it returns 421 Misdirected Request. If your proxy sets X-Forwarded-Host, make sure it holds the public hostname. Kubernetes ingress controllers and AWS load balancers pass the original host by default
  • Allow long-lived responses. Answers stream over HTTP, so raise any idle or read timeout below a few minutes
Compiler can run on a private network with no public address, with two exceptions. Slack sends events to /api/slack/events and project picker clicks to /api/slack/interactivity, so both paths need to be reachable from the internet. Claude and ChatGPT connect to the MCP server from their own servers, so it needs to be public for them too.

Step 7: Allow outbound access

If your network restricts egress, allow HTTPS (443) from the container to these hosts: The container also needs to reach your database, Redis and any connectors you add. If you configure storage, people’s browsers also need to reach <bucket>.s3.<region>.amazonaws.com. Compiler sends the browser straight to the bucket, with a link that expires after 15 minutes, to show uploaded images and open attached files. Compiler checks for new releases when it starts and once a day while it runs. It sends instances.usecompiler.com only its version and an anonymous instance ID, which is derived from TOKEN_ENCRYPTION_KEY and reveals nothing about it. No names, emails, code, conversations or the address your instance is served on are sent. As with any web request, the IP address it comes from reaches our servers and may appear in their logs, but it isn’t saved with the check. Admins then see when a newer release is out at the bottom of Settings. To turn it off, set CHECK_FOR_UPDATES=false. If the container can’t reach instances.usecompiler.com, the check fails quietly and nothing else is affected. Nothing else needs to be reachable.
To answer questions, Compiler runs shell commands inside the app container. These commands can reach any host the container can reach. To keep the instance to the hosts above, restrict outbound traffic at the network level, for example with security groups, network policies or an egress proxy, rather than relying on Compiler.

Step 8: Finish setup

Open https://compiler.yourdomain.com/setup, fill in the Set up your instance form to create the owner account, and click Save. Setup then walks you through:
  1. Connecting your code, through a GitHub App or a GitLab access token
  2. Choosing an AI provider, either the Anthropic API or AWS Bedrock
  3. Creating your first project
On AWS, Bedrock and S3 storage take an IAM access key ID and secret access key, entered in the app. Compiler doesn’t use instance profiles, ECS task roles or IAM Roles for Service Accounts (IRSA).

Updating

Pull the new image and restart the deployment. With the main tag, that’s a rollout restart on Kubernetes or a forced new deployment on ECS. With a pinned version or sha- tag, change the tag. Migrations run on startup.

Quick reference