Skip to main content

Environment Variables and Settings

Environment Variables

As many other applications, Dawarich uses environment variables to configure its behavior. The following environment variables are supported:

Core Settings

Environment VariableDefault ValueDescription
RAILS_ENVdevelopmentApplication environment. development value makes sure all errors will be shown explicitly, making easier remote debugging
SELF_HOSTEDtrueSet to true if you're self-hosting Dawarich
APPLICATION_HOSTSlocalhost,my.domain.comApplication hosts, provide multiple if you want your Dawarich instance to be available by multiple domains/ip addresses. Don't put protocols here, only host names.
APPLICATION_PROTOCOLhttpApplication protocol. Change to https if you want your Dawarich instance to be served via SSL
DOMAINnilPublic hostname used to build absolute URLs in outgoing emails (family invitations, digest emails, password resets). Required in production — leaving it unset will cause email delivery to fail with a URL generation error. No protocol, no trailing slash. Example: dawarich.example.com.
TIME_ZONEEurope/LondonTime zone. Full list of supported timezones available on Github
DISTANCE_UNITkmDistance unit. For miles, change to mi. All settings still should be provided in meters/kilometers
MIN_MINUTES_SPENT_IN_CITY60Minimum minutes spent in a city

Database Settings

Environment VariableDefault ValueDescription
DATABASE_HOSTdawarich_dbDatabase host
DATABASE_USERNAMEpostgresDatabase username
DATABASE_PASSWORDpasswordDatabase password
DATABASE_NAMEdawarich_developmentDatabase name
DATABASE_PORT5432Database port
RAILS_MAX_THREADS5Connection pool size for the Dawarich database

Redis Settings

Environment VariableDefault ValueDescription
REDIS_URLredis://dawarich_redis:6379Redis URL
RAILS_CACHE_DB0Redis cache database
RAILS_JOB_QUEUE_DB1Redis job queue database
RAILS_WS_DB2Redis WebSocket database

Background Processing

Environment VariableDefault ValueDescription
BACKGROUND_PROCESSING_CONCURRENCY5Background processing concurrency. Should not be higher than RAILS_MAX_THREADS. More info on Sidekiq docs
SIDEKIQ_USERNAMEnilSidekiq dashboard username
SIDEKIQ_PASSWORDnilSidekiq dashboard password

Reverse Geocoding

Environment VariableDefault ValueDescription
PHOTON_API_HOSTnilPhoton API host. Useful if you're self-hosting your own Photon instance
PHOTON_API_KEYnilPhoton API key. Useful if you're supporting Dawarich development on Patreon and want to use Photon API instance hosted by Freika without any limits
PHOTON_API_USE_HTTPSfalseUse HTTPS for Photon API requests. Set to true if you're using your own Photon instance behind a reverse proxy with SSL
GEOAPIFY_API_KEYnilGeoapify API key. Provide your own key if you want to use Geoapify reverse geocoding service
NOMINATIM_API_HOSTnilNominatim API host. Useful if you're self-hosting your own Nominatim instance
NOMINATIM_API_KEYnilNominatim API key. Provide your own key if you want to use Nominatim reverse geocoding service
NOMINATIM_API_USE_HTTPStrueUse HTTPS for Nominatim API requests. Set to true if you're using a Nominatim instance behind a reverse proxy with SSL
STORE_GEODATAfalseSet to true if you want to store geodata in the database. This will increase the size of the database and will require more disk space.

OIDC Authentication (Self-Hosted Only)

For detailed setup instructions, see the OIDC Authentication Tutorial.

Environment VariableDefault ValueDescription
OIDC_CLIENT_IDnilOIDC client ID from your identity provider
OIDC_CLIENT_SECRETnilOIDC client secret from your identity provider
OIDC_ISSUERnilOIDC issuer URL (enables auto-discovery)
OIDC_REDIRECT_URIAuto-generatedCallback URL. Defaults to {APPLICATION_URL}/users/auth/openid_connect/callback
OIDC_PROVIDER_NAMEOpenid ConnectCustom display name for the OIDC login button
OIDC_AUTO_REGISTERtrueAutomatically create accounts for new OIDC users
ALLOW_EMAIL_PASSWORD_REGISTRATIONfalseAllow traditional email/password registration alongside OIDC

Manual OIDC Configuration (Alternative to Discovery)

If your identity provider doesn't support OIDC discovery, use these instead of OIDC_ISSUER:

Environment VariableDefault ValueDescription
OIDC_HOSTnilHostname of your identity provider
OIDC_SCHEMEhttpsProtocol (https or http)
OIDC_PORT443Port number
OIDC_AUTHORIZATION_ENDPOINT/authorizeAuthorization endpoint path
OIDC_TOKEN_ENDPOINT/tokenToken endpoint path
OIDC_USERINFO_ENDPOINT/userinfoUser info endpoint path

Email (SMTP)

Environment VariableDefault ValueDescription
SMTP_SERVERnilYour SMTP server hostname
SMTP_PORTnilYour SMTP port (typically 587 for TLS)
SMTP_DOMAINnilYour SMTP domain
SMTP_USERNAMEnilYour SMTP username
SMTP_PASSWORDnilYour SMTP password
SMTP_FROMnilEmail address to send emails from

Email is required for:

  • Password reset
  • Year-end digest emails
  • Family invitation emails

Prometheus Monitoring

Environment VariableDefault ValueDescription
PROMETHEUS_EXPORTER_ENABLEDfalseEnable Prometheus metrics exporter
PROMETHEUS_EXPORTER_HOST0.0.0.0Prometheus exporter host
PROMETHEUS_EXPORTER_PORT9394Prometheus exporter port
warning

Important note on Prometheus exporter: even if you want to use it, make sure you have PROMETHEUS_EXPORTER_ENABLED set to false in dawarich_sidekiq container. Otherwise, you'll end up with two exporters and will have to deal with duplicate metrics. The PROMETHEUS_EXPORTER_HOST for dawarich_sidekiq should be set to dawarich_app or your name of the container.

Two-Factor Authentication (2FA)

Environment VariableDefault ValueDescription
OTP_ENCRYPTION_PRIMARY_KEYBuilt-in defaultPrimary key for encrypting OTP secrets. Production deployments should set a unique value.
OTP_ENCRYPTION_DETERMINISTIC_KEYBuilt-in defaultDeterministic key for OTP encryption. Production deployments should set a unique value.
OTP_ENCRYPTION_KEY_DERIVATION_SALTBuilt-in defaultSalt for OTP key derivation. Production deployments should set a unique value.
tip

These keys are used by Active Record Encryption to secure 2FA (TOTP) secrets. If not set, built-in defaults are used — fine for most self-hosted setups. For maximum security, generate unique values with openssl rand -hex 32 and set them in your environment.

Data Archival

Environment VariableDefault ValueDescription
ARCHIVE_RAW_DATAfalseEnable archival of raw import data. When enabled, original import files are preserved for potential re-processing.

User Settings

In addition to environment variables, users can configure personal settings through the UI:

Map Settings

SettingDescription
Preferred Map LayerDefault map style
Route OpacityTransparency of route lines (0-100%)
Fog of War MetersResolution of fog of war tiles
Minutes Between RoutesTime gap to start a new route
Meters Between RoutesDistance gap to start a new route
Speed Colored RoutesEnable speed-based route coloring
Globe ProjectionEnable 3D globe view (Map V2)
Live Map EnabledAuto-update map with new points

Visit Settings

SettingDescription
Time Threshold MinutesMinimum time at location for visit detection
Merge Threshold MinutesGap to merge nearby visits
Visits Suggestions EnabledEnable automatic visit detection

Transportation Thresholds

SettingDescription
Walking Max SpeedMaximum speed considered walking (km/h)
Cycling Max SpeedMaximum speed considered cycling (km/h)
Driving Max SpeedMaximum speed considered driving (km/h)
Flying Min SpeedMinimum speed considered flying (km/h)

Notification Settings

SettingDescription
Digest Emails EnabledReceive year-end digest emails

Photo Integration

SettingDescription
Immich URLURL of your Immich instance
Immich API KeyAPI key for Immich
Photoprism URLURL of your Photoprism instance
Photoprism API KeyAPI key for Photoprism