Skip to Content
Self-hostConfiguration

Configuration Reference

A self-hosted instance is configured through one .env file next to its Compose file. Set a real, non-placeholder OPENROUTER_API_KEY before startup; the container exits without it. Every other setting is optional. Once that key is set, the defaults boot a local workspace with sign-up enabled.

  • Release bundle or npx: copy the bundled .env.example to .env, in the same directory as compose.yml.
  • Source checkout: docker/.env.example is copied to docker/.env, next to docker-compose.selfhosted.yml.

Edit .env, then recreate the stack so the container picks up the change. In a release bundle, run this from the directory containing compose.yml:

docker compose --env-file .env -f compose.yml up -d

For a source checkout running the published image, run this from the repository root:

docker compose --env-file docker/.env -f docker/docker-compose.selfhosted.yml up -d

A plain restart does not re-read .env.

Contributors working on Genfeed from source use a different template; see source configuration below.

Image and ports

VariableDefaultPurpose
GENFEED_IMAGE_TAGlatest in the source template; the exact release in a bundleApplication image tag. Release bundles pin it for you.
SELFHOSTED_APP_PORT3000Host port for the web UI
SELFHOSTED_API_PORT3010Host port for the REST API (localhost only)
SELFHOSTED_WS_PORT3011Host port for live agent chat and notifications (localhost only)
SELFHOSTED_MCP_PORT3014Host port for the MCP server

Only the host side of each mapping changes. Inside the container the web app, API, WebSocket service, and MCP server always listen on 3000, 3010, 3011, and 3014.

The WebSocket host port binds to 127.0.0.1 only: that process also serves notification routes that must not be reachable from other machines. Expose it through a reverse proxy that forwards only /socket.io/; see Reverse proxy and HTTPS.

The published image builds in NEXT_PUBLIC_WS_ENDPOINT=http://localhost:3011. If you override SELFHOSTED_WS_PORT, provide a proxy reachable at that browser endpoint or build a custom image with a matching NEXT_PUBLIC_WS_ENDPOINT build argument. Changing NEXT_PUBLIC_WS_ENDPOINT only in .env does not update the browser bundle.

Model provider keys

See Provider API keys for how to get each one and which features need which key. Set OPENROUTER_API_KEY before the first start: empty or placeholder values stop the container before services run. All provider keys are blank in .env.example. Startup checks the key’s format; successful provider access still depends on your account and model access. Settings validates each key with the provider before saving it. After editing .env, recreate the stack.

VariableProvider
OPENROUTER_API_KEYOpenRouter (required before startup, and for chat, agents, drafts, and other text generation)
OPENAI_API_KEYOpenAI (optional; openai/* models only)
ANTHROPIC_API_KEYAnthropic (optional; anthropic/* models only)
REPLICATE_KEYReplicate
FAL_API_KEYfal
ELEVENLABS_API_KEYElevenLabs

Login wall

By default, local sign-up and sign-in are on, so the first visitor creates an account. To run a single-user workspace with no login wall instead, set BETTER_AUTH_ENABLED=false and NEXT_PUBLIC_BETTER_AUTH_ENABLED=false.

VariableDefaultPurpose
BETTER_AUTH_ENABLEDtrueTurns sign-up and sign-in on. Set false for no login wall. Read when the container starts.
NEXT_PUBLIC_BETTER_AUTH_ENABLEDFollows BETTER_AUTH_ENABLEDBrowser-side switch. Set it to match BETTER_AUTH_ENABLED.
BETTER_AUTH_URLThe public API URL (http://localhost:3010 by default)Where Better Auth runs
BETTER_AUTH_TRUSTED_ORIGINSThe public app URL (http://localhost:3000 by default)Origins allowed to sign in
BETTER_AUTH_SECRETGeneratedLeave empty to let the container generate one and keep it at /data/.better-auth-secret

The login page offers Email / Password by default. Those accounts live in the local database and need no mail provider. Magic Link appears only when RESEND_API_KEY is set, and Google sign-in works only when GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET are set. See Create the first user for how to create the first account. Add email or Google sign-in for the features that need them:

VariableNeeded for
RESEND_API_KEYMagic links, password resets, email verification, and invites
RESEND_FROM_EMAIL, RESEND_REPLY_TO_EMAILThe sender and reply-to addresses for that email
GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRETGoogle sign-in and the Google connectors, which share one Google Cloud OAuth web client

The login wall protects the REST API on port 3010 as well as the web UI.

BETTER_AUTH_ENABLEDRequests to the API
true (default)Protected routes need a valid session token or API key from any address; public routes such as health checks remain open. There is no fallback to the seeded admin@localhost user. Admin routes also need the platform admin role.
falseRequests from the machine itself or the Docker network (the web app calling the API) act as the seeded local admin. A request from any other address is refused with 401 unless it carries a valid API key.

X-Forwarded-For is not trusted unless TRUST_PROXY names your proxy, so a remote client cannot pass as a local one by sending a header.

Turning the login wall off does not turn off MCP authentication; see MCP server. Keep the login wall enabled before exposing the API through a reverse proxy; see the security note.

Public URLs

The container assumes everything is reached on localhost. If users reach your instance on another hostname, override these in .env. See Reverse proxy and HTTPS.

VariableDefault
GENFEEDAI_PUBLIC_URLhttp://localhost:3000
GENFEEDAI_APP_URLhttp://localhost:3000
GENFEEDAI_API_PUBLIC_URLSame as GENFEEDAI_API_URL (http://localhost:3010)
GENFEEDAI_MCP_PUBLIC_URLhttp://localhost:3014/mcp
GENFEEDAI_CDN_URLhttp://localhost:3012 (the files service origin, which must be reachable from the browser)
TRUST_PROXYUnset (X-Forwarded-For is ignored)

Database and storage

VariableDefaultPurpose
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DBgenfeed, genfeed_local, genfeedCredentials of the bundled PostgreSQL. Change the password before you expose the instance beyond your machine.
DATABASE_URLBuilt from the values aboveUse your own connection string to point at an external PostgreSQL
GENFEED_STORAGE_PATH/data/filesWhere generated files are stored inside the container
TOKEN_ENCRYPTION_KEYGeneratedEncrypts stored credentials. If you leave it empty, the container creates one and keeps it in /data/.encryption-key. Back it up with your data: stored credentials cannot be decrypted without it.

Persistent data lives in two Docker volumes: PostgreSQL data, and /data for generated files, the embedded Redis, and the generated secrets.

Optional integrations

VariablePurpose
LOGO_DEV_PUBLISHABLE_KEYCompany-logo fallback (see below)
RESTREAM_CLIENT_ID, RESTREAM_CLIENT_SECRET, RESTREAM_REDIRECT_URIRestream OAuth for livestream chat ingest. Connecting fails closed when unset.

Publishing channels, messaging apps, and other integrations have their own credentials; see Integrations.

Logo.dev fallback

Set LOGO_DEV_PUBLISHABLE_KEY to a Logo.dev publishable key (pk_...) to add a company-logo fallback when the website crawler cannot discover a logo. Logo.dev secret (sk_) keys are never accepted. The fallback sends only the normalized public hostname to Logo.dev. Scraped and imported brand logos keep precedence, and a missing key or failed lookup leaves the existing placeholder.

Before enabling it, review Logo.dev’s attribution requirements : commercial use on its free plan requires visible attribution. You are responsible for the plan and attribution that apply to your deployment.

Secret handling

  • Never commit .env, provider keys, auth secrets, webhook secrets, or customer data.
  • Keep backend credentials out of NEXT_PUBLIC_* variables, which reach the browser.
  • Rotate a credential immediately if it appears in a commit, log, screenshot, issue, or pull request.

Source development

Contributors use the repository root .env.example as the source-development template: copy it to .env.local, edit it, and run bun run env:sync local to generate app and service environment files. Root .env.local is the source of truth; do not edit the generated files by hand or commit them. Do not copy keys between this template and the Community .env.

See also

Last updated on