> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gomajordomo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Steward Setup

> Run the Majordomo Steward in your own VPC. Your prompts never leave your infrastructure.

The Steward is a lightweight agent that runs inside your infrastructure. It proxies LLM calls locally, writes request and response bodies to your S3 or GCS bucket, and sends only metadata to Majordomo Cloud. The dashboard works identically to the managed deployment.

## How it fits together

* **Steward** — runs in your VPC. Handles all LLM traffic. Writes bodies to your bucket. Reports metadata to Butler.
* **Butler + dashboard** — runs in Majordomo's cloud. Backs the web UI, manages API keys, dispatches replay and eval jobs. Never receives prompt content.

## What you need

* Docker (or Kubernetes) in your VPC
* PostgreSQL 14+ (not bundled — use RDS, Cloud SQL, or self-managed)
* An S3 bucket (AWS) or GCS bucket (GCP) for body storage
* A Majordomo Enterprise account

## Setup

This section covers running Steward in your VPC with Postgres and optional S3/GCS body storage.

### Prerequisites

* Docker (or Kubernetes)
* PostgreSQL 14+
* Optional: S3 or GCS bucket for body storage
* Majordomo Enterprise account and a Steward token (`mdm_st_...`)

### 1) Build or pull the image

From source:

```bash theme={null}
cd majordomo-steward
docker build -t majordomo-steward:latest .
```

### 2) Configure environment

Set the minimum required environment. You can pass these via `docker run -e` or your orchestrator.

```bash theme={null}
export ENCRYPTION_KEY=<64-hex-bytes>          # required for encrypting secrets at rest
export POSTGRES_HOST=localhost
export POSTGRES_PORT=5432
export POSTGRES_USER=majordomo
export POSTGRES_PASSWORD=...
export POSTGRES_DB=majordomo_steward
```

Optional (defaults are sensible): `LOG_LEVEL`, `PRICING_REMOTE_URL`, `PRICING_ALIASES_FILE`, provider `*_BASE_URL`s.

### 3) Initialize the database

```bash theme={null}
docker run --rm \
  -e ENCRYPTION_KEY -e POSTGRES_HOST -e POSTGRES_PORT \
  -e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB \
  majordomo-steward:latest migrate
```

### 4) Register with Butler

Create a Steward token in the Majordomo dashboard or via the CLI (`majordomo stewards create --name "prod"`). The token has the format `mdm_st_...` and is shown once at creation time — store it in your secrets manager. Then:

```bash theme={null}
docker run --rm \
  -e ENCRYPTION_KEY -e POSTGRES_HOST -e POSTGRES_PORT \
  -e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB \
  majordomo-steward:latest register \
  --token $MDM_STEWARD_TOKEN \
  --butler-url https://butler.gomajordomo.com
```

This stores the encrypted token and org details for job dispatch and usage ingest.

### 5) Run Steward

```bash theme={null}
docker run -d --name majordomo-steward \
  -p 7680:7680 \
  -e ENCRYPTION_KEY -e POSTGRES_HOST -e POSTGRES_PORT \
  -e POSTGRES_USER -e POSTGRES_PASSWORD -e POSTGRES_DB \
  majordomo-steward:latest
```

### 6) Configure body storage (optional but recommended)

In the Web dashboard, set up [Cloud Body Storage](/configuration/cloud-storage) at the Personal or Organization scope. Steward will upload request/response bodies there; Majordomo receives metadata only.

### 7) Verify

Point your SDK at the Steward and send a test request with `X-Majordomo-Key`. The request should appear in the dashboard with tokens, cost, and latency.

### Notes

* See [Request Headers](/reference/headers) for tagging and provider override options.

## What gets logged where

| Data                        | Destination                                | Who controls it |
| --------------------------- | ------------------------------------------ | --------------- |
| Prompt content              | Your S3 / GCS bucket                       | You             |
| Completion content          | Your S3 / GCS bucket                       | You             |
| Token counts, cost, latency | Majordomo Cloud                            | Majordomo       |
| Provider API keys           | Your Steward's Postgres, encrypted at rest | You             |

For security questionnaire answers and a data flow diagram, see [Security & Compliance](/guides/enterprise-security).
