Configuration
Gotenberg needs no configuration to start. Flags and environment variables tune it: every flag has a variable, so --api-timeout is API_TIMEOUT.
Set a flag
Pass flags to the gotenberg command, which the image runs by default:
docker run --rm -p "3000:3000" gotenberg/gotenberg:9 \
gotenberg --api-timeout=60s
Or set the variable instead, which suits Compose and Kubernetes:
services:
gotenberg:
image: gotenberg/gotenberg:9
environment:
API_TIMEOUT: 60s
CHROMIUM_DENY_PRIVATE_IPS: "true"
- The variable wins when you set both.
- A list takes repeated flags, or comma-separated values:
WEBHOOK_ALLOW_LIST=^https://hooks\.example\.com/,^https://events\.example\.com/. A list you set replaces its default. - A duration takes a unit:
30s,5m. A size takes one too:5MB,1GB.
Flags
Gotenberg's own --help describes the flags below, with their defaults.
API
The HTTP server: port, limits, timeouts, authentication, and the files Gotenberg downloads for downloadFrom.
Set the maximum number of entries of a zip archive sent in the archives form field
Default: 10000
Set how many times its own size a zip archive sent in the archives form field may unpack to - guards against zip bombs
Default: 100
Set the IP address the API should bind to for incoming connections
Default: none
Set the body limit for multipart/form-data requests - it accepts values like 5MB, 1GB, etc
Default: none
Set the header name to use for identifying requests
Default: Gotenberg-Trace
Disable telemetry for the debug route
Default: true
Disable the download from feature
Default: false
Disable telemetry for health check route
Default: true
Disable telemetry for the root route
Default: true
Disable telemetry for the version route
Default: true
Set the allowed URLs for the download from feature using regular expressions - supports multiple values. A match bypasses --api-download-from-deny-private-ips (API_DOWNLOAD_FROM_DENY_PRIVATE_IPS) and --api-download-from-deny-public-ips (API_DOWNLOAD_FROM_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)
Default: none
Set the denied URLs for the download from feature using regular expressions - supports multiple values
Default: none
Reject downloadFrom URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted downloadFrom sources to mitigate SSRF against internal services
Default: false
Reject downloadFrom URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments to prevent downloads from reaching the public internet
Default: false
Route downloadFrom fetches through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials
Default: false
Set the maximum number of downloadFrom entries fetched concurrently per request - bounds the outbound fan-out. 0 means no limit; --api-disable-download-from (API_DISABLE_DOWNLOAD_FROM) turns downloadFrom off
Default: 10
Set the maximum number of downloadFrom entries allowed per request. 0 means no limit; --api-disable-download-from (API_DISABLE_DOWNLOAD_FROM) turns downloadFrom off
Default: 0
Set the maximum number of retries for the download from feature
Default: 4
Enable basic authentication - will look for the GOTENBERG_API_BASIC_AUTH_USERNAME and GOTENBERG_API_BASIC_AUTH_PASSWORD environment variables
Default: false
Enable OIDC bearer token authentication - mutually exclusive with basic authentication
Default: false
Set the expected OIDC audience - the token aud claim must contain it
Default: none
Set the OIDC issuer URL, e.g. https://tenant.example.com/ - the token iss claim must match
Default: none
Set the OIDC JWKS URL - discovered from the issuer's well-known configuration when empty
Default: none
Set the environment variable with the port on which the API should listen - override the default port
Default: none
Set the root path of the API - for service discovery via URL paths
Default: /
Path to the TLS/SSL certificate file - for HTTPS support
Default: none
Path to the TLS/SSL key file - for HTTPS support
Default: none
Chromium
Allow file:// URIs to read other file:// URIs
Default: false
Ignore TLS/SSL errors on localhost
Default: false
Set the allowed URLs for Chromium using regular expressions - supports multiple values. A match bypasses --chromium-deny-private-ips (CHROMIUM_DENY_PRIVATE_IPS) and --chromium-deny-public-ips (CHROMIUM_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)
Default: none
Automatically launch Chromium upon initialization if set to true; otherwise, Chromium will start at the time of the first conversion
Default: false
Clear Chromium cache between each conversion - only applies with --chromium-shared-browser-context
Default: false
Clear Chromium local storage between each conversion - only applies with --chromium-shared-browser-context
Default: false
Log every DevTools Protocol message between Gotenberg and Chromium at the debug level of --log-level (LOG_LEVEL). The messages carry URLs, cookies and header values whole, credentials included: enable it only to troubleshoot
Default: false
Set the denied URLs for Chromium using regular expressions - supports multiple values. A Web Worker's HTTPS request shows its host only: the list sees https://host/, so a rule that names a path cannot refuse it
Default: [^file:(?!//\/tmp/).*]
Reject URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted form input to mitigate SSRF against internal services
Default: false
Reject URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments to prevent outbound traffic from leaving a private network
Default: false
Don't enforce the same-origin policy
Default: false
Route Chromium's outbound requests through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials. Use this instead of --chromium-proxy-server for authenticated proxies, and leave --chromium-proxy-server and --chromium-host-resolver-rules unset
Default: false
Set custom mappings to the host resolver, such as MAP intranet.local 10.0.0.5. The internal DNS-rebinding pinning proxy applies them and checks the address a rule maps a host to, so --chromium-deny-private-ips (CHROMIUM_DENY_PRIVATE_IPS) and --chromium-deny-public-ips (CHROMIUM_DENY_PUBLIC_IPS) still hold
Default: none
Shutdown Chromium after being idle for the given duration. 0 keeps it running
Default: 0s
Ignore the certificate errors
Default: false
Maximum number of concurrent conversions. Chromium supports up to 6
Default: 6
Set the anonymous resident memory Chromium, all its processes together, may hold while it converts - it accepts values like 1500MB, 2GB, etc. Over it, Gotenberg kills Chromium, which fails every conversion in flight with a 503, and restarts it. Keep it under the container's memory limit, so that a runaway page does not get the container OOM-killed. Empty disables this feature
Default: none
Maximum request queue size for Chromium. 0 means no limit
Default: 0
Set the outbound proxy server; this switch only affects HTTP and HTTPS requests. Setting it turns off the internal DNS-rebinding pinning proxy: your proxy resolves each host after Gotenberg checks it, so a DNS rebinding can slip past --chromium-deny-private-ips (CHROMIUM_DENY_PRIVATE_IPS) and --chromium-deny-public-ips (CHROMIUM_DENY_PUBLIC_IPS)
Default: none
Number of conversions after which Chromium will automatically restart. 0 never restarts it
Default: 100
Maximum duration to wait for Chromium to start or restart
Default: 20s
LibreOffice
Set the allowed URLs for the requests LibreOffice sends, using regular expressions - supports multiple values. LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. A match bypasses --libreoffice-deny-private-ips (LIBREOFFICE_DENY_PRIVATE_IPS) and --libreoffice-deny-public-ips (LIBREOFFICE_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)
Default: none
Automatically launch LibreOffice upon initialization if set to true; otherwise, LibreOffice will start at the time of the first conversion
Default: false
Set the denied URLs for the requests LibreOffice sends, using regular expressions - supports multiple values. LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. An HTTPS request shows its host only: the list sees https://host/, so a rule that names a path cannot refuse it
Default: none
Reject the requests LibreOffice sends whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. Enable on deployments that accept untrusted documents to mitigate SSRF against internal services
Default: false
Reject the requests LibreOffice sends whose host resolves to a public IP address. LibreOffice requests only the style sheets an HTML document links, and the URLs a document's macros open once --libreoffice-enable-macros (LIBREOFFICE_ENABLE_MACROS) runs them; the images and other content an uploaded document links to never load. Enable on air-gapped or data-governed deployments to prevent outbound traffic from leaving a private network
Default: false
Route LibreOffice outbound fetches through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials
Default: false
Run the macros of the converted documents, including the ones bound to document events such as load. Macros run code inside the container: enable it only for trusted documents
Default: false
Shutdown LibreOffice after being idle for the given duration. 0 keeps it running
Default: 0s
Set the anonymous resident memory LibreOffice may hold during a conversion - it accepts values like 900MB, 1GB, etc. Over it, Gotenberg kills LibreOffice, answers 422 and restarts it. Keep it under the container's memory limit, so that a runaway conversion fails alone rather than getting the container OOM-killed. Empty disables this feature
Default: none
Maximum request queue size for LibreOffice. 0 means no limit
Default: 0
Number of conversions after which LibreOffice will automatically restart. 0 never restarts it
Default: 10
Maximum duration to wait for LibreOffice to start or restart
Default: 20s
PDF
How litho processes PDFs, and the timestamp authorities the sign and timestamp stages may call.
Set the allowed timestamp authority URLs for the sign and timestamp stages using regular expressions - supports multiple values. A match bypasses --pdf-deny-private-ips (PDF_DENY_PRIVATE_IPS) and --pdf-deny-public-ips (PDF_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://tsa\.example\.com(:|/|$)
Default: none
Set the denied timestamp authority URLs for the sign and timestamp stages using regular expressions - supports multiple values
Default: none
Reject timestamp authority URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted requests to mitigate SSRF against internal services
Default: false
Reject timestamp authority URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments
Default: false
Refuse the stages field of the Chromium and LibreOffice conversion routes, so that they only convert - with --pdf-disable-routes (PDF_DISABLE_ROUTES), no request runs PDF processing
Default: false
Route timestamp authority requests through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials
Default: false
Set the maximum number of PDF documents a request processes concurrently, across all requests - raising it trades memory and CPU for speed on multi-document requests
Default: 1
Set the maximum size of an embedded file read for validation - it accepts values like 50MB, 1GB, etc; empty keeps litho's default, 50 MiB
Default: none
Set the maximum number of pixels an image may hold - 0 keeps litho's default, 100000000 (100 million)
Default: 0
Set the maximum number of pixels a page drawn as an image may hold, at 16 bytes of memory each - 0 keeps litho's default, 50000000 (50 million), a Letter or A4 page at 600 dpi. The render stage refuses a larger page; flatten-transparency composites at a lower resolution to fit
Default: 0
Set the maximum size a PDF stream may decode to - it accepts values like 256MB, 1GB, etc; empty keeps litho's default, 256 MiB
Default: none
Webhook
Set the allowed URLs for the webhook feature using regular expressions - supports multiple values. A match bypasses --webhook-deny-private-ips (WEBHOOK_DENY_PRIVATE_IPS) and --webhook-deny-public-ips (WEBHOOK_DENY_PUBLIC_IPS), so terminate the host or the pattern also matches suffix hosts, for example ^https?://internal\.svc(:|/|$)
Default: none
Set the time limit for requests to the webhook
Default: 30s
Set the denied URLs for the webhook feature using regular expressions - supports multiple values
Default: none
Reject webhook URLs whose host resolves to a non-public IP address (loopback, RFC1918, link-local, unique-local). Enable on deployments that accept untrusted webhook destinations to mitigate SSRF against internal services
Default: false
Reject webhook URLs whose host resolves to a public IP address. Enable on air-gapped or data-governed deployments to prevent callbacks from leaving a private network
Default: false
Route webhook callbacks through the proxy defined by the standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables, including credentials
Default: false
Enable synchronous mode for the webhook feature
Default: false
Set the maximum number of retries for the webhook feature
Default: 4
Set the maximum duration to wait before trying to call the webhook again
Default: 30s
Set the minimum duration to wait before trying to call the webhook again
Default: 1s
Logging
Prepend a specified prefix to each log field key
Default: none
Use GCP-compatible field names in log output
Default: false
Set the format of the logs Gotenberg writes to standard error
Default: auto
Set the case of the level field in the logs Gotenberg writes to standard error, either lower or upper
Default: lower
Gotenberg
The process itself: startup banner, debug data, graceful shutdown.
Set if build data is needed
Default: true
Set the graceful shutdown duration
Default: 30s