Install Stirling PDF Inside Docker Container on Linux

Install Stirling PDF Inside Docker Container on Linux

Stirling PDF is an open-source, web-based application that provides a suite of tools for working with PDF files. It allows users to perform various PDF-related tasks directly from their browser.

This tutorial explains how to install Stirling PDF inside a Docker container on Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install Stirling PDF

  • Host network

Run the following command to create a container for Stirling PDF that uses host network:

docker run -d --name=stirling-pdf --restart=always --network=host \
    -v /opt/stirling-pdf/tessdata:/usr/share/tessdata \
    -v /opt/stirling-pdf/configs:/configs \
    -v /opt/stirling-pdf/customFiles:/customFiles \
    -v /opt/stirling-pdf/logs:/logs \
    -v /opt/stirling-pdf/pipeline:/pipeline \
    -e LANGS=en_US \
    stirlingtools/stirling-pdf
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, Stirling PDF service is listening on port 8080. It can be changed with -p option.

docker network create app-net
docker run -d --name=stirling-pdf --restart=always --network=app-net \
    -p 8081:8080 \
    -v /opt/stirling-pdf/tessdata:/usr/share/tessdata \
    -v /opt/stirling-pdf/configs:/configs \
    -v /opt/stirling-pdf/customFiles:/customFiles \
    -v /opt/stirling-pdf/logs:/logs \
    -v /opt/stirling-pdf/pipeline:/pipeline \
    -e LANGS=en_US \
    stirlingtools/stirling-pdf

Testing Stirling PDF

To access the application, launch a web browser and go to http://<IP_ADDRESS>:8080, replacing <IP_ADDRESS> with the actual IP address of the system.

Stirling PDF Inside Docker Container on Linux

Uninstall Stirling PDF

To completely remove Stirling PDF, remove its container:

docker rm --force stirling-pdf

Remove Stirling PDF image:

docker rmi stirlingtools/stirling-pdf

You can also remove Stirling PDF data:

sudo rm -rf /opt/stirling-pdf

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.