Configuration

xlwings Lite is configured via the following settings. You set them either as environment variables or by using the xlwings-lite CLI when deploying on a Linux VM. XLWINGS_LICENSE_KEY is required; all others are optional.

General

Variable

Default

Description

XLWINGS_LICENSE_KEY

—

Your xlwings license key (request a trial key).

XLWINGS_HOSTNAME

—

e.g., xlwings-lite.mycompany.com. Set this if the downloaded manifest.xml doesn’t use the correct URL.

PORT

8000

Sets the port on which the container, i.e., application runs.

Python packages

Variable

Default

Description

XLWINGS_ENABLE_PYPI

true

If true, allows installing packages directly from https://pypi.org/. Ignored when XLWINGS_PYPI_INDEX_URL is set.

XLWINGS_PYPI_INDEX_URL

—

Full URL of a private PyPI index (e.g., Nexus, Artifactory, devpi, Azure Artifacts) — the same URL you’d pass to pip install --index-url. Example: https://nexus.example.com/repository/pypi-proxy/simple/. For an authenticated index, the credential can be embedded in the URL (e.g., a token: https://<token>@host/.../simple/); it is forwarded to the index and never exposed to the browser.

XLWINGS_PYPI_AUTH_MODE

basic

How the container authenticates to XLWINGS_PYPI_INDEX_URL. basic uses credentials embedded in the URL (or none). Set to azure-managed-identity to authenticate to an Azure Artifacts feed using the Azure platform’s managed identity instead of a token — the container fetches a short-lived Microsoft Entra token at runtime, so no secret is stored. Requires hosting on Azure, see Azure Container Apps guide.

XLWINGS_PYODIDE_DEFAULT_VERSION

314.0.1

The Pyodide version used for newly created workbooks. Existing workbooks keep the version they were pinned to. Available versions: 0.27.5, 314.0.1.

CORS proxy

Variable

Default

Description

XLWINGS_CORS_PROXY_HOSTS

—

Comma-separated allowlist of hostnames that user Python code can reach via the built-in CORS proxy. Supports exact matches and *.domain.com wildcards (e.g., api.example.com,*.trusted.com). Unset (the default) disables the proxy unless XLWINGS_CORS_PROXY_ALLOW_ALL_HOSTS is true.

XLWINGS_CORS_PROXY_ALLOW_ALL_HOSTS

false

If true, proxies requests to every host without having to list them one by one, ignoring XLWINGS_CORS_PROXY_HOSTS. See the notes below before enabling this.

The proxy is transparent: users write their requests against the original URL, e.g., requests.get("https://api.example.com/data"), and the add-in routes cross-origin HTTPS requests to allowed hosts through the container, which adds the CORS headers on the way back. There is no URL prefix to add. Requests to hosts that aren’t allowed go directly from the browser, so they still work if the target server sends CORS headers itself. The proxy handles https:// targets on the default port 443 only.

Choosing between the two settings:

  • XLWINGS_CORS_PROXY_HOSTS is the strict option. Only the listed hosts can be reached through the container, and everything else stays subject to the browser’s CORS rules.

  • XLWINGS_CORS_PROXY_ALLOW_ALL_HOSTS=true is the convenient option: every web API works without maintaining a list. The trade-off is that every cross-origin request is now made by the container rather than the user’s machine. Any web filter or firewall that your company enforces on user traffic doesn’t apply to these requests, unless the container’s outbound traffic goes through the same controls.

Tooling

Variable

Default

Description

XLWINGS_ENABLE_MISSING_ADDIN_CLEANUP

true

If true, exposes a “Clean up missing add-in references” menu item that strips orphaned add-in references from workbooks in /data. Only required if workbooks that were created with the cloud add-in complain about a missing add-in.