# Evaluate with Docker Compose

> Run critlab on one machine from a source checkout, with Postgres, Redis, SeaweedFS and Caddy in Docker Compose.

Source: https://critlab.app/docs/self-hosting/evaluation

The fastest way to try self-hosted critlab is on one machine: Docker Compose runs Postgres, Redis, SeaweedFS and Caddy, and the three critlab services run from a source checkout. Plan on about fifteen minutes.

> **For evaluation only**
>
> This setup runs development servers on `localhost` with the example credentials from `.env.example`, and publishes the database, Redis and storage ports on the host. Do not expose it to a network. For anything shared, use [Production install with Helm](/docs/self-hosting/helm).

## Prerequisites

- Docker with Compose (Docker Desktop, Colima or plain Docker Engine).
- Node.js 22.23.4 or newer (the repository pins the line in `.nvmrc`) and pnpm 9 through Corepack.
- Git, and free local ports 3000, 4000, 4001, 4010, 5432, 6379 and 9000.
- Chrome or another browser that resolves `*.localhost` to your machine (the sandbox zone defaults to `s.localhost:4000`).

## 1. Get the code and configure it

```bash
git clone https://github.com/critlab/critlab.git
cd critlab
cp .env.example .env
```

Two secrets in `.env` are blank. Generate a value for each and paste it after the `=` on the matching line, `AUTH_SECRET=` and `SANDBOX_TOKEN_SECRET=`:

```bash
openssl rand -base64 32
openssl rand -base64 48
```

`.env` already points every service at the Compose defaults: Postgres on 5432, Redis on 6379, SeaweedFS's S3 API on 9000 with bucket `critlab`, the sandbox zone at `s.localhost:4000`, realtime at `ws://localhost:4010`. The [configuration reference](/docs/self-hosting/configuration) explains every variable.

## 2. Start the infrastructure

```bash
corepack enable
pnpm install
pnpm infra:up
```

`pnpm infra:up` runs `docker compose up -d` with:

| Service | Image | Host port | Notes |
| --- | --- | --- | --- |
| postgres | `postgres:16-alpine` | 5432 | user, password and database are all `critlab` |
| redis | `redis:7-alpine` | 6379 | |
| seaweedfs | `chrislusf/seaweedfs:4.47` | 9000 | S3 API only; credentials from `infra/seaweedfs/s3.json` |
| seaweedfs-init | `amazon/aws-cli` | — | creates the `critlab` bucket, then exits |
| caddy | `caddy:2-alpine` | 4000 | the sandbox origin, proxying to the sandbox service on 4001 |

## 3. Migrate and run

```bash
pnpm db:migrate
pnpm dev
```

`pnpm dev` starts web on `http://localhost:3000`, the sandbox service on 4001 (reached through Caddy on 4000) and realtime on 4010.

## 4. Sign in

Open `http://localhost:3000/signup` and enter any email address. With no mail transport configured, the six-digit code is printed in the `pnpm dev` output inside a box marked `[critlab:mail] console transport`. Enter it and you have a workspace.

Upload a build folder, open its share link, press <kbd>C</kbd> and click something to leave the first comment.

## 5. Try the features a licence unlocks

An unlicensed install caps each workspace at the Free plan's limits. To lift the limits for evaluation:

```bash
pnpm --filter @critlab/db set-plan <workspace-slug> pro
```

Team and Enterprise features (SSO, SCIM, audit export, your own bucket, custom domains, integrations, members-only access) need a licence key; ask us for an evaluation key. See [Licence](/docs/self-hosting/license).

## Stop and reset

```bash
pnpm infra:down
```

Data survives in the Compose volumes `critlab_postgres_data` and `critlab_seaweedfs_data`. Remove them with `docker volume rm` after `infra:down` to start over.

> **Open questions**
>
> A single `crit self-host up` command that runs web, sandbox and realtime as containers next to this Compose infrastructure, generates secrets and creates the first owner is planned (D-090) but not built. Today the Compose file runs the dependencies only. The positioning of that path (evaluation only, or production for small teams) is also still open.
>
> Where evaluators get the source is not settled either: the clone URL above is the one the app itself links to, but the repository's public availability is not confirmed.
