Skip to main content
This page lives in the Users section and is also referenced from Deployment. If you arrived from there, your sidebar has switched to Users.

Environment Variables

CDT is configured entirely through environment variables. This page documents every key in .env.example: what it does, what a safe default looks like, and how it differs between development and production.

Variables are grouped by subsystem.

Database

VariableDescriptionExample
DATABASE_URLPostgreSQL connection string. Use the postgres hostname when running inside Docker Compose.postgresql://cdt:secret@postgres:5432/cdt
POSTGRES_USERDatabase user, used during initial container creation.cdt
POSTGRES_PASSWORDPassword for the user above. Use a long random value in production.change-me-in-production
POSTGRES_DBApplication database name.cdt

Object storage (MinIO / S3)

VariableDescriptionExample
MINIO_ROOT_USERMinIO admin username (used when initializing the container).minioadmin
MINIO_ROOT_PASSWORDMinIO admin password. Use a long random value in production.change-me-in-production
MINIO_ENDPOINTHostname of the MinIO server. localhost for local dev, minio inside Compose, public hostname in production.minio.example.com
MINIO_USE_SSLtrue in production behind TLS, false for local dev.true
MINIO_REGIONS3 region label. Most deployments use the default.us-east-1
MINIO_URLFull base URL the backend uses to reach MinIO.https://minio.example.com
S3_ACCESS_KEYAccess key for the application service account.cdt-app
S3_ACCESS_SECRETSecret for the access key.
NEXT_PUBLIC_MINIO_BUCKET_URLPublic base URL the browser uses to download assets.https://cdn.example.com

Authentication (NextAuth)

VariableDescriptionExample
AUTH_SECRETNextAuth signing secret. Must be at least 32 random characters. Generate with openssl rand -base64 32.
AUTH_URLPublic URL of the application — used for callback URLs.https://app.example.com
AUTH_TRUST_HOSTSet true when running behind a reverse proxy.true
AUTH_GOOGLE_IDGoogle OAuth client ID (only if Google sign-in is enabled).…apps.googleusercontent.com
AUTH_GOOGLE_SECRETGoogle OAuth client secret.

Email (SMTP)

Required for sending multi-factor authentication codes at sign-in.

VariableDescriptionExample
EMAIL_HOSTSMTP server hostname.smtp.resend.com
EMAIL_PORTSMTP port. 465 for SMTPS, 587 for STARTTLS.465
EMAIL_FROMSender address shown in email headers.noreply@example.com
EMAIL_USERSMTP username.
EMAIL_PASSSMTP password or API key.

External services

VariableDescriptionExample
NEXT_PUBLIC_GEOCODE_EARTH_API_KEYGeocode Earth API key for address search (hosted Pelias). Highest-quality results; used when set. Optional — see the geocoder fallback below.ge-…
NEXT_PUBLIC_GEOCODER_URLBase URL of a self-hosted Pelias-compatible geocoder (no key, same response format). Used when no Geocode Earth key is set.https://pelias.example.com
NEXT_PUBLIC_PHOTON_URLPhoton autocomplete endpoint for the key-free public fallback. Defaults to the public instance.https://photon.komoot.io
NEXT_PUBLIC_NOMINATIM_URLNominatim reverse-geocoding endpoint for the key-free public fallback. Defaults to the public instance.https://nominatim.openstreetmap.org
NEXT_PUBLIC_RECAPTCHA_SITE_KEYGoogle reCAPTCHA v3 public site key for the sign-in form.
NEXT_PUBLIC_RECAPTCHA_SECRET_KEYreCAPTCHA secret key.

Geocoder provider selection: the geocoder variables resolve in priority order — Geocode Earth (if a key is set) → self-hosted Pelias (NEXT_PUBLIC_GEOCODER_URL) → free public OpenStreetMap services (Photon for autocomplete, Nominatim for reverse). Address search therefore works out of the box with no key; set a key or self-hosted URL for higher quality and to avoid the public instances' rate limits. See Self-Hosting → Geocoding for the full table.

Tile and asset URLs

VariableDescriptionExample
NEXT_PUBLIC_MARTIN_SERVER_URLPublic base URL of the Martin tile server.https://tiles.example.com
NEXT_PUBLIC_ORGANIZATIONAL_DATASETS_URLBase URL for organization-published GeoJSON datasets.https://data.example.com/datasets
NEXT_PUBLIC_POINTCLOUD_API_URLBase URL of the Potree-compatible point cloud server. Required if point clouds are enabled.https://potree.example.com

Caching

VariableDescriptionExample
MEMCACHE_SERVERMemcache server address. Optional — used for cross-process caching when multiple Next.js workers run.memcache.example.com:11211
MEMCACHE_USERNAMEMemcache username.cdt
MEMCACHE_PASSWORDMemcache password.

Development versus production

A handful of variables behave differently between local development and production:

VariableDevelopmentProduction
MINIO_USE_SSLfalsetrue
AUTH_TRUST_HOSTunset or falsetrue (when behind a proxy)
AUTH_URLhttp://localhost:3000https://your-domain
MINIO_ENDPOINTlocalhostpublic hostname
NEXT_PUBLIC_MINIO_BUCKET_URLhttp://localhost:9000public CDN URL

Security notes

  • Never commit .env — it is listed in .gitignore for a reason.
  • Rotate AUTH_SECRET if it is ever logged or shared — invalidates all existing sessions.
  • Use different credentials in production than the defaults from .env.example.
  • Restrict MinIO and PostgreSQL ports in production — only the application server needs to reach them.