.env file from the current working directory on startup.
Existing process environment variables always win over values in
.env. Variables set in your shell, passed via docker run -e, or injected by a CI or container platform override anything defined in .env.Core runtime
number
default:"8080"
The HTTP port the web server listens on. Change this when port
8080 is already in use on your host. Docker images and the Apify actor metadata both default to 8080.string
The full actor input as a JSON string. When set, this value overrides all input settings configured through the Apify Console or
INPUT.json. Use it for reproducible local or container boots where you want a fixed configuration without the Apify input system.string
default:"./storage"
The directory used for local storage — Apify Dataset files, Key-Value Store entries, and large payload offloads. Docker images set this to
/app/storage. Use a bind mount or volume when you need storage to persist across container restarts.string
default:"info"
Logging verbosity. Accepted values are
info and debug. Set debug during local development to see detailed request processing, forwarding, and sync activity.string
Set to
true to enable human-readable, colorized log output. Useful for local development and CLI demos. When unset or false, the logger emits newline-delimited JSON (NDJSON) suitable for log aggregators. The Apify actor metadata sets this to true by default.string
Set to
true to disable hot-reload of actor input. By default the runtime watches for input changes and applies them without restarting. Disable this when you want a fixed, deterministic configuration — for example, in automated test runs or staging deployments.string
default:"production"
Node.js environment mode. Docker images set this to
production. Set to development to enable additional logging or disable certain production-only optimizations.DuckDB storage
string
Override the directory where DuckDB stores its database file. Defaults to the same directory as
APIFY_LOCAL_STORAGE_DIR. Set this when you want to separate DuckDB data from the rest of actor storage.string
default:"logs.duckdb"
Override the DuckDB database filename. Useful when running multiple instances against the same storage directory.
Custom script worker heap
These variables control the memory ceiling for the sandboxed worker thread that runscustomScript snippets. Raise them only when your scripts are legitimately memory-intensive.
number
default:"32"
Maximum old-generation heap size for the custom script worker, in MB. Clamped to
16–256. Increase this when scripts that process large JSON bodies hit memory limits.number
default:"16"
Maximum young-generation (semi-space) heap size for the custom script worker, in MB. Clamped to
8–128.Local development example
A typical.env for local development:
Docker run example
Pass environment variables with-e flags when starting the container: