Install
Requirements
Section titled “Requirements”- Docker 24+ with Compose v2
- 512 MB of RAM for the auth container, plus whatever Postgres needs
- A hostname that browsers can reach — a LAN IP is fine for evaluation, a domain is required for cookies to be shared with your app (see Embedding)
1. Clone and configure
Section titled “1. Clone and configure”git clone https://github.com/TariqJandaly/ownauth.gitcd ownauth/dockercp .env.example .envThe three values that must be set:
# openssl rand -base64 32BETTER_AUTH_SECRET=
# The public origin of this instance. Everything the browser is told to call.BASE_URL=https://auth.example.com
# Generates the database password. Change it from the default.POSTGRES_PASSWORD=TRUSTED_ORIGINS is the list of browser origins allowed to call the API. Add your app:
TRUSTED_ORIGINS=https://app.example.com,https://auth.example.comExact origins only — no wildcards, no trailing slashes, no *.example.com.
2. Start it
Section titled “2. Start it”docker compose up -ddocker compose ps # both services should report healthycurl -s localhost:3000/api/healthThe first boot runs the schema migrations under a Postgres advisory lock, creates the ops tables in
ownauth.*, and fingerprints the secret. That takes a few seconds; the health check has a 30 second
grace period for exactly this reason.
3. First run
Section titled “3. First run”Open BASE_URL in a browser. An instance with no accounts redirects to /setup, where the first
account becomes the administrator. See First run.
Without Docker
Section titled “Without Docker”Node 22 and pnpm 10:
pnpm installpnpm --filter @ownauth/auth-service registry:buildpnpm --filter @ownauth/auth-service dev # http://localhost:3000DATABASE_URL and CONFIG_PATH are read from the environment; the config file is at
config/auth.config.yaml.
What you get
Section titled “What you get”| Path | What |
|---|---|
/setup |
first-run administrator creation; 404s once a user exists |
/admin |
the console |
/api/auth/* |
the auth API |
/api/auth/jwks |
public keys for JWT verification |
/api/openapi.json |
the generated API document |
/r/<name>.json |
registry items for shadcn add |
/api/health |
container health |