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

# Configuration

FineParser is configured once, when the container starts, with environment variables and command-line flags. Every setting has both forms and the flag wins when both are given. The settings hold for the life of the process.

## Settings

| Setting                | Flag                      | Environment variable      | Default                                                                                                                                 |
| ---------------------- | ------------------------- | ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| License                | `-license-data`           | `FINEPARSER_LICENSE_DATA` | Required. The contents of your `.fineparserlicense` file. See [Licenses and plans](/fine-parser/basics/licenses-and-plans).             |
| Recognition mode       | `-mode`                   | `FRE_MODE`                | `accurate`. See [Recognition modes](/fine-parser/basics/recognition-modes).                                                             |
| Languages              | `-language`               | `FRE_LANGUAGE`            | `English`. See [Languages](/fine-parser/basics/languages).                                                                              |
| Listen address         | `-addr`                   | `LISTEN_ADDR`             | `:8080`                                                                                                                                 |
| Output directory       | `-output-dir`             | `OUTPUT_DIR`              | `/app/output`. Where results and the job database are written. Mount a volume here.                                                     |
| Scratch directory      | `-scratch-dir`            | `SCRATCH_DIR`             | `/app/scratch`. Where uploads wait for recognition. Does not need a volume.                                                             |
| Job database           | `-db`                     | `JOB_DB`                  | `<output-dir>/jobs.db`                                                                                                                  |
| Delete on download     | `-delete-on-download`     | `DELETE_ON_DOWNLOAD`      | `false`. When `true`, a result and its job record are removed once the result has been downloaded in full.                              |
| Upload limit           | `-max-upload-bytes`       | `MAX_UPLOAD_BYTES`        | `1Gi`. Largest accepted request body. Accepts `Ki`, `Mi`, `Gi`, `Ti` or `K`, `M`, `G`, `T` suffixes. `0` is unlimited.                  |
| Upload timeout         | `-upload-timeout`         | `UPLOAD_TIMEOUT`          | `5m`. How long a submission has to deliver its body. `0` is unlimited.                                                                  |
| Download stall timeout | `-download-stall-timeout` | `DOWNLOAD_STALL_TIMEOUT`  | `5m`. How long a download may make no progress before it is cut off. A slow but moving transfer is never interrupted. `0` is unlimited. |

The license is multi-line text. Pass it with `$(cat acme.fineparserlicense)` or from a Kubernetes Secret. Docker `.env` files cannot carry multi-line values, so they do not work for this variable.

Telemetry has its own environment variables for inspecting the stream or sending a copy to your own collector. See [Inspecting and copying the stream](/fine-parser/reference/data-privacy#inspecting-and-copying-the-stream).

## One configuration per container

Recognition settings cannot be changed per request. Every document a container receives is processed with the mode and languages it was started with.

If different document sets need different settings, run one container per configuration and route each request to the container that matches. A reverse proxy or your own application code can make that decision from whatever you already know about the document, such as its source or file type.

## Storage

Results are written to the output directory as `{jobId}/{name}`, next to a small job database that tracks every job. The image declares `/app/output` as a volume. Mount a named volume or a host directory there, because without one Docker creates an anonymous volume and results are lost when the container is removed.

```bash theme={null}
docker run -d --name fineparser -p 8080:8080 --stop-timeout 60 \
  -e FINEPARSER_LICENSE_DATA="$(cat acme.fineparserlicense)" \
  -v fineparser-output:/app/output \
  fineparser
```

The container runs as a non-root user, so a host directory mounted at `/app/output` must be writable by it.

One container per output directory. The job database is locked while open, so a second container pointed at the same volume refuses to start. If you run several containers, give each its own volume.

Uploads are kept in the scratch directory only while they wait for recognition and are deleted as soon as it finishes. Nothing in the scratch directory outlives a job, so it does not need a volume.

## Stopping the container

Give the container a stop timeout of 60 seconds. On a clean stop FineParser lets in-flight requests finish, flushes telemetry, and exits. Docker's default of 10 seconds cuts that short. Use `--stop-timeout 60` with `docker run`, or `terminationGracePeriodSeconds: 60` in Kubernetes. See [Restarts and shutdown](/fine-parser/concepts/rest-api#restarts-and-shutdown) for what happens to jobs that are queued or running at the time.

## Networking

FineParser listens on port 8080 inside the container. Publish that port to your host with `-p HOST:CONTAINER` so you can send requests to it. `-p 8080:8080` makes the API reachable on host port 8080 from any machine on the network, and `-p 127.0.0.1:9000:8080` limits it to localhost on port 9000. See [Published ports](https://docs.docker.com/engine/network/#published-ports) in the Docker documentation for the full syntax.

<Warning>
  The container must be able to reach ABBYY's license server. Without that outbound connection, FineParser does not parse documents. Allow the address ranges listed under [Network requirements](/fine-parser/reference/data-privacy#network-requirements) through your firewall or egress proxy. For environments with no outbound connectivity, see [FineParser Enterprise](/fine-parser/reference/enterprise).
</Warning>

## Confirming the license

In server mode, call `/healthz`. A licensed container reports `ready: true`:

```bash theme={null}
curl -s localhost:8080/healthz
# {"code":"ok","ready":true,"telemetry":true}
```

In CLI mode, look for the `metering ready for instance …` line in the container output before the page count.

Without a license, both modes refuse to work. The server reports unhealthy and processes nothing:

```json theme={null}
{"code":"no_instance","detail":"...no licence supplied; set FINEPARSER_LICENSE_DATA or pass -license-data","ready":false,"telemetry":true}
```
