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

# Self-hosting

> Run the Health API on your own infrastructure with Docker.

The hosted API at `https://api.foreverbetter.xyz` is the fastest way to start:
nothing to run, and the same endpoints documented throughout these guides. If
you would rather keep all data on your own infrastructure, the service is open
source and runs with Docker.

The self-hosted build uses open-source components only (Postgres, optional
object storage, optional SMTP). It needs no third-party API keys. Everything in
these docs works the same way against your own base URL.

## Quickstart

```bash theme={null}
git clone https://github.com/liveforeverbetter/longevity-api.git
cd health-api
cp .env.example .env
# set POSTGRES_PASSWORD, API_KEY_JWT_SECRET, and SERVICE_ACCOUNT_JWT_SECRET
docker compose up -d
```

The API listens on `http://localhost:8787`. Database migrations run on first
boot. Check health:

```bash theme={null}
curl http://localhost:8787/ready
```

Point your requests at your own base URL instead of the hosted one:

```bash theme={null}
curl http://localhost:8787/capabilities \
  -H "Authorization: Bearer $YOUR_KEY"
```

## What you get

The minimal stack is Postgres plus the API. Add the background workers for
genetics and wearable syncing, and optional profiles for S3-compatible payload
storage (MinIO) or a local mail inbox (Mailpit). Genomics analysis runs locally
in the bundled pipeline with no external service.

## Full guide

The repository has the complete setup, including storage and email options,
wearable OAuth, backups, and upgrades:

* [Self-hosting guide](https://github.com/liveforeverbetter/longevity-api/blob/main/SELF_HOSTING.md)
* [Configuration reference](https://github.com/liveforeverbetter/longevity-api/blob/main/.env.example)
* [Security notes](https://github.com/liveforeverbetter/longevity-api/blob/main/SECURITY.md)
