# Quick start

> Run Visto AI on your own server with Docker, connect a GitHub App, and watch it review pull requests in dry run before it posts anything.

Web page: https://visto-ai.com/docs/quick-start/

This page takes you from nothing to a running reviewer. You will run the service and Postgres with Docker Compose, create a GitHub App for it, and start in **dry run**: every pull request is reviewed and recorded, and nothing is posted to GitHub until you decide it should be.

## What you need

- **A server with Docker and Docker Compose**, reachable from GitHub over HTTPS. The service listens on port `8080`; put a reverse proxy or a tunnel with TLS in front of it. Plain Docker without Compose works too: see [Run it with docker run instead](#run-it-with-docker-run-instead).
- **A GitHub account that can create a GitHub App.** To review an organisation's repositories, you need to be an owner of that organisation.
- **A model API key.** [OpenRouter](https://openrouter.ai) works out of the box. Any OpenAI-compatible chat-completions endpoint works too.
- **Node 26 on the machine with your browser**, only if you create the GitHub App with the `app:create` command (recommended). It needs nothing installed beyond Node itself.

## 1. Get the files

You need three files in one folder: `compose.yaml`, your config and your secrets. Choose one of two ways.

### Use the prebuilt image

The image is published on Docker Hub as [`vistoaichecker/visto-ai`](https://hub.docker.com/r/vistoaichecker/visto-ai), for `linux/amd64` and `linux/arm64`. You do not need to clone the repository:

```bash
mkdir visto-ai && cd visto-ai
curl -fsSLO https://raw.githubusercontent.com/visto-ai/visto-ai/main/compose.yaml
curl -fsSL https://raw.githubusercontent.com/visto-ai/visto-ai/main/config.example.yml -o config.local.yml
curl -fsSL https://raw.githubusercontent.com/visto-ai/visto-ai/main/env.example -o .env
```

`compose.yaml` runs the `latest` tag. For production, pin a release instead, for example `vistoaichecker/visto-ai:0.6.0`; see [Running the service](https://visto-ai.com/docs/running-the-service/) for upgrades.

### Build from source

```bash
git clone https://github.com/visto-ai/visto-ai.git
cd visto-ai
cp env.example .env
cp config.example.yml config.local.yml
```

## 2. Create the GitHub App

Each deployment runs its own GitHub App. The `app:create` command creates it from the manifest shipped with Visto AI, so every permission and event is set for you. Run it on the machine whose browser you will use, from a checkout of the repository. If you used the prebuilt image, a shallow clone is enough:

```bash
git clone --depth 1 https://github.com/visto-ai/visto-ai.git visto-ai-src
cd visto-ai-src
npm run app:create -- --webhook-url https://reviews.example.com/webhooks/github --out .env.visto-app --name "Visto AI Acme"
```

- `--webhook-url` is the public HTTPS address of your service, with the path `/webhooks/github`.
- `--name` must be unique on GitHub, so include your organisation's name.
- Add `--org <your-org>` to create the app in an organisation rather than your personal account.

The command prints a local address. Open it, press the button, and confirm the app on GitHub. When it finishes, it prints the app's id and an install link, and writes two lines to `.env.visto-app`:

1. Copy the `APP_PRIVATE_KEY` and `WEBHOOK_SECRET` lines into the `.env` of your deployment, then delete `.env.visto-app`.
2. Keep the app id for the next step.
3. Open the install link and install the app on the repositories you want reviewed.

To set the app up in GitHub's own form instead, follow [Create the app by hand](https://visto-ai.com/docs/create-the-github-app/#create-the-app-by-hand).

## 3. Fill in your config and secrets

In `.env`, replace every `change-me` value you use:

| Variable | What to put there |
|---|---|
| `POSTGRES_PASSWORD` | A password of your own for the bundled Postgres. |
| `DATABASE_URL` | `postgres://postgres:<the same password>@db:5432/visto`. Percent-encode `@ : / # ?` in the password. |
| `OPENROUTER_API_KEY` | Your model API key. |
| `APP_PRIVATE_KEY`, `WEBHOOK_SECRET` | The two lines `app:create` wrote. |

In `config.local.yml`, pick your model and uncomment the `app` and `database` blocks:

```yaml
model:
  baseUrl: https://openrouter.ai/api/v1
  apiKey: { env: OPENROUTER_API_KEY }
  model: vendor/model-name        # any model id from openrouter.ai/models

dryRun: true

app:
  id: 123456                      # the id app:create printed
  privateKey: { env: APP_PRIVATE_KEY }
  webhookSecret: { env: WEBHOOK_SECRET }

database:
  url: { env: DATABASE_URL }
```

The config never holds a secret: `{ env: VARIABLE }` names the environment variable that does. Every key is documented in [config.example.yml](https://raw.githubusercontent.com/visto-ai/visto-ai/0faf484aa43f4fcdc1f30c1d5c056ea26c1c0d32/config.example.yml), and an unknown key is an error, so a typo stops the start instead of being ignored.

> Every review is paid for by your model account. `limits.spendPerDay` stops new reviews for the rest of the UTC day once that day's spend reaches it: 50 by default, in US dollars with OpenRouter.

To use another OpenAI-compatible endpoint, change `model.baseUrl` and the variable `model.apiKey` names. If the endpoint refuses a request that names a tool, set `model.toolChoice: auto`. See [Configuration](https://visto-ai.com/docs/configuration/).

## 4. Start it

```bash
docker compose up -d --wait
```

From a clone, add `--build` to build the image from source. Compose starts Postgres, waits for it, then starts the service, which runs its database migrations and begins listening. Check it:

```bash
curl -fsS http://localhost:8080/healthz
docker compose logs -f app
```

`/healthz` answers `ok`. The log is one JSON object per line. At start the service checks both connections:

- `{"event":"model_check","result":"auth"}` means the model endpoint refused your key.
- `{"event":"start_step_failed","step":"app_check",...}` means GitHub refused the app's id or private key.
- `feature_off` means a feature you switched on lacks a permission or an event on the GitHub App.

Make sure GitHub can reach the webhook address you gave the app. On the app's settings page, **Advanced** lists recent deliveries and lets you redeliver one.

## 5. Watch it in dry run

Open a pull request in a repository where the app is installed, or push to one. A push is reviewed after 180 quiet seconds, so a burst of pushes gives one review. In dry run the review is recorded in the database and nothing is posted. Read what it would have said in the UI (next step), or as [Leave dry run](https://visto-ai.com/docs/leave-dry-run/#reading-what-a-review-would-have-posted) describes.

## 6. Open the UI

The web UI shows every review, the activity across your repositories, the spend, and lets admins change settings without editing files. Set its public address in `config.local.yml`:

```yaml
ui:
  publicUrl: https://reviews.example.com
```

Restart the service and create the first admin:

```bash
docker compose restart app
docker compose exec app npm run accounts -- make --config /config/config.yml --name admin --role admin
```

The command prints a one-time password. Sign in with it at `https://reviews.example.com/ui/` within 72 hours and choose your own password. To let people sign in with GitHub, see [The UI](https://visto-ai.com/docs/the-ui/).

## 7. Go live

When you trust what you see, set `dryRun: false` in the config and run `docker compose restart app`, or switch dry run off in the UI's Settings. From then on Visto AI posts its reviews, answers `/review`, and follows up in its own threads. [Leave dry run](https://visto-ai.com/docs/leave-dry-run/) explains what changes.

## Check the webhook route without GitHub

To test the route and the secret before GitHub sends anything, send a signed sample webhook from inside the container. It posts only to this machine:

```bash
docker compose exec app npm run dev:send-webhook -- --url http://localhost:8080/webhooks/github --secret-env WEBHOOK_SECRET --kind pull_request
```

The kinds are `pull_request`, `review` and `comment`. For `comment`, `--body <text>` sets the comment's text, so `--body /review` sends a command. For `pull_request`, `--action opened|synchronize` (default `opened`) and `--head <sha>` (default `abc123`) choose the action and the head commit.

## Run it with docker run instead

Compose is the simplest path because it brings Postgres along. If you already run Postgres, or prefer plain `docker run`, the image needs only three things: the config mounted at `/config/config.yml`, the variables from `.env`, and port `8080`.

You do not need `compose.yaml`. Download the other two files as in step 1, then fill them in as in steps 2 and 3. Point `DATABASE_URL` at your own Postgres, for example `postgres://visto:<password>@db.internal:5432/visto`; the database must exist, and the service creates its tables at start. `POSTGRES_PASSWORD` is only for the bundled database, so you can delete it.

```bash
docker run -d --name visto-ai \
  --restart unless-stopped \
  --stop-timeout 660 \
  --env-file .env \
  -v "$PWD/config.local.yml:/config/config.yml:ro" \
  -p 8080:8080 \
  vistoaichecker/visto-ai:latest
```

`--stop-timeout 660` gives running reviews up to 10 minutes to finish when the container stops. `docker run --env-file` reads each value literally, so do not put quotes around values in `.env`.

To run Postgres in a container too, put both containers on one network and use the database container's name as the host:

```bash
docker network create visto
docker run -d --name visto-db --network visto --restart unless-stopped \
  -e POSTGRES_DB=visto -e POSTGRES_PASSWORD=<password> \
  -v visto-db-data:/var/lib/postgresql/data postgres:17
```

Then set `DATABASE_URL=postgres://postgres:<password>@visto-db:5432/visto` and add `--network visto` to the `docker run` for `visto-ai`.

In the rest of the guide, replace each Compose command with its plain Docker equivalent:

| Compose | docker run |
|---|---|
| `docker compose logs -f app` | `docker logs -f visto-ai` |
| `docker compose restart app` | `docker restart visto-ai` |
| `docker compose exec app <command>` | `docker exec visto-ai <command>` |
| `docker compose pull` and `up -d` | `docker pull vistoaichecker/visto-ai:<tag>`, then `docker stop visto-ai`, `docker rm visto-ai` and the same `docker run` |

## Next steps

- [The score](https://visto-ai.com/docs/the-score/): what the 0–100% human-review score means.
- [Automatic approval](https://visto-ai.com/docs/automatic-approval/): let low-risk pull requests merge without waiting for a person.
- [The merge gate](https://visto-ai.com/docs/merge-gate/): block a merge while a serious finding is unanswered.
- [Memory](https://visto-ai.com/docs/memory/): learn from where people stepped in on earlier pull requests.
- [Replay](https://visto-ai.com/docs/replay/) and [Backtest](https://visto-ai.com/docs/backtest/): measure the reviewer on your own history before you rely on it.
