---
title: "Self-hosting"
description: "Run XID on your own Cloudflare account with Workers, D1, KV, R2, queues, and Durable Objects."
locale: "en"
---

> Documentation Index
> Fetch the locale documentation index at: https://xid.dev/en/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosting

## Required bindings

| Binding | Purpose |
| --- | --- |
| `DB` | D1 relational storage. |
| `CACHE` | KV cache for discovery, keys, and branding. |
| `STORAGE` | R2 object storage for assets and exports. |
| `EMAIL_QUEUE` | Transactional email queue. |
| `AUDIT_QUEUE` | Audit event queue. |
| `SESSION_REVOCATION` | Durable Object for session revocation state. |

## Required secrets

| Secret | Purpose |
| --- | --- |
| `KEK` | Envelope encryption for instance signing keys. |
| `PEPPER` | Server side password and token hashing pepper. |
| `BOOTSTRAP_TOKEN` | Protects instance initialization in self-hosted deployments. |

## Deployment checks

After deployment, verify health, OIDC discovery, JWKS, Hosted Auth configuration, and at least one authorization redirect from the instance issuer.

```shell
curl https://xid.dev/v1/health
curl https://xid.dev/.well-known/openid-configuration
curl https://xid.dev/jwks
curl https://xid.dev/auth/config
```

Source: https://xid.dev/self-hosting/index.mdx
