Skip to main content

Containerized mode

Use a Docker image to run the Licensing Gateway Service (LGS) in a containerized environment. This setup allows you to run the LGS in a Docker container with internet access.

Run the LGS in Docker

Learn how to run the LGS in a Docker container with internet access in the following sections.

Prerequisites

  • Install Docker or Docker Compose on the machine intended for the LGS. For more details, review Docker documentation.

Run LGS in Docker

To run the LGS in a Docker container:

  1. Find the official Pdftools LGS Docker image in the Docker Hub: pdftoolsag/license-gateway

  2. To start the LGS container with the necessary configurations, use the following Docker command:

    docker run -p 9999:9999 \
    -e LICENSE_KEYS="YOUR_LICENSE_KEY" \
    pdftoolsag/license-gateway:latest

    Replace YOUR_LICENSE_KEY with your actual license key. You can also add multiple license keys. Multiple keys can be separated by a semicolon (;), for example:

    -e LICENSE_KEYS="LICENSE_KEY_1;LICENSE_KEY_2"
note

This container requires an active internet connection to operate correctly, ensuring that license data is continuously synchronized. During graceful shutdown, an internet connection is also essential to avoid data inconsistencies and prevent the licenses from becoming blocked.

Port mapping

The LGS is, by default, running and accessible on port 9999.

  • Port mapping, default set to: -p 9999:9999
    • This configuration maps the LGS internal API port to port 9999 on the host machine.
    • If you wish to change the host port, update the configuration in the product or CLI accordingly.

Docker Compose

If you prefer to use Docker Compose, create a docker-compose.yml file with the following content:

services:
license-gateway:
image: pdftoolsag/license-gateway:latest
ports:
- "9999:9999"
environment:
- LICENSE_KEYS=YOUR_LICENSE_KEY

You can also use multiple license keys separated by a semicolon (;):

services:
license-gateway:
image: pdftoolsag/license-gateway:latest
ports:
- "9999:9999"
environment:
- LICENSE_KEYS=LICENSE_KEY_1;LICENSE_KEY_2

Automatic LGS deactivation

Each license can have a maximum number of LGS instances connected to it, and certain licenses allow unlimited numbers of LGS instances.

When the maximum number of instances is exceeded, the license becomes blocked. To prevent this, the LGS automatically unregisters or deactivates the LGS from the pool of LGSs associated with the license key when the Docker container shuts down.

Deactivation of the LGS for a given license key occurs automatically when the Docker container shuts down. To ensure this process functions correctly, always gracefully shut down the container:

docker stop <container-id>

If the container cannot connect to the internet during shutdown, it may fail to transfer data properly, potentially blocking the licenses. In such cases, please contact Pdftools support to resolve the issue.