# Self-hosting

> Run portable AppNotes with your OIDC provider, SQLite database, and filesystem storage.

Documentation index: https://appnotes.dev/docs/llms.txt

Portable AppNotes runs as one application container with SQLite for relational data, a filesystem for screenshot objects, and your OIDC provider for human identity. It does not require Cloudflare, WorkOS, R2, D1, or Stripe. Self-hosted deployments are sales-assisted so we can align identity, network, backup, and support requirements with your environment.

## Runtime shape

```text
Browser
  │
  ▼
AppNotes container
  ├── SQLite database
  ├── screenshot filesystem
  └── OIDC provider
```

The hosted Cloudflare profile uses the same application core with D1 and R2 adapters. The portable profile constructs SQLite and filesystem adapters instead. Stripe is not constructed in the portable runtime.

## Required configuration

Configure the portable service with:

```dotenv
APPNOTES_ORIGIN=https://appnotes.internal.example
APPNOTES_DATA_DIR=/var/lib/appnotes
APPNOTES_PORT=8787
APPNOTES_SITE_SESSION_SECRET=replace-with-at-least-32-random-bytes
APPNOTES_COOKIE_SECRET=replace-with-an-independent-32-byte-random-secret
APPNOTES_ORGANIZATION_NAME=Example Team

OIDC_ISSUER=https://identity.example.com
OIDC_CLIENT_ID=appnotes
OIDC_CLIENT_SECRET=optional-confidential-client-secret
OIDC_ADMIN_SUBJECT=replace-with-one-exact-oidc-subject
OIDC_GROUP_CLAIM=groups
```

An administrator can also map OIDC admin and member groups.

## Operational requirements

- Persist `APPNOTES_DATA_DIR` outside the container lifecycle.
- Back up the SQLite database and screenshot directory as one recovery set.
- Terminate TLS before the application and set `APPNOTES_ORIGIN` to the public origin users open.
- Use independent high-entropy values for the Site-session and cookie secrets.
- Configure one exact OIDC redirect URI for the deployed origin.
- Restrict network access according to your organization's review and guest-access policy.

To plan a self-hosted deployment, [contact us](mailto:support@plannotator.ai?subject=AppNotes).
