oCoreoCore Docs

Environment Variables

Complete reference of every environment variable used by oCore, including type, default value, and description.

This page documents every environment variable that oCore reads at startup. Variables are organized by subsystem. Required variables must be set for the application to start.

Database

VariableTypeDefaultRequiredDescription
DATABASE_URLstring--YesPostgreSQL connection string. Format: postgres://user:password@host:5432/dbname?sslmode=disable
POSTGRES_USERstringocoreNoPostgreSQL user (used by the Docker Compose postgres service, not the backend directly)
POSTGRES_PASSWORDstring--YesPostgreSQL password (used by the Docker Compose postgres service)
POSTGRES_DBstringocoreNoPostgreSQL database name (used by the Docker Compose postgres service)

The DATABASE_URL is read by the backend service. The POSTGRES_* variables are read by the PostgreSQL Docker image during initialization. In Docker Compose, DATABASE_URL is constructed from the POSTGRES_* values.

JWT / Authentication

VariableTypeDefaultRequiredDescription
JWT_SECRETstring--YesSecret key for signing JWT access and refresh tokens. Must be at least 32 characters.
JWT_ACCESS_EXPIRYduration1hNoHow long access tokens remain valid. Accepts Go duration format (e.g., 30m, 2h).
JWT_REFRESH_EXPIRYduration720hNoHow long refresh tokens remain valid. Default is 30 days.
COOKIE_DOMAINstring--NoDomain for auth cookies (e.g., .ocore.dev). Set this to share cookies across subdomains.

Generate a strong JWT secret:

openssl rand -base64 48

SMTP / Email

VariableTypeDefaultRequiredDescription
SMTP_HOSTstringlocalhostRecommendedSMTP server hostname for sending transactional emails (verification, password reset, notifications).
SMTP_PORTstring1025NoSMTP server port. Use 587 for STARTTLS or 465 for implicit TLS.
SMTP_FROMstringnoreply@ocore.localNoSender address for outgoing emails.
SMTP_USERNAMEstring--NoSMTP authentication username. Leave empty for unauthenticated relay.
SMTP_PASSWORDstring--NoSMTP authentication password.

In development, the defaults point to a local Mailpit instance. For production, configure a real SMTP provider (e.g., AWS SES, SendGrid, Postmark, or your own mail server).

OAuth Providers

VariableTypeDefaultRequiredDescription
OAUTH_GITHUB_CLIENT_IDstring--NoGitHub OAuth application client ID. Enable GitHub login.
OAUTH_GITHUB_CLIENT_SECRETstring--NoGitHub OAuth application client secret.
OAUTH_GOOGLE_CLIENT_IDstring--NoGoogle OAuth client ID. Enable Google login.
OAUTH_GOOGLE_CLIENT_SECRETstring--NoGoogle OAuth client secret.

Both OAuth providers are optional. If the client ID and secret are not set, the corresponding login button is hidden in the dashboard.

To set up GitHub OAuth:

  1. Go to GitHub Settings > Developer settings > OAuth Apps > New OAuth App
  2. Set the Authorization callback URL to https://ocore.example.com/api/auth/oauth/github/callback
  3. Copy the Client ID and Client Secret to your .env file

To set up Google OAuth:

  1. Go to the Google Cloud Console > APIs & Services > Credentials > Create OAuth client ID
  2. Set the Authorized redirect URI to https://ocore.example.com/api/auth/oauth/google/callback
  3. Copy the Client ID and Client Secret to your .env file

WebAuthn / Passkeys

VariableTypeDefaultRequiredDescription
WEBAUTHN_RP_IDstringlocalhostNoWebAuthn Relying Party ID. Set to your domain (e.g., ocore.example.com).
WEBAUTHN_RP_ORIGINstringhttp://localhost:3000NoWebAuthn Relying Party origin. Set to your full origin (e.g., https://ocore.example.com).

WebAuthn enables passkey and hardware security key authentication. Both WEBAUTHN_RP_ID and WEBAUTHN_RP_ORIGIN must match the domain users access the dashboard from.

Web Push / VAPID

VariableTypeDefaultRequiredDescription
VAPID_PUBLIC_KEYstring--NoVAPID public key for Web Push notifications.
VAPID_PRIVATE_KEYstring--NoVAPID private key for Web Push notifications.
VAPID_CONTACTstringmailto:admin@ocore.localNoContact email for VAPID (must start with mailto:).

Web Push notifications are optional. Generate VAPID keys with:

npx web-push generate-vapid-keys

SSH Gateway

VariableTypeDefaultRequiredDescription
SSH_GATEWAY_ENABLEDbooleantrueNoEnable the SSH gateway server. Set to false to disable SSH access to Odoo instances.
SSH_HOST_KEY_PATHstring./data/ssh_host_ed25519_keyNoPath to the SSH host key file. Auto-generated on first start if not present.
SSH_LISTEN_ADDRstring:2222NoAddress and port the SSH gateway listens on.
SSH_ENCRYPTION_KEYstring--ProductionEncryption key for stored SSH credentials. Must be at least 32 characters in production. In development, auto-derived from JWT_SECRET.

The SSH gateway allows users to connect to Odoo instances via SSH through oCore. The host key is stored in a persistent volume so that clients do not see host key change warnings after container restarts.

OAuth 2.1 Authorization Server

VariableTypeDefaultRequiredDescription
OAUTH_ISSUERstring--NoCanonical issuer URL for OAuth metadata endpoints. Falls back to APP_URL if not set, then to the request's scheme and host. Set this if the OAuth issuer URL differs from the dashboard URL (e.g., behind a reverse proxy with a separate domain).

In most deployments, OAUTH_ISSUER does not need to be set because APP_URL is used by default. Set it only when the OAuth authorization server is exposed on a different URL than the dashboard.

Application

VariableTypeDefaultRequiredDescription
SERVER_PORTstring8080NoPort the backend API server listens on.
APP_URLstringhttp://localhost:3000RecommendedPublic URL of the oCore dashboard. Used in emails, redirect URLs, and as the default OAuth issuer URL.
ENVIRONMENTstringdevelopmentNoApplication environment. Set to production to enable production security defaults.
GITHUB_TOKENstring--NoGitHub personal access token. Used for repository access and Git integration features.
TRANSFER_BINARY_PATHstring./bin/ocore-transferNoPath to the compiled ocore-transfer binary used for file operations on remote servers.

Frontend

These variables are set at build time as Docker build args. They are embedded into the Next.js bundle and cannot be changed at runtime.

VariableTypeDefaultRequiredDescription
NEXT_PUBLIC_API_URLstring--YesURL of the backend API, as seen from the user's browser. Must be a publicly accessible URL (e.g., https://ocore.example.com).
NEXT_PUBLIC_SSH_PORTstring2222NoSSH gateway port displayed in the dashboard UI for copy-paste connection strings.
NEXT_PUBLIC_WAITLIST_ENDPOINTstring--NoURL for waitlist form submissions on the docs/landing site. If not set, the waitlist form is hidden.

Documentation Site

These variables are used by the oCore documentation site (Next.js, separate from the main frontend):

VariableTypeDefaultRequiredDescription
SHOW_DEV_DOCSstring--NoSet to true to show contributing and developer-guide sections in the documentation sidebar. When not set or set to any other value, these sections are filtered out.

See the Frontend Configuration page for details on build-time vs runtime behavior.

Docker Compose Reference

Here is how each variable maps to the production Docker Compose file:

docker-compose.prod.yml (environment section)
services:
  backend:
    environment:
      DATABASE_URL: postgres://${POSTGRES_USER:-ocore}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-ocore}?sslmode=disable
      JWT_SECRET: ${JWT_SECRET}
      SSH_ENCRYPTION_KEY: ${SSH_ENCRYPTION_KEY}
      APP_URL: ${APP_URL}
      ENVIRONMENT: ${ENVIRONMENT:-production}
      SMTP_HOST: ${SMTP_HOST}
      SMTP_PORT: ${SMTP_PORT}
      SMTP_FROM: ${SMTP_FROM}
      SMTP_USERNAME: ${SMTP_USERNAME:-}
      SMTP_PASSWORD: ${SMTP_PASSWORD:-}
      OAUTH_GITHUB_CLIENT_ID: ${OAUTH_GITHUB_CLIENT_ID:-}
      OAUTH_GITHUB_CLIENT_SECRET: ${OAUTH_GITHUB_CLIENT_SECRET:-}
      OAUTH_GOOGLE_CLIENT_ID: ${OAUTH_GOOGLE_CLIENT_ID:-}
      OAUTH_GOOGLE_CLIENT_SECRET: ${OAUTH_GOOGLE_CLIENT_SECRET:-}
      WEBAUTHN_RP_ID: ${WEBAUTHN_RP_ID:-}
      WEBAUTHN_RP_ORIGIN: ${WEBAUTHN_RP_ORIGIN:-}
      VAPID_CONTACT: ${VAPID_CONTACT:-}
      VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
      VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
      SSH_GATEWAY_ENABLED: ${SSH_GATEWAY_ENABLED:-true}
      SSH_HOST_KEY_PATH: /app/data/ssh_host_ed25519_key
      SSH_LISTEN_ADDR: ${SSH_LISTEN_ADDR:-:2222}

  frontend:
    build:
      args:
        NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
        NEXT_PUBLIC_SSH_PORT: ${NEXT_PUBLIC_SSH_PORT:-2222}

All variables with :- syntax have default values and are optional. Variables without defaults are required or conditionally required.

Validation Rules

The backend validates configuration at startup. If validation fails, the server exits with a descriptive error message.

RuleError Message
DATABASE_URL is emptyDATABASE_URL is required
JWT_SECRET is emptyJWT_SECRET is required
JWT_SECRET is less than 32 charactersJWT_SECRET must be at least 32 characters
SSH_ENCRYPTION_KEY is less than 32 characters (production only)SSH_ENCRYPTION_KEY must be at least 32 characters
JWT_ACCESS_EXPIRY is not a valid Go durationinvalid JWT_ACCESS_EXPIRY "...": ...
JWT_REFRESH_EXPIRY is not a valid Go durationinvalid JWT_REFRESH_EXPIRY "...": ...
Was this page helpful?