Skip to main content

Configuration reference

Every environment variable read by the API. The API also loads a .env file from its working directory; variables already set in the environment win. For the essentials, read Configuration.

Every variable is checked at startup: a missing required variable, an invalid value, an out-of-range number, an unknown variable with a known prefix (OIDC_, SFTP_, HOSTING_, SERVICES_, FUNCTIONS_, NETWORKS_, CRON_, COOKIE_, KEYCLOAK_, TRUSTED_) or a removed variable stops the API, with every problem listed.

Booleans accept true, 1, yes, on and false, 0, no, off. Lists are comma-separated.

Core​

VariableDefaultDescription
FRONT_URLrequiredURL of the web interface: the only origin allowed by CORS, the CSRF check and the WebSocket. Users are sent there after login
COOKIE_SECRETrequiredSecret signing the session cookies, at least 32 characters
PASSWORD_SECRETrequiredMust be set; not used by the current version
COOKIE_DOMAINhost of the APIDomain of the session cookies
APP_ENVproductiondevelopment enables debug logs
PORT2538Listen port (1 to 65535)
DATA_DIR./dataUsers, API keys, scheduled tasks, networks registry (JSON files). /app/data in the image
API_LOG_DIR./logDirectory of audit.log. /app/log in the image: mount it to keep the trail
TRUSTED_PROXIESempty (loopback only)Reverse proxies allowed to set X-Forwarded-For: CIDRs or addresses. The loopback is always trusted. A range wider than /8 (IPv4) or /32 (IPv6) is refused

Authentication (OIDC)​

VariableDefaultDescription
OIDC_PROVIDERmicrosoftmicrosoft, keycloak or generic
CLIENT_IDrequiredOAuth 2.0 client ID
CLIENT_SECRETrequiredOAuth 2.0 client secret
REDIRECT_URIrequiredPublic URL of the API; the callback is <REDIRECT_URI>/openid-connect/redirect
SCOPErequiredOAuth scopes, for example openid email profile
TENANT_IDrequired with microsoftMicrosoft Entra ID tenant
APPLICATION_IDrequired with microsoftMicrosoft Entra ID application
KEYCLOAK_URLrequired with keycloakKeycloak base URL
KEYCLOAK_REALMrequired with keycloakKeycloak realm
OIDC_DISCOVERY_URLrequired with genericDiscovery URL (.well-known/openid-configuration) of any standard OIDC provider

Scheduled tasks​

VariableDefaultDescription
CRON_HTTP_TIMEOUT900Default and maximum duration of an HTTP scheduled task, in seconds (1 to 86400)
CRON_MAX_JOBS50Maximum number of scheduled tasks (1 to 10000)

Private networks​

VariableDefaultDescription
NETWORKS_MAX50Maximum number of private networks, the system network not counted (1 to 500)
NETWORKS_RESERVED_RANGESemptyIPv4 ranges (at least /8) used outside Docker (LAN, VPN, static routes) that no private network may overlap

See Private networks.

Websites (hosting)​

VariableDefaultDescription
HOSTING_ENABLEDfalseEnables the websites module
HOSTING_STACKS_DIRECTORY/data/composeCompose projects directory (may be shared with CI stacks). Also used by the services module. Same path on the host and in the API container
HOSTING_SITES_DIRECTORY/data/websites/hostedSite data directory. Same path on the host and in the API container
HOSTING_TRAEFIK_NETWORKrequired when enabledExternal Docker network joined by the web services
HOSTING_TRAEFIK_HTTP_ENTRYPOINTwebTraefik HTTP entrypoint
HOSTING_TRAEFIK_HTTPS_ENTRYPOINTwebsecureTraefik HTTPS entrypoint
HOSTING_TRAEFIK_CERTRESOLVERletsencryptTraefik certificate resolver (empty: default certificate)
HOSTING_RUN_UID1000Owner of the site directories created by the panel
HOSTING_RUN_GID1000Group of the site directories created by the panel
HOSTING_DEFAULT_MEMORY_MB0Default memory limit of a site, in MB (0: unlimited, otherwise at least 64)
HOSTING_MAX_MEMORY_MB0Highest memory limit a site may request, in MB (0: the host memory, otherwise at least 64; capped to the host)
HOSTING_DEFAULT_CPUS0Default CPU limit of a site (0: unlimited, otherwise at least 0.1)
HOSTING_MAX_CPUS0Highest CPU limit a site may request (0: the host CPUs, otherwise at least 0.1; capped to the host)

A default above its maximum stops the API. See Websites.

SFTP​

VariableDefaultDescription
SFTP_ENABLEDfalseEnables the SFTP module (SFTPGo)
SFTP_DIRECTORYrequired when enabledBase directory of the sites
SFTP_API_URLrequired when enabledInternal URL of the SFTPGo admin API, for example http://sftpgo:8080
SFTP_API_KEYrequired when enabledSFTPGo admin API key
SFTP_DOMAINemptySFTP host shown to users
SFTP_PORTemptySFTP port shown to users
SFTP_WEB_USER_INTERFACEemptyURL of the SFTPGo web client shown to users
SFTP_INIT_DIRSweb,logsDirectories created in the home of a new user when requested (empty: none)

See SFTP.

Managed services​

VariableDefaultDescription
SERVICES_ENABLEDfalseEnables the managed services module
SERVICES_DATA_DIRECTORY/data/servicesData of the instances. Absolute path, same on the host and in the API container, outside the stacks, sites and SFTP directories
SERVICES_NETWORKloch-servicesDocker name of the system network services, shared by the instances and the sites (created internal if missing). Not bridge, host, none, default, the Traefik network nor a loch-net-* name
SERVICES_ENGINESempty (all)Enabled engines: postgres, mariadb, mysql, mongodb, redis, valkey, rabbitmq, nats, s3, elasticmq, mosquitto
SERVICES_<ENGINE>_PINNED_VERSIONSemptyVersions always offered at creation, even out of support, for example SERVICES_MYSQL_PINNED_VERSIONS=5.6. One variable per engine
SERVICES_UPDATE_CHECK_INTERVAL12Hours between two discoveries of versions and updates (0 to 168; 0: on demand only)
SERVICES_MAX_RESOURCES_PER_INSTANCE50Resources per shared instance (1 to 500)
SERVICES_MAX_DEDICATED_INSTANCES20Dedicated instances per engine (1 to 200)
SERVICES_ARCHIVE_ON_RETIREfalseRename the data of a removed instance instead of deleting it
SERVICES_EXPOSE_ALLOWED_CIDRS127.0.0.1Host addresses a port may be published on: CIDRs or addresses. 0.0.0.0 must be listed alone
SERVICES_ALLOW_PUBLIC_BINDfalseRequired for any non-loopback address in SERVICES_EXPOSE_ALLOWED_CIDRS
SERVICES_TLSautoauto: TLS required once an instance is published outside the loopback; off: TLS disabled
SERVICES_ALLOW_TLS_OPTIONALfalseLets an exposure offer TLS without requiring it (PostgreSQL, MySQL 8.4, MariaDB)
SERVICES_PUBLIC_HOSTemptyHost name or IP shown to clients and covered by the certificates (no scheme, no path)
SERVICES_TLS_CERT_FILEemptyCertificate to use instead of self-signed ones. Set together with the key
SERVICES_TLS_KEY_FILEemptyKey of that certificate
SERVICES_S3_ADMIN_API_KEYemptyEmpty: one Loch S3 instance per resource (the only mode available). Set: shared mode, not available yet, the s3 engine is disabled

Version discovery needs outbound HTTPS to registry-1.docker.io, auth.docker.io, ghcr.io, mirror.gcr.io and endoflife.date. See Managed services.

Functions (work in progress)​

VariableDefaultDescription
FUNCTIONS_ENABLEDfalseEnables the functions module. Needs HOSTING_STACKS_DIRECTORY
FUNCTIONS_DATA_DIRECTORY/data/functionsCode, runtime binaries, secrets and references. Same path on the host and in the API container; letters, digits and _ . / - only; outside the stacks, sites, SFTP, services and log directories; a subdirectory of DATA_DIR is allowed, not DATA_DIR itself
FUNCTIONS_MAX50Maximum number of functions (1 to 1000)
FUNCTIONS_MAX_MEMORY3008Highest memory of one function, in MB (128 to 10240)
FUNCTIONS_MAX_CODE_SIZE50Highest size of an uploaded zip, in MB (1 to 250)
FUNCTIONS_DEPLOYMENTS_KEPT3Deployments kept per function for a rollback, the active one included (1 to 20)
FUNCTIONS_TMP_SIZE512Default /tmp size of a function, in MB (16 to 10240)
FUNCTIONS_MAX_TOTAL_MEMORY0Sum of the memory limits of every function, in MB (0: the memory of the Docker host)
FUNCTIONS_MAX_TOTAL_CPUS0Sum of the CPU limits of every function (0: 4 × the CPUs of the Docker host)
FUNCTIONS_RUNTIME_DOWNLOADtrueDownload the Loch Lambda Runtime binary from GitHub when it is missing; false for offline installations
FUNCTIONS_RUNTIME_SOURCE_DIRemptyAbsolute path of a directory holding loch-lambda-runtime-linux-<arch>, read instead of downloading (wins over FUNCTIONS_RUNTIME_DOWNLOAD). It and its files must be owned by the panel's user or root and writable by nobody else

Sizes are in MB and accept a binary unit (512M, 1G). The download needs outbound HTTPS to github.com, release-assets.githubusercontent.com and objects.githubusercontent.com. See Functions module.

Removed variables​

The API refuses to start while one of these is set, and says what replaces it.

VariableReplaced by
SERVICES_EXPOSED_PORTS, SERVICES_PUBLISH_ADDRESSPorts chosen in the panel, within SERVICES_EXPOSE_ALLOWED_CIDRS
SERVICES_TLS_OPTIONALOptional TLS chosen per exposure, allowed by SERVICES_ALLOW_TLS_OPTIONAL
SERVICES_<ENGINE>_VERSIONSVersions discovered on the registries; SERVICES_<ENGINE>_PINNED_VERSIONS

Docker connection​

The API connects to Docker with the standard Docker client environment (DOCKER_HOST and related variables). Without them, it uses the local socket /var/run/docker.sock.

Interface​

The web interface container has its own variables (API_URL, WS_URL, APP_NAME, LOGO_URL, FAVICON_URL, SUPPORT_PHONE, SUPPORT_URL, STATUS_URL): see Installation.