Analytics cookies only (Google Analytics, PostHog). No ad networks, no cross-site tracking. See our privacy policy.
PA
Self-host PR-Agent
updated Nov 2026deployed by usprices checked · Jul 2026Install verified on Ubuntu 26.04 · Nov 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →
An open-source AI pull-request reviewer, the project formerly published as Qodo's (CodiumAI's) PR-Agent and now under The-PR-Agent organisation. Run as a webhook server, it listens to GitLab merge-request events and answers slash commands in comments such as /describe, /review, /improve and /ask, posting an AI-written description, review and code suggestions on the merge request. It works with GitHub, GitLab, Bitbucket, Azure DevOps and Gitea through separate server targets, and calls an LLM you configure (OpenAI, Anthropic, Gemini, Ollama and others via LiteLLM).
Pick PR-Agent when you want AI-written pull-request descriptions, reviews and code suggestions on your own infrastructure: it runs as a webhook server for GitHub, GitLab, Bitbucket, Azure DevOps or Gitea, answers comment commands such as `/describe`, `/review`, `/improve` and `/ask`, and calls whichever LLM you configure. It is MIT-licensed Python, the project formerly published by Qodo (CodiumAI) and now under The-PR-Agent organisation. Our snippet runs the GitLab webhook target of the official image, `pragent/pr-agent:0.49.0-gitlab_webhook` (released 2026-10-25, amd64 and arm64), on port 3000, with a random shared secret generated into `.env`. The Docker Hub namespace moved from `codiumai/pr-agent` to `pragent/pr-agent` at 0.34.2, so older instructions point at a frozen archive. The sizing guide says to start from about 1Gi of memory for the default maximum of four workers (fewer on a small VM), which is where our 1024 MB floor comes from; the idle container used about 300 MB on our test run. In the catalog, OpenHands, OpenCode and bolt.diy write code, whereas PR-Agent never edits your repository; it only comments on merge requests, and it needs a Git host that can reach it with a webhook.
What you need
Any VPS with at least 1024 MB of RAM
A domain you control — most self-hosted setups need HTTPS in front of them
About an afternoon — budget time for troubleshooting
Paid link — we earn a commission if you shop through it.
Install
Run these commands on your server:
# PR-Agent GitLab webhook server — based on the project's GitLab docs and the pragent/pr-agent 0.49.0-gitlab_webhook image# replace the two placeholders in .env with a real GitLab token (api scope) and LLM key, then run: docker compose up -d --force-recreatecat > .env <<EOFCONFIG__GIT_PROVIDER=gitlabGITLAB__URL=https://gitlab.comGITLAB__PERSONAL_ACCESS_TOKEN=replace-with-gitlab-tokenGITLAB__SHARED_SECRET=$(openssl rand -hex 20)OPENAI__KEY=replace-with-openai-keyEOFcat > docker-compose.yml <<'EOF'services: pr-agent: image: pragent/pr-agent:0.49.0-gitlab_webhook restart: unless-stopped env_file: .env ports: - 3000:3000EOFdocker compose up -dtimeout 180 bash -c 'until curl -fsS -o /dev/null http://localhost:3000/; do sleep 3; done'# → http://SERVER_IP:3000/webhook is the endpoint to add in GitLab (secret token = GITLAB__SHARED_SECRET in .env); GET / returns {"status":"ok"}
PR-Agent's installation docs and Dockerfile flag these before you rely on it:
non-negotiableThe server starts and answers GET / with {"status":"ok"} without credentials, but it does nothing until you set real values. The snippet writes placeholders for GITLAB__PERSONAL_ACCESS_TOKEN and OPENAI__KEY; replace them, then recreate the container. The docs say to create a dedicated GitLab user with the Developer role and an api token, because Reporter can comment but cannot update the merge request description for /describe.
non-negotiableThe webhook is http(s)://<host>/webhook with the secret token set to your GITLAB__SHARED_SECRET, and the triggers push, comments and merge request events enabled. GitLab must be able to reach the server, so a self-managed instance on a private network needs a route to this VM, and you should put TLS in front of port 3000.
non-negotiableMerge request diffs, titles and comments are sent to the LLM provider you configure, so code leaves your server unless you point it at a local OpenAI-compatible endpoint. The model is billed to you per call; large merge requests are expensive.
non-negotiableThe image runs gunicorn with several workers and the docs warn that importing the app costs roughly 250 MB, shared copy-on-write. If the container is killed during startup on a small VM, set GUNICORN_WORKERS=2 in .env.
non-negotiablePick the target that matches your Git host: the image is built per provider (github_app, gitlab_webhook, gitea_app, bitbucket_app and others), and an unversioned tag like latest moves under you. We pin the versioned 0.49.0-gitlab_webhook tag, which upstream says never changes once pushed.
PR-Agent used 250 MB of RAM at idle on GCP e2-standard-2 · Ubuntu 26.04 LTS · Docker 29.9.3 (first boot, measured Nov 2026). We list a minimum of 1024 MB.
Is the PR-Agent install snippet verified?
The PR-Agent install snippet is marked verified on Ubuntu 26.04 (Nov 2026).