OpenHunt Docs
Self-hosting

Configuration

Every environment variable the API reads, and the binary's three modes.

The API is one binary with three modes:

openhunt-api serve     # the HTTP server
openhunt-api worker    # background jobs (GC loops, email)
openhunt-api migrate   # apply migrations and exit

The compose stacks run serve and worker from the same image.

Environment variables

VariableDefaultWhat it does
DATABASE_URL— (required)Postgres connection string.
BIND_ADDR127.0.0.1:8080Address the server listens on. 0.0.0.0:8080 inside containers.
AUTO_MIGRATEfalseApply pending migrations on startup. The compose stacks set 1; flip off if you prefer explicit migrate runs.
ALLOWED_ORIGINShttp://localhost:3000,http://localhost:5173Comma-separated origins allowed for CORS — and required for cookie-authenticated writes, so it doubles as CSRF protection. Set to your web app's origin.
COOKIE_SECUREtrueMark session cookies Secure. Set false only for plain-HTTP localhost setups.
COOKIE_DOMAINunsetCookie Domain attribute — set to .your-domain.com when web and API live on sibling subdomains.
PUBLIC_WEB_URLunsetAbsolute web-app base used for links placed in email (verification, password reset).
RUST_LOGLog filter; the stacks use info,sqlx=warn.

The web tier

The web app needs NEXT_PUBLIC_API_URL at build time (it's baked into the client bundle) pointing at the API's public URL, and serves tiles from its public directory. When the web server resolves share links server-side it uses API_INTERNAL_URL to reach the API over the private network instead.

Postgres

The stack defaults to the postgis/postgis:17-3.5 image with a named volume, but the API only needs plain Postgres — any 17.x works. The pipeline doesn't touch Postgres at all; it works on files and produces files.

On this page