> For the complete documentation index, see [llms.txt](https://docs.openg2p.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.openg2p.org/tools/openg2p-developer-setup/pbms.md).

# PBMS

| Item            | PBMS value                            |
| --------------- | ------------------------------------- |
| Clone profile   | `PROFILE=pbms`                        |
| Bootstrap       | `make pbms-setup`                     |
| Run             | `make pbms-run`                       |
| Odoo            | **8069**                              |
| PBMS staff API  | **8050** (not registry `:8001`)       |
| Celery queue    | `bg_task_worker_queue`                |
| Redis DB        | `PBMS_REDIS_DB=1` (registry uses `0`) |
| DBs             | `pbmsdb`, `bgtaskdb` (+ registry DB)  |
| Keycloak client | `openg2p-pbms-local` (optional)       |

`make pbms-run` still starts common infra + a registry (default Farmer) for beneficiary search.

### Commands

```bash
cp .env.example .env
make pbms-setup
make pbms-run
```

Manual:

```bash
make setup PROFILE=pbms
make install-odoo && make install-pbms-bg-tasks
make infra-up
make farmer-setup          # or nsr-setup — registry for search
make pbms-init && make init-pbms-bg-tasks
make pbms-run
```

### PBMS-specific `.env`

| Variable                | Default           | Purpose                                                       |
| ----------------------- | ----------------- | ------------------------------------------------------------- |
| `PBMS_REGISTRY_VARIANT` | `farmer-registry` | Registry DB for bg tasks (`national-social-registry` for NSR) |
| `PBMS_WITH_REGISTRY`    | `true`            | `false` = Odoo + bg tasks only                                |
| `PBMS_STAFF_API_PORT`   | `8050`            |                                                               |
| `USE_EXTERNAL_REDIS`    | `true`            | Set `false` for Docker Redis (common)                         |

Odoo must call the **PBMS** bg-task API, which reads the registry **DB** directly. `make pbms-run` sets this automatically.

### Beneficiary search

Empty until PBMS Celery finishes eligibility (`beneficiary_list_worker` in logs).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.openg2p.org/tools/openg2p-developer-setup/pbms.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
