> ## Documentation Index
> Fetch the complete documentation index at: https://supahooks.ar27111994.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables for self-hosted deployments

> Environment variables for running Webhook Debugger & Logger locally or in Docker: port, input, storage path, logging level, and custom script heap tuning.

When you run Webhook Debugger & Logger outside of Apify — whether locally with Node.js or inside a Docker container — you configure the runtime through environment variables. The app automatically loads a `.env` file from the current working directory on startup.

<Note>
  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`.
</Note>

## Core runtime

<ParamField body="ACTOR_WEB_SERVER_PORT" type="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`.
</ParamField>

<ParamField body="INPUT" type="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.

  ```bash theme={null}
  INPUT='{"urlCount":1,"retentionHours":24,"authKey":"local-dev-key"}'
  ```
</ParamField>

<ParamField body="APIFY_LOCAL_STORAGE_DIR" type="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.
</ParamField>

<ParamField body="LOG_LEVEL" type="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.
</ParamField>

<ParamField body="PRETTY_LOGS" type="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.
</ParamField>

<ParamField body="DISABLE_HOT_RELOAD" type="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.
</ParamField>

<ParamField body="NODE_ENV" type="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.
</ParamField>

## DuckDB storage

<ParamField body="DUCKDB_STORAGE_DIR" type="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.
</ParamField>

<ParamField body="DUCKDB_FILENAME" type="string" default="logs.duckdb">
  Override the DuckDB database filename. Useful when running multiple instances against the same storage directory.
</ParamField>

## Custom script worker heap

These variables control the memory ceiling for the sandboxed worker thread that runs `customScript` snippets. Raise them only when your scripts are legitimately memory-intensive.

<ParamField body="CUSTOM_SCRIPT_WORKER_MAX_OLD_GENERATION_MB" type="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.
</ParamField>

<ParamField body="CUSTOM_SCRIPT_WORKER_MAX_YOUNG_GENERATION_MB" type="number" default="16">
  Maximum young-generation (semi-space) heap size for the custom script worker, in MB. Clamped to `8`–`128`.
</ParamField>

## Local development example

A typical `.env` for local development:

```dotenv theme={null}
NODE_ENV=development
ACTOR_WEB_SERVER_PORT=8080
LOG_LEVEL=debug
PRETTY_LOGS=true
APIFY_LOCAL_STORAGE_DIR=./storage
INPUT={"urlCount":3,"retentionHours":24,"maskSensitiveData":true}
```

## Docker run example

Pass environment variables with `-e` flags when starting the container:

```bash theme={null}
docker build -t webhook-debugger-logger .

docker run --rm -p 8080:8080 \
  -e NODE_ENV=production \
  -e ACTOR_WEB_SERVER_PORT=8080 \
  -e APIFY_LOCAL_STORAGE_DIR=/app/storage \
  -e LOG_LEVEL=info \
  -e INPUT='{"urlCount":3,"retentionHours":24,"authKey":"my-secret-key"}' \
  -v "$(pwd)/storage:/app/storage" \
  webhook-debugger-logger
```

<Tip>
  Mount a local directory to `/app/storage` with `-v` so captured events and DuckDB data persist across container restarts.
</Tip>

<Warning>
  Do not commit a `.env` file that contains real values for `INPUT` with `authKey`, `signatureVerificationSecret`, or other secrets. Use your shell environment or a secrets manager instead.
</Warning>
