Self-hosting Plyth
Run all of Plyth on your own servers. Same product, same features: one Docker image and PostgreSQL, next to your git host (GitHub, GitHub Enterprise Server, gitlab.com, self-managed GitLab, or several at once). There is no outside LLM. Your code talks to your git host, and the only other call Plyth makes is a daily license check (with a license key).
Everything is configured by environment variables. Postgres is the only service you run.
What you need
- Docker with Compose. Postgres comes with the compose file, or bring your own (the compose file uses 18, no minimum is tested; Plyth applies its migrations on start).
- An address for Plyth that your developers' browsers and CLIs can reach, for example
https://plyth.example.com. - A license key (
PLYTH_LICENSE_KEY) if anyone uses Plyth on private repositories (private and internal projects, for GitLab). Without one, those repositories get the 14-day trial. Public repositories need nothing. See pricing. - With a license key: outbound HTTPS from the Plyth server to
api.polar.sh, which validates the key at most once a day (the last success holds for 30 days). An instance with a license key can't run fully air-gapped. - An account on each git host you connect, with the rights to register an OAuth application there.
Variables every instance sets
| Variable | Example | Purpose |
|---|---|---|
DATABASE_URL |
postgres://plyth:<password>@database:5432/plyth |
Postgres connection |
BETTER_AUTH_SECRET |
output of openssl rand -hex 32 |
Signs sessions |
BETTER_AUTH_URL |
https://plyth.example.com |
Plyth's public address, no trailing slash; OAuth callbacks and webhooks use it |
PLYTH_LICENSE_KEY |
from plyth.io | Optional. Enables private repositories (pricing) |
A git host is configured when its client ID is set. At least one host must be configured, or the server refuses to start.
Start Plyth
Plyth runs from one Docker image, ghcr.io/plyth-io/plyth, next to Postgres (for linux/amd64 and linux/arm64).
It listens on port 3000 and answers /api/health. Every release is tagged latest and with a version such as
2026.10.30-1a2b3c4; pin a version in production so an update happens when you choose. The versions are listed at
GitHub.
In an empty directory, create docker-compose.yml:
services:
plyth:
image: ghcr.io/plyth-io/plyth:latest # better: a version, e.g. ghcr.io/plyth-io/plyth:2026.10.30-1a2b3c4
env_file: .env
environment:
DATABASE_URL: postgres://plyth:${POSTGRES_PASSWORD}@database:5432/plyth
ports:
- '3000:3000'
depends_on:
database:
condition: service_healthy
restart: unless-stopped
database:
image: postgres:18-alpine
environment:
POSTGRES_USER: plyth
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: plyth
volumes:
- database:/var/lib/postgresql
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'plyth']
interval: 5s
restart: unless-stopped
volumes:
database:
Next to it, create .env with the variables above and those of your git host (a guide below). DATABASE_URL comes
from the compose file, so set POSTGRES_PASSWORD instead:
POSTGRES_PASSWORD=<output of: openssl rand -hex 16>
BETTER_AUTH_SECRET=<output of: openssl rand -hex 32>
BETTER_AUTH_URL=https://plyth.example.com
PLYTH_LICENSE_KEY=<your license key, from plyth.io/pricing>
# … the variables of your git host
Start it and check that it's healthy:
docker compose up -d
curl http://localhost:3000/api/health
Plyth serves plain HTTP. Put your reverse proxy (nginx, Caddy, Traefik, a load balancer) in front of port 3000 to serve
BETTER_AUTH_URL over HTTPS. With your own Postgres instead of the one in the compose file, drop the database service
and set DATABASE_URL in .env.
Updating: back up the database, change the image's version (or keep latest), then
docker compose pull && docker compose up -d. Plyth applies its database migrations on start; there is no way back to
an older version after that other than restoring the backup.
GitLab: self-managed
You need an admin account on GitLab. Examples: GitLab at https://gitlab.example.com, Plyth at
https://plyth.example.com.
Before you start:
- Plyth reaches GitLab over HTTPS. If GitLab's certificate comes from an internal CA, give Plyth the CA with
NODE_EXTRA_CA_CERTS=/path/to/ca.pem(mounted into the container). - GitLab reaches Plyth for webhooks. Without that, the map works, but the merge request note and live discussions only update when someone uploads intent.
1. Create the bot user
Admin area → Overview → Users → New user. Username plyth, name Plyth, any email address you control. A regular
user: not external, not an administrator.
2. Create the bot's token
Open the user in the admin area and add an impersonation token (its Impersonation Tokens tab): name plyth,
scope api, an expiry date as far out as your instance allows. If the instance has impersonation tokens disabled, a
personal access token of the bot user (scope api) works too. Copy the token: it is GITLAB_BOT_TOKEN. Put the expiry
date in your calendar (step 9).
3. Create the OAuth application
Admin area → Applications → New application:
- Name:
Plyth - Redirect URI:
https://plyth.example.com/api/auth/callback/gitlab - Trusted: optional, skips the authorization screen for your users
- Confidential: yes
- Scopes:
read_userandapi(Plyth writes review comments, resolutions and approvals as the reviewer; nothing else)
Copy the application ID (GITLAB_CLIENT_ID) and the secret (GITLAB_CLIENT_SECRET).
4. Let GitLab send webhooks to Plyth
GitLab blocks webhooks to private network addresses by default. If Plyth runs in your internal network, go to Admin
area → Settings → Network → Outbound requests and add plyth.example.com to the allowlist of local addresses and
domain names (prefer this over allowing the whole local network). Plyth's hook keeps SSL verification on, so GitLab must
trust Plyth's certificate; for an internal CA, add it to GitLab's trusted certificates.
5. Configure Plyth
DATABASE_URL=postgres://plyth:<password>@database:5432/plyth
BETTER_AUTH_SECRET=<output of: openssl rand -hex 32>
BETTER_AUTH_URL=https://plyth.example.com
GITLAB_URL=https://gitlab.example.com
GITLAB_CLIENT_ID=<from step 3>
GITLAB_CLIENT_SECRET=<from step 3>
GITLAB_BOT_TOKEN=<from step 2>
GITLAB_WEBHOOK_SECRET=<output of: openssl rand -hex 32>
PLYTH_LICENSE_KEY=<your license key, from plyth.io/pricing>
| Variable | Purpose |
|---|---|
GITLAB_URL |
GitLab's address (default https://gitlab.com); an instance under a path works, e.g. https://example.com/gitlab |
GITLAB_CLIENT_ID |
OAuth application ID. Setting it turns GitLab on |
GITLAB_CLIENT_SECRET |
OAuth application secret |
GITLAB_BOT_TOKEN |
Optional. Without it the map works, but Plyth writes no merge request note and creates no webhook |
GITLAB_WEBHOOK_SECRET |
Optional. Without it there is no webhook endpoint (/api/webhooks/gitlab answers 404) and no hook is created |
6. Start Plyth
See Start Plyth. Open https://plyth.example.com and sign in with GitLab.
7. Connect your groups
In each top-level group that uses Plyth: Manage → Members → Invite members, user @plyth, role Maintainer. A
group covers all its projects and subgroups. The bot needs Maintainer to write the note and to register the webhook.
Plyth creates the project webhook itself the first time intent is uploaded for a project.
With a license key the bot is not a billing requirement: only hosted Plyth (Polar subscriptions) holds back private and internal group projects until the bot is a member of their top-level group. For you the bot is there for the note and the webhook, so Maintainer matters; membership alone doesn't.
8. Verify
With the CLI set up (Set up the CLI), push a branch with intent and open a merge request. Within a few seconds the merge request shows Plyth's note with a link to the map. Project → Settings → Webhooks lists Plyth's hook and its recent deliveries.
9. Rotate the bot token before it expires
Create a new impersonation token (step 2), replace GITLAB_BOT_TOKEN, restart Plyth, revoke the old token. An expired
token stops the merge request notes; the map keeps working.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Sign-in fails with "redirect URI invalid" | The redirect URI in step 3 doesn't match BETTER_AUTH_URL plus /api/auth/callback/gitlab exactly |
| The CLI says "you can't see this repository on its git host, or Plyth isn't connected to it" | The developer's GitLab account can't see the project |
| The CLI says "you need push access to this repository" | The developer has less than Developer access on the project |
| Map works, but no note on the merge request | The map names the bot when it isn't Maintainer of the project (step 7). No notice and still no note: GITLAB_BOT_TOKEN is not set, or it is invalid or expired (then the server logs "Could not check Plyth's bot access, the map shows no bot notice") |
| Note appears only after uploads, not on other events | Webhooks don't reach Plyth: check step 4 and the hook's recent deliveries |
| Webhook deliveries fail with 401 | GITLAB_WEBHOOK_SECRET changed: upload intent again and Plyth updates its hook |
| No deliveries reach Plyth, or they fail to connect to the old address | BETTER_AUTH_URL changed: the old hook still points at the old address and Plyth adds a new one beside it. Delete the old hook by hand |
| Webhook deliveries fail with 404 | GITLAB_WEBHOOK_SECRET is not set on the Plyth server |
| Login says "This email already has a Plyth account with another git host. Sign in with that host." | One email is one account on one host: sign in with the host that account was created with |
| Login says "Signing in didn't work. If your git host asks you to confirm your email address, confirm it and sign in again." | The GitLab account's email is unconfirmed: confirm it in GitLab, then sign in again |
| The map says Plyth isn't set up for a group | Hosted Plyth only: a group owner adds the bot user to the group |
GitLab: gitlab.com
The same as self-managed, with these differences:
GITLAB_URLstays unset (gitlab.com is the default).- Bot (steps 1 and 2): sign up a regular gitlab.com account for the bot, with a username of your own (for example
acme-plyth). Create a personal access token on it (avatar → Edit profile → Access → Personal access tokens), scopeapi. Personal access tokens have a maximum lifetime (365 days by default), so step 9 is mandatory. - OAuth application (step 3): there is no admin area. A group owner creates it under Group → Settings → Applications, with the same redirect URI and scopes.
- Webhooks (step 4): nothing to allow on GitLab, but
https://plyth.example.com/api/webhooks/gitlabmust be reachable from the internet. If it isn't, only the merge request note and live discussions are affected: they update on uploads instead. - Connecting groups (step 7): invite your bot account, not
@plyth.
GitHub
Plyth signs in with a GitHub App. On github.com, or on GitHub Enterprise Server, go to your organization's Settings → Developer settings → GitHub Apps → New GitHub App:
- GitHub App name: any name. Its URL form is the App's slug (
github.com/apps/<slug>):GITHUB_APP_SLUG. - Callback URL:
https://plyth.example.com/api/auth/callback/github. Leave Expire user authorization tokens on; Plyth refreshes them. - Setup URL:
https://plyth.example.com/change-map, with Redirect on update. - Webhook: active, URL
https://plyth.example.com/api/webhooks/github, secret fromopenssl rand -hex 32(GITHUB_WEBHOOK_SECRET). - Repository permissions: Contents read-only, Pull requests read and write. Account permissions: Email addresses read-only.
- Events: Pull request, Pull request review, Pull request review comment, Pull request review thread.
- Where can this GitHub App be installed? Only on this account, unless other organizations should use your instance.
On the App's page, copy the Client ID (not the numeric App ID) and generate a client secret. For pull request
comments, also note the numeric App ID and generate a private key (the whole .pem content).
| Variable | Purpose |
|---|---|
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET |
The GitHub App's client ID and secret (turns GitHub on) |
GITHUB_APP_SLUG |
The App's slug, for the map's install link |
GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY |
Optional. Pull request comments act as the App |
GITHUB_WEBHOOK_SECRET |
Optional. Verifies webhook deliveries |
For GitHub Enterprise Server, also set GITHUB_URL (for example https://github.example.com) and GITHUB_API_URL
(https://github.example.com/api/v3). Then install the App on the organizations that use Plyth.
GitHub and GitLab can run side by side. One email address is one account on one host.
Set up the CLI
Once Plyth runs and a git host is configured (a guide above), every developer does this on their machine:
curl -fsSL https://plyth.io/install.sh | sh
export PLYTH_URL=https://plyth.example.com # also in your shell profile
plyth login # open the link and approve, signed in with your git host
plyth init # in each repository
Without PLYTH_URL the CLI talks to https://app.plyth.io. If Plyth's certificate comes from an internal CA,
developers' machines must trust it: the CLI honors NODE_EXTRA_CA_CERTS=/path/to/ca.pem.
Intent is what the agent was asked to do and why. The CLI's hooks record it during agent sessions in a repository where
plyth init ran, and the pre-push hook uploads it to Plyth.