All environment variables used by GeoLens, their defaults, and descriptions. Set these in the .env file at the project root.
Variable Default Required Description POSTGRES_DBgeolensYes PostgreSQL database name POSTGRES_USERgeolensYes PostgreSQL superuser username POSTGRES_PASSWORDNone (required) Yes PostgreSQL superuser password. Generate with openssl rand -base64 24. POSTGRES_HOSTdbNo Database hostname. Use db for Docker Compose (service name). POSTGRES_PORT5432No Database port (internal). The host-mapped port is configured separately.
Variable Default Required Description JWT_SECRET_KEYNone (required) Yes Secret key for signing JWT tokens. Generate with openssl rand -hex 32. JWT_ALGORITHMHS256No JWT signing algorithm ACCESS_TOKEN_EXPIRE_MINUTES15No JWT token lifetime in minutes GEOLENS_ADMIN_USERNAMENone (required) Yes Username for the automatically created admin account GEOLENS_ADMIN_PASSWORDNone (required) Yes Password for the initial admin account REGISTRATION_ENABLEDfalseNo Whether self-registration is enabled. When false, only admins can create users.
Variable Default Required Description UPLOAD_MAX_SIZE_MB500No Maximum upload file size in megabytes UPLOAD_STAGING_DIR/app/stagingNo Directory for temporary file storage during ingestion/export. Must be writable by the API runtime user (uid:gid 1001:1001). Mapped to upload_staging Docker volume. UPLOAD_ALLOWED_EXTENSIONS.zip,.gpkg,.geojson,.json,.csv,.tif,.tiff,.xlsx,.xlsNo Comma-separated list of allowed file extensions for upload PRESIGNED_MULTIPART_THRESHOLD_MB100No Files larger than this (MB) use multipart presigned S3 URLs. Only applies when STORAGE_PROVIDER=s3.
GeoLens validates staging writability at startup and before export execution. Both UPLOAD_STAGING_DIR and ${UPLOAD_STAGING_DIR}/exports must allow write access for the API runtime user.
Quick validation command:
docker compose exec api sh -lc ' \
dir=${UPLOAD_STAGING_DIR:-/app/staging}; \
mkdir -p "$dir/exports" && \
touch "$dir/.geolens-write-test" "$dir/exports/.geolens-write-test" && \
rm -f "$dir/.geolens-write-test" "$dir/exports/.geolens-write-test" '
If this command fails, fix ownership/permissions on the mounted path or set UPLOAD_STAGING_DIR to a writable directory, then restart the API container.
Variable Default Required Description PROCRASTINATE_SCHEMAcatalogNo PostgreSQL schema for the Procrastinate job queue tables
Variable Default Required Description PUBLIC_APP_URLhttp://localhost:8080No Browser-facing app URL. Used for share links and OAuth redirect URIs. PUBLIC_API_URLhttp://localhost:8080/apiNo Externally-reachable API base URL. Used in OGC self/collection/next link hrefs. PUBLIC_BASE_URLNone No Deprecated. Legacy alias for PUBLIC_API_URL. Use PUBLIC_API_URL instead.
Variable Default Required Description CORS_ALLOWED_ORIGINS"" (same-origin only)No Comma-separated list of allowed origins for cross-origin API requests. Required when the frontend is served from a different domain than the API.
Variable Default Required Description TILE_CACHE_TTL300No Tile cache TTL in seconds TILE_SIGNING_SECRETNone (falls back to JWT_SECRET_KEY) No Secret for signing tile request URLs. Set separately when you want to rotate tile secrets without invalidating JWT tokens. CDN_BASE_URLNone No CDN origin URL for tile delivery. When set, the frontend requests tiles from this URL instead of the API.
Variable Default Required Description LOG_JSONfalseNo Output logs in structured JSON format. Recommended for production. When enabled, Swagger UI (/api/docs) is disabled. LOG_LEVELINFONo Log level. Options: DEBUG, INFO, WARNING, ERROR.
Variable Default Required Description STORAGE_PROVIDERlocalNo Storage backend for uploaded files. Options: local, s3. S3_ENDPOINTNone When s3 S3-compatible endpoint URL. Leave unset for AWS S3. For MinIO: http://minio:9000. S3_BUCKETNone When s3 S3 bucket name. S3_ACCESS_KEY_IDNone When s3 S3 access key ID. S3_SECRET_ACCESS_KEYNone When s3 S3 secret access key. S3_REGIONus-east-1No S3 region. S3_ALLOW_HTTPfalseNo Allow HTTP (non-TLS) connections to S3 endpoint. Enable for local MinIO. S3_ADDRESSING_STYLEautoNo S3 addressing style. Options: auto, path, virtual. Use path for MinIO.
Variable Default Required Description DATABASE_URL_OVERRIDENone No Full PostgreSQL connection URL for managed databases (RDS, Cloud SQL). Overrides individual POSTGRES_* variables. DATABASE_SSL_MODEpreferNo Database SSL mode. Options: disable, prefer, require, verify-full. DATABASE_SSL_CA_CERTNone When verify-full Path to CA certificate file for database SSL verification. DATABASE_POOL_PRE_PINGtrueNo Enable connection pool pre-ping to detect broken connections before use. Adds slight latency per checkout. Set to false only if you need to disable this for a specific environment. DB_USE_EXTERNAL_POOLERfalseNo Enable external connection pooler mode (PgBouncer, RDS Proxy). Disables prepared statements.
These variables control the SQLAlchemy connection pool. Ignored when DB_USE_EXTERNAL_POOLER is true.
Variable Default Required Description DB_POOL_SIZE10No Maximum number of persistent connections in the pool. DB_MAX_OVERFLOW5No Maximum number of additional connections beyond DB_POOL_SIZE. DB_POOL_TIMEOUT30No Seconds to wait for a connection from the pool before raising an error. DB_POOL_RECYCLE1800No Seconds after which a connection is recycled (replaced). Prevents stale connections with managed databases. TILE_POOL_MIN_SIZE2No Minimum connections in the dedicated asyncpg tile query pool. TILE_POOL_MAX_SIZE10No Maximum connections in the dedicated asyncpg tile query pool.
Variable Default Required Description REDIS_URLNone No Redis/Valkey connection URL for cross-instance caching. Leave unset for in-memory caching (single-instance default). Example: redis://valkey:6379/0.
These variables configure the backup service (enable with docker compose --profile backup up -d).
Variable Default Required Description BACKUP_SCHEDULE0 2 * * *No Cron expression for automated database backups. Default: daily at 2:00 AM UTC. BACKUP_RETENTION_DAILY7No Number of daily backups to retain locally. BACKUP_RETENTION_WEEKLY4No Number of weekly (Sunday) backups to retain locally. BACKUP_S3_ENABLEDfalseNo Enable off-site backup upload to S3-compatible storage. Uses S3_* credentials.
Variable Default Required Description WORKER_SHUTDOWN_TIMEOUT30No Graceful shutdown timeout for the background worker in seconds
Variable Default Required Description REFRESH_TOKEN_EXPIRE_DAYS7No JWT refresh token lifetime in days.
Variable Default Required Description ENV_ONLY_CONFIGfalseNo When true, all admin-overridable settings are locked to their environment values. The PersistentConfig DB layer is bypassed for reads and returns 403 on writes. Use for hardened production deployments where operators want to prevent runtime configuration changes via the admin UI. GEOLENS_EDITION(auto-detected) No Override the auto-detected edition. Options: community, enterprise. Without this variable, the edition is enterprise if any plugin extensions are loaded, otherwise community. Controls which feature flags and UI elements are available.
Enterprise edition
Variable Default Required Description GEOLENS_ENTERPRISE_PATH/enterpriseNo Path to the geolens-enterprise package inside the container. Used by entrypoint scripts to auto-install enterprise extensions on startup. Set via docker-compose.enterprise.yml volume mount.
GeoLens supports two AI subsystems: inference (chat, map generation, metadata drafts) and embeddings (semantic search). They can use different providers.
API keys are set exclusively via environment variables. All other AI settings (provider, model, base URL) can also be overridden at runtime from the admin Settings > AI tab.
Variable Default Required Description ANTHROPIC_API_KEYNone No Anthropic API key. When set, Anthropic is the default inference provider. LLM_MODELclaude-sonnet-4-20250514No Default Anthropic model name (admin-overridable). OPENAI_API_KEYNone No OpenAI-compatible API key. Used for inference when Anthropic key is absent, and always used for embeddings. OPENAI_MODELgpt-4oNo Default OpenAI-compatible model name (admin-overridable). OPENAI_BASE_URLNone No Custom endpoint for OpenAI-compatible providers (Ollama, Groq, Together). Leave unset for default OpenAI.
Embeddings always use the OpenAI-compatible API. Anthropic does not provide an embedding endpoint.
Variable Default Required Description EMBEDDING_MODELtext-embedding-3-smallNo Embedding model name (admin-overridable). EMBEDDING_DIMS1536No Expected vector dimensions (admin-overridable, auto-detectable from admin UI). EMBEDDING_BASE_URLNone No Separate endpoint for embeddings. Falls back to OPENAI_BASE_URL if unset.
Anthropic inference + OpenAI embeddings (recommended):
ANTHROPIC_API_KEY=sk-ant-...
OpenAI for everything:
Anthropic inference + Ollama embeddings:
ANTHROPIC_API_KEY=sk-ant-...
OPENAI_API_KEY=ollama # any non-empty value
EMBEDDING_BASE_URL=http://ollama:11434/v1
EMBEDDING_MODEL=nomic-embed-text
Ollama for everything:
OPENAI_API_KEY=ollama # any non-empty value
OPENAI_BASE_URL=http://ollama:11434/v1
EMBEDDING_MODEL=nomic-embed-text
These variables control which ports are exposed on the Docker host. They do not affect internal container communication.
Variable Default Description DB_PORT5432Host port for PostgreSQL. Set to 5434 in .env.example to avoid conflicts. API_PORT8000Host port for the FastAPI backend. Set to 8001 in .env.example. FRONTEND_PORT8080Host port for the frontend.
These are fixed inside Docker containers and are not configurable:
Service Port Protocol PostgreSQL (db) 5432 TCP FastAPI (api) 8000 HTTP Worker (worker) 8001 HTTP (health only) Titiler (titiler) 8000 HTTP Frontend (frontend) 5173 HTTP (Vite dev server)
Volume Purpose Mount Point pgdataPostgreSQL data persistence /var/lib/postgresql/data on dbupload_stagingUploaded file staging area /app/staging on api
POSTGRES_PASSWORD=secure-db-password
JWT_SECRET_KEY=a1b2c3d4e5f6... # Use: openssl rand -hex 32
GEOLENS_ADMIN_USERNAME=admin
GEOLENS_ADMIN_PASSWORD=secure-admin-password
# AI (optional — omit to disable AI features)
ANTHROPIC_API_KEY=sk-ant-... # Inference (chat, map generation)
OPENAI_API_KEY=sk-... # Embeddings (semantic search)
# Ports (non-default to avoid conflicts)