Deploy selfreview

Self-hosted AI code reviewer for GitHub PRs, using cheap open models

Deploy selfreview

Just deployed

/var/lib/postgresql/data

Just deployed

Just deployed

Deploy and Host Selfreview on Railway

Selfreview is a self-hosted AI code reviewer for GitHub. Open a pull request and it posts line-level comments on real bugs (security holes, broken logic, async mistakes, money math), each saying what breaks and how to fix it. By default it uses cheap open models through OpenRouter, so a review typically costs $0.002–0.007.

About Hosting Selfreview

This template deploys one Docker image as three services, plus Postgres:

  • api receives GitHub webhooks and serves the setup page and the dashboard. It has a public domain and a healthcheck on /health.
  • worker reviews pull requests. When it's redeployed, it gets 120 seconds to finish the review it's working on.
  • cron runs every 10 minutes. It resends webhooks GitHub failed to deliver and tracks which comments were acted on.
  • Postgres is both the job queue and the database. It stores metadata only, never code.

Each service takes its role from its service name. ADMIN_PASSWORD and ENCRYPTION_KEY are generated for you, and the only value you provide is an OpenRouter API key.

After deploying:

  1. Open the api service's URL and log in with ADMIN_PASSWORD from the api's Variables tab.
  2. Click Create GitHub App and choose your personal account or an organization. GitHub creates the app with every setting filled in.
  3. Install the app on the repositories you want reviewed, then open a pull request.

The project costs about $3 a month while idle.

Common Use Cases

  • Review every pull request in a small team without paying per seat.
  • Keep your code on your own infrastructure, sent only to the model provider you choose, or to your own vLLM or Ollama server.
  • Cap AI review spending with a per-review limit and a monthly budget.
  • Try different models on your own PRs: pick a model per repo in .selfreview.yml, and see the cost and how often comments were acted on in the dashboard.

Dependencies for Selfreview Hosting

  • An OpenRouter API key, or an Anthropic, OpenAI or OpenAI-compatible key set on the worker
  • A GitHub account or organization to create the GitHub App on

Deployment Dependencies

Why Deploy Selfreview on Railway?

Selfreview needs a public webhook endpoint, a background worker that can finish long jobs during a redeploy, a scheduled job and a database. On Railway these are four services in one project, created from one template, with private networking between them and generated secrets. When your team grows, add worker replicas.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
116
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
7
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
85