> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.recursiv.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.recursiv.io/_mcp/server.

# Self-Hosting

## Overview

Recursiv can be self-hosted using Docker Compose, Kubernetes, or a manual setup. The platform requires:

* **Node.js 18+** runtime
* **PostgreSQL 15+** database
* **Redis 7+** for caching and rate limiting
* **R2/S3-compatible** object storage (optional, for file uploads)

## Docker Compose (recommended)

The quickest way to self-host:

```bash
git clone https://github.com/recursivlabs/recursiv.git
cd social.dev-app/deploy/self-host

# Copy and configure environment
cp .env.example .env
# Edit .env with your settings

docker compose up -d
```

## Kubernetes

Helm chart available at `deploy/self-host/kubernetes/`:

```bash
helm install recursiv ./deploy/self-host/kubernetes \
  --set env.DATABASE_URL="postgresql://..." \
  --set env.REDIS_URL="redis://..." \
  --set env.BETTER_AUTH_SECRET="$(openssl rand -base64 32)"
```

See the [Kubernetes README](https://github.com/recursivlabs/recursiv/tree/main/deploy/self-host/kubernetes) for full configuration options.

## Environment Variables

| Variable               | Required | Description                               |
| ---------------------- | -------- | ----------------------------------------- |
| `DATABASE_URL`         | Yes      | PostgreSQL connection string              |
| `REDIS_URL`            | Yes      | Redis connection string                   |
| `BETTER_AUTH_SECRET`   | Yes      | Secret for session encryption             |
| `BASE_DOMAIN`          | No       | Your custom domain (default: recursiv.io) |
| `R2_ENDPOINT`          | No       | S3-compatible storage endpoint            |
| `R2_ACCESS_KEY_ID`     | No       | Storage access key                        |
| `R2_SECRET_ACCESS_KEY` | No       | Storage secret key                        |

See `.env.example` for the full list of configuration options.