docker-compose.yml file. Most settings are optional with sensible defaults.
Configuration Overview
Anchor uses a minimal configuration approach:- Most environment variables are optional
- Defaults work out of the box for development and testing
- Only production deployments need additional configuration
- Some settings can be managed via the admin panel UI
Environment Variables
Application Settings
Base URL where Anchor is served. Required for OIDC authentication and proper redirects.Examples:
http://localhost:3000(development)https://notes.example.com(production)
Set this to your public URL when using a reverse proxy.
Secret key for signing authentication tokens. If not provided, a random secret is generated and persisted in
/data/.jwt_secret.Recommended: Let Anchor auto-generate this on first run.Controls user registration. If not set, admins can control this via the admin panel.Options:
enabled- Anyone can registerdisabled- Registration is closedreview- Registrations require admin approval
When not set, admins can dynamically change this setting through the admin panel UI.
Database Settings
PostgreSQL server hostname. Leave empty to use embedded PostgreSQL.
PostgreSQL server port.
PostgreSQL username.
PostgreSQL password.
PostgreSQL database name.
OIDC Authentication
Anchor supports OpenID Connect (OIDC) for single sign-on. Learn more in the OIDC Authentication guide.Enable OIDC authentication.
Display name shown on the login button.
Base URL of your OIDC provider.
OIDC client ID from your provider.
OIDC client secret. Omit for public clients using PKCE.
For mobile app support, configure your OIDC provider as a public client and omit this variable.
Hide the local username/password login form. Users can only sign in via OIDC.
Configuration Examples
Minimal Setup (Development)
docker-compose.yml
Production with External Database
docker-compose.yml
Use a
.env file to store sensitive values like JWT_SECRET and PG_PASSWORD.Production with OIDC Authentication
docker-compose.yml
OIDC-Only Mode (No Local Auth)
docker-compose.yml
Using .env Files
Store sensitive configuration in a.env file:
.env
docker-compose.yml
Admin Panel Configuration
Some settings can be managed through the admin panel UI:- Navigate to the admin panel (admin users only)
- Go to Settings
- Configure:
- User signup mode (if
USER_SIGNUPenv var is not set) - OIDC settings (if OIDC env vars are not all set)
- System settings
- User signup mode (if
Environment variables take precedence over admin panel settings. If you set
USER_SIGNUP or OIDC variables, the admin panel cannot override them.Viewing Current Configuration
Check which environment variables are active:Next Steps
Database Options
Learn about embedded vs external PostgreSQL
OIDC Authentication
Set up single sign-on with OIDC