website/docs/reference/environment-variables.md
:::tip[Setting boolean values]
To set a boolean True, use one of the following string values: "true", "1" or "yes".
Any other value will be interpreted as False.
:::
FLET_APP_CONSOLEThe path to the application's console log file (console.log) in the temporary storage directory.
Its value is set in production mode.
FLET_APP_STORAGE_DATAA directory for the storage of persistent application data that is preserved between app updates. It is already pre-created and its location depends on the platform the app is running on.
FLET_APP_STORAGE_TEMPA directory for the storage of temporary application files, i.e. cache. It is already pre-created and its location depends on the platform the app is running on.
FLET_APP_USER_MODEL_IDWindows AppUserModelID used by the desktop client process for taskbar grouping and pinning.
For apps packaged with flet pack, this value is set automatically
so taskbar pins point to the packaged app executable instead of the cached Flet client executable.
FLET_ASSETS_DIRAbsolute path to the app's assets directory.
In production apps built with flet build, this environment-variable points to the bundled assets absolute location at runtime.
Use it when your code needs a filesystem path to bundled files (for example, JSON configs, databases, or model files).
For local runs, it may be unset depending on how the app is started, so use a fallback:
import os
from pathlib import Path
import flet as ft
default_assets_dir = Path(__file__).parent / "assets"
assets_dir = Path(os.environ.get("FLET_ASSETS_DIR", str(default_assets_dir))).resolve()
def main(page: ft.Page):
...
ft.run(main, assets_dir="assets")
For control properties like Image.src, continue using paths relative
to the ft.run(assets_dir=...), as described in the assets cookbook.
FLET_ANDROID_SIGNING_KEY_ALIASAndroid signing key alias used by
flet build for Android app signing.
It is used only when a keystore is configured.
FLET_ANDROID_SIGNING_KEY_PASSWORDAndroid signing key password used by
flet build for Android app signing.
If FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD is set
but this variable is not, the keystore password is reused as the key password.
FLET_ANDROID_SIGNING_KEY_STOREPath to the Android upload keystore (.jks) used by flet build
for Android app signing.
FLET_ANDROID_SIGNING_KEY_STORE_PASSWORDAndroid signing keystore password used by
flet build for Android app signing.
If FLET_ANDROID_SIGNING_KEY_PASSWORD is set
but this variable is not, the key password is reused as the keystore password.
FLET_CLI_NO_RICH_OUTPUTWhether to disable rich output in the console.
Defaults to "false".
FLET_PLATFORMThe platform on which the application is running.
Its value is one of the following: "android", "ios", "linux", "macos", "windows" or "fuchsia".
FLET_CLI_SKIP_FLUTTER_DOCTORWhether to skip running flutter doctor when a build fails.
Defaults to False.
FLET_HIDE_WINDOW_ON_STARTSet to true to start app with the main window hidden.
Defaults to False.
FLET_FORCE_WEB_SERVERSet to true to force running app as a web app. Automatically set on headless Linux hosts.
FLET_OAUTH_CALLBACK_HANDLER_ENDPOINTCustom path for OAuth handler.
Defaults to "/oauth_callback".
FLET_OAUTH_STATE_TIMEOUTMaximum allowed time (in seconds) to complete OAuth web flow.
Defaults to 600.
FLET_MAX_UPLOAD_SIZEMaximum allowed size (in bytes) of uploaded files.
Default is unlimited.
FLET_SECRET_KEYA secret key to sign temporary upload URLs.
FLET_SERVER_IPIP address to listen web app on, e.g. "127.0.0.1".
Defaults to 0.0.0.0 - bound to all server IPs.
FLET_SERVER_PORTTCP port to run app on.
8000 if the program is running on a Linux server or FLET_FORCE_WEB_SERVER is set; otherwise
random port.
FLET_SERVER_UDS_PATHThe Unix Domain Socket (UDS) path for the Flet server. It enables inter-process communication on Unix-based systems, with its value being a socket file path in the format flet_<pid>.sock.
FLET_SESSION_TIMEOUTSession lifetime in seconds.
Defaults to 3600.
FLET_UPLOAD_DIRAbsolute path to app "upload" directory.
FLET_UPLOAD_HANDLER_ENDPOINTCustom path for upload handler.
Defaults to "/upload".
FLET_WEB_APP_PATHA URL path after domain name to host web app under, e.g. "/apps/myapp".
Defaults to "/" - host app in the root.
FLET_WEB_NO_CDNSet to true to avoid loading CanvasKit, Pyodide, and fonts from CDNs.
FLET_WEBSOCKET_HANDLER_ENDPOINTCustom path for WebSocket handler.
Defaults to "/ws".
FLET_WEB_RENDERERWeb rendering mode: "canvaskit" (default), "skwasm" or "auto".
FLET_WEB_USE_COLOR_EMOJISet to True, true or 1 to load web font with colorful emojis.
FLET_WEB_ROUTE_URL_STRATEGYThe URL strategy of the web application. Its value can be either "path" (default) or "hash".