Skip to content

Stirling-PDF

Stirling PDF is a powerful, open-source PDF editing platform. Deploy it on your own servers with a private API. Edit, sign, redact, convert, and automate PDFs without sending documents to external services.

Install Stirling PDF

  1. Follow the Stirling PDF installation guide to set up the self-hosted Stirling PDF requirements.
  2. Add the following ls-net external network to the Stirling PDF project's docker-compose.yml file:

    services:
      stirling-pdf:
        image: docker.stirlingpdf.com/stirlingtools/stirling-pdf:latest
        container_name: stirling-pdf
        ports:
          - '8080:8080'
        volumes:
          - ./stirling-data/tessdata:/usr/share/tessdata
          - ./stirling-data/configs:/configs
          - ./stirling-data/logs:/logs
          - ./stirling-data/pipeline:/pipeline
        environment:
          - SECURITY_ENABLELOGIN=true ### default value is false
          - SYSTEM_DEFAULTLOCALE=en-GB
        restart: unless-stopped
    
    networks:
      ls-net:
        external: true
    

Set up OpenLiteSpeed proxy with AutoSSL

The easiest way to install OpenLiteSpeed, configure it as a reverse proxy, and enable AutoSSL is to use the ols1clk script.

Before continuing, ensure that your domain points to the server.

Replace www.example.com with your domain name, and run the following command:

bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh) --proxy-c --proxy-port 8080  --autocert --sitedomain www.example.com

This command automatically:

  1. Download the ols-proxy-docker-env repository:

    git clone https://github.com/litespeedtech/ols-proxy-docker-env
    cd ols-proxy-docker-env
    
  2. Copy the example environment file:

    cp .env.example .env
    
  3. Edit .env with your configuration values:

    OLS_IMAGE=litespeedtech/openlitespeed:latest
    BACKEND_IP=stirling-pdf
    BACKEND_PORT=8080
    DOMAIN=www.example.com
    PROXY_METHOD=context
    PROXY_SOCKET=false
    ACME_EMAIL=admin@example.com
    
  4. Start the proxy:

    docker compose up -d
    

Verify the proxy configuration

Open https://www.example.com in a browser. The application interface should load through OpenLiteSpeed over HTTPS.

Warning

After verifying the configuration, restrict public access to port 8080 using your firewall. Alternatively, you can configure the service to listen on 127.0.0.1 only, so port 8080 is not publicly accessible.

Optional settings

You can further enhance your site's security by enabling features such as:

  • OWASP protection
  • reCAPTCHA
  • Per-client throttling
  • Realm protection
  • IP Allow/Deny

See the OpenLiteSpeed Security Guide for more information.