# Health check endpoints

> Monitor your self-hosted container's health with built-in liveness and readiness probes.

<Warning title="Enterprise feature">
  This feature is available only for the [Enterprise plan](https://buildwithfern.com/pricing). To get started, reach out to [support@buildwithfern.com](mailto:support@buildwithfern.com).
</Warning>

The self-hosted container exposes health check endpoints for Kubernetes and Helm deployments on port 8081. These endpoints help you monitor the container's health and ensure proper startup behavior.

The **liveness probe** detects unrecoverable failures and triggers container restart, while the **readiness probe** prevents traffic routing to containers that are still starting up. By using both probes, deployments no longer need arbitrary timeouts like `--wait --timeout 15m0s`.

## Available endpoints

### Liveness probe

`GET /liveness` verifies that all critical service processes are still running by checking their PIDs. Use this to distinguish between unrecoverable failures (process died) and slow startups.

```bash Usage
curl http://localhost:8081/liveness
```

| Response                  | Description                                                              |
| ------------------------- | ------------------------------------------------------------------------ |
| `200 OK`                  | All critical processes are alive                                         |
| `503 Service Unavailable` | One or more critical processes have died (container should be restarted) |

<Accordion title="Checked services">
  * PostgreSQL (via `pg_isready`)
  * MinIO (via `/minio/health/live`)
  * FDR server (via `/health`)
  * Next.js docs server (via root endpoint)
  * MeiliSearch (warning only, non-critical)
</Accordion>

### Readiness probe

`GET /readiness` verifies that all services are healthy and ready to serve traffic by testing their health endpoints. It returns success only when all services are fully initialized and responsive.

```bash Usage
curl http://localhost:8081/readiness
```

| Response                  | Description                                     |
| ------------------------- | ----------------------------------------------- |
| `200 OK`                  | All services are ready to serve traffic         |
| `503 Service Unavailable` | One or more services aren't ready (wait longer) |

<Accordion title="Checked services">
  * PostgreSQL (via `pg_isready`)
  * MinIO (via `/minio/health/live`)
  * FDR server (via `/health`)
  * Next.js docs server (via root endpoint)
  * MeiliSearch (warning only, non-critical)
</Accordion>

### Legacy health endpoint

`GET /health` provides backward compatibility with existing deployments. Returns the same status as the readiness probe.

```bash Usage
curl http://localhost:8081/health
```

## Configuration

Configure your Kubernetes or Helm deployment to use both probes:

```yaml
livenessProbe:
  httpGet:
    path: /liveness
    port: 8081
  initialDelaySeconds: 60
  periodSeconds: 10
  timeoutSeconds: 5
  failureThreshold: 3

readinessProbe:
  httpGet:
    path: /readiness
    port: 8081
  initialDelaySeconds: 30
  periodSeconds: 5
  timeoutSeconds: 5
  failureThreshold: 3
```