Skip to main content
Compiler is published as a Docker image at ghcr.io/usecompiler/compiler. This guide runs it with Docker Compose, next to Caddy for automatic SSL. To run Compiler on Kubernetes, ECS or another platform, see Other platforms.

Prerequisites

  • A server with Docker and Docker Compose
  • A domain name pointing at the server, with ports 80 and 443 open

Dependencies

Compiler needs PostgreSQL 16 or later and Redis 7 or later. Choose one of two paths.
The compose file in step 1 runs Postgres and Redis as their own containers next to Compiler, with their data in Docker volumes. There is nothing else to set up, so follow the steps from 1. Create the files as written.

1. Create the files

Make a folder for Compiler and put these three files in it.
Generate the password and the key with:
Keep TOKEN_ENCRYPTION_KEY safe. 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.

2. Start Compiler

Database migrations run on startup. Open https://compiler.yourdomain.com/setup, fill in the Set up your instance form to create the owner account, and click Save. Setup then asks for your GitHub App.

3. Create a GitHub App

Compiler reads your code through a private GitHub App that you own. The short version is below; GitHub App setup explains each setting. If your code is on GitLab, click Connect GitLab instead below the GitHub App form and paste an access token. GitLab setup explains how to create the token.
1

Start a new app

Go to https://github.com/settings/apps/new, or for an organization https://github.com/organizations/YOUR_ORG/settings/apps/new.
2

Name it

Set GitHub App name to anything unique (for example Acme Compiler) and Homepage URL to https://compiler.yourdomain.com.
3

Set the callback

Under Identifying and authorizing users, set the Redirect URI, and under Post installation, the Setup URL, both to https://compiler.yourdomain.com/onboarding/github-callback. Check Redirect on update.
4

Turn off what Compiler doesn't use

Uncheck Expire user authorization tokens and Request user authorization (OAuth) during installation. Under Webhook, uncheck Active.
5

Set permissions

Under Repository permissions, set Contents and Metadata to Read-only. Leave everything else as No access.
6

Create it

Under Where can this GitHub App be installed?, choose Only on this account, then click Create GitHub App.
7

Collect the credentials

Note the App ID at the top of the settings page and the slug from the app’s public URL (github.com/apps/<slug>). Then click Credentials in the sidebar, open Key pairs and click New key to download a .pem file.
Back in Compiler, enter the App ID, the slug and the full contents of the .pem file, click Continue, then click Install GitHub App and choose the repositories Compiler may read. GitHub sends you back to Compiler, where you choose your AI provider (Anthropic API or AWS Bedrock) and create your first project. To change any of this later, open Settings as an admin.

Behind a firewall

Without a public domain, skip Caddy and reach the app directly. Create docker-compose.override.yml next to the other files:
docker-compose.override.yml
Then open http://your-server:3000, and use that address in place of https://compiler.yourdomain.com when creating the GitHub App. Set PUBLIC_URL to the exact address people type. If it starts with https:// but people reach the instance over http://, the browser drops the sign-in cookie and sign-in fails without an error. Browsers turn off the clipboard on plain http:// addresses other than localhost, so Copy buttons (invite links, share links, messages) don’t work there. Serve the instance over HTTPS, for example behind your internal reverse proxy with an internal certificate, so your team can copy links. Until then, select the invite link text by hand.

Outbound access

The instance needs to reach: 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. With Bedrock VPC endpoints, create one for both bedrock and bedrock-runtime. Caddy only needs the certificate hosts when it serves your domain, so skip them behind a firewall. Connectors also reach the URL of each connector you add. 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 in .env. If the instance 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 firewall rules or an egress proxy, rather than relying on Compiler.

Updating

The compose file uses the main tag, the latest build from the main branch. To pin a version, replace main with a release tag, such as 3.0.0, or a sha-<commit> tag. Settings shows the version and commit your instance is running.

Data and backups

With the bundled database, back it up with:
Keep a copy of .env with it. With your own Postgres, use your provider’s backups.