API Configuration for PDF Processor


PSPDFKit Processor has been deprecated and replaced by PSPDFKit Document Engine. All PSPDFKit Processor licenses will work as before and be supported until 15 May 2024 (we will contact you about license migration). To start using Document Engine, refer to the migration guide. With Document Engine, you’ll have access to robust new capabilities (read the blog for more information).

While PSPDFKit Processor works out of the box, some parts need to be configured to work. Configuration options for the server are exposed via environment variables in your docker-compose.yml file.

  • LICENSE_KEY — This is the license key used to activate PSPDFKit Processor. If this isn’t specified or if it’s incorrect, PSPDFKit Processor won’t start up.

The following options concern authentication:

  • JWT_PUBLIC_KEY — This is the public key used to verify the JSON Web Token (JWT) payload signature. Ensure that this public key corresponds to the private key used to generate JWTs in your app. For more information, see the authentication guide.

  • JWT_ALGORITHM — This is the algorithm used for JWT verification. This should be the same as the one you’ll use for signing JWTs in your app. Supported algorithms: RS256, RS512, ES256, ES512. See RFC 7518 for details about specific algorithms.

  • API_AUTH_TOKEN — This can be set instead of JWT_PUBLIC_KEY to enable API token-based authentication. See the authentication guide for details.


JWT_PUBLIC_KEY and API_AUTH_TOKEN are mutually exclusive. If both are set, Processor will immediately shut down after being started.

There are also some optional configuration options:

  • PORT — The port PSPDFKit Processor is listening on. Defaults to 5000.

  • HTTP_PROXY or HTTPS_PROXY — A proxy server used for fetching remote documents.

  • STATSD_HOST and STATSD_PORT — Host and port of a running StatsD daemon that PSPDFKit Processor can report telemetry data to.

  • REMOTE_URL_FETCH_TIMEOUT — The timeout in milliseconds applied when fetching documents from a remote URL. Defaults to 5000 (5 seconds).

  • MAX_UPLOAD_SIZE_BYTES — The maximum size in bytes uploaded documents can be. This applies to all upload types, including remote documents. Defaults to 1000000000 (one billion) bytes, or about 950 MB.

  • LIBREOFFICE_CONVERSION_TIMEOUT — The timeout in milliseconds applied when converting an Office document using LibreOffice. Any conversion taking longer than the configured timeout will fail. Defaults to 60000 (1 minute).

  • PSPDFKIT_WORKER_POOL_SIZE — This option controls how many pspdfkitd processes are started for handling PDF-related work. In general, setting this to two-to-three times the number of cores available will give you the best performance. Keep in mind that if you set this too high, the processes will starve each other for CPU time, leading to unnecessarily long processing times. And if you set this too low, available CPU time won’t be used efficiently, as tasks will have to wait for a long time for a worker to be available. This defaults to 16.

  • ALLOW_REMOTE_ASSETS_IN_GENERATION — This option controls whether PDF Generation will be able to access and fetch external resources, such as images or styles. This defaults to true.

  • PDF_GENERATION_TIMEOUT — This option sets the timeout in milliseconds for generating a PDF. Defaults to 20000 (20 seconds).

  • PSPDFKIT_WORKER_TIMEOUT — This option sets the timeout in milliseconds for some core PDF operations. The default is 60000 (1 minute).

  • PROCESSOR_REQUEST_TIMEOUT — This option sets the timeout in milliseconds for all requests to Processor’s /process endpoint. The default is 60000 (1 minute). Note that this timeout overrides all other timeout settings for any request to Processor.

Mounting Ephemeral Storage for Temporary Files

PSPDFKit Processor uses the /srv/pspdfkit/assets/tmp directory to store temporary files instead of the default /tmp directory.

To store temporary files separately, mount the storage to the /srv/pspdfkit/assets/tmp directory.