Applications Azure

Stirling PDF 3 on Ubuntu 24.04 on Azure User Guide

| Product: Stirling PDF 3 on Ubuntu 24.04 LTS on Azure

Overview

This guide covers the deployment and configuration of Stirling PDF 3 on Ubuntu 24.04 on Azure using cloudimg Azure Marketplace images. Stirling PDF is the self hosted PDF toolkit: merge, split, compress, convert to and from Office formats and images, OCR scanned pages, redact, sign, add passwords and watermarks, edit text and much more, all in one web interface. Every document is processed on your own virtual machine, so nothing is sent to a third party service.

The cloudimg image runs the official Stirling PDF 3.5.0 container (stirlingtools/stirling-pdf:3.5.0, checked against its published digest when the image was built) under Docker, bound to the loopback address 127.0.0.1:8080. nginx is the only network facing service: it listens on port 80, protects the whole toolkit and its API with HTTP Basic Auth, and serves an unauthenticated /healthz endpoint for load balancer probes. A unique password is generated on the first boot of every VM. Stirling's settings, its database, logs, custom files and pipeline folders live on a dedicated Azure data disk.

What is included:

  • Stirling PDF 3.5.0, the vendor's official community container, run by Docker with a restart policy
  • Docker CE from the official Docker apt repository
  • nginx on port 80 with HTTP Basic Auth in front of the web interface and the REST API
  • A unique password generated on first boot and written to a root only file
  • Stirling's own built in administrator account seeded with that same per VM password, so the published default password never exists on your VM
  • A dedicated 20 GiB Azure data disk at /var/lib/stirling-pdf for settings, database, logs, custom files and pipeline folders
  • Upload limit of 512 MB per request for large PDFs
  • Usage analytics switched off
  • Support by email from cloudimg's team, on hand 24 hours a day with a guaranteed response within 24 hours

Prerequisites

  • An Azure subscription, an SSH key pair, and a resource group in the region you want
  • Standard_B2ms (2 vCPU, 8 GiB memory) is a sound starting size. Choose a larger size if you OCR long documents, convert many Office files at once, or expect many people at the same time
  • Network security group inbound rules for 22/tcp from your management network and 80/tcp from the people who will use the toolkit. Add 443/tcp later if you put TLS in front of it (see Step 11)

Step 1: Deploy from the Azure Portal

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Stirling PDF 3 on Ubuntu 24.04 by cloudimg, and select Create. On Basics choose your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22) and HTTP (80). The dedicated data disk is listed on the Disks tab. Select Review + create, then Create.

Step 2: Deploy from the Azure CLI

az vm create makes a rule named default-allow-ssh that lets every address reach port 22; the last command narrows it. Replace the placeholder values with your own:

# Accept the Marketplace terms once per subscription
az vm image terms accept --urn cloudimg1647283583153:stirling-pdf-3-ubuntu-24-04:default:latest

az vm create \
  --resource-group my-resource-group \
  --name stirling-pdf \
  --image cloudimg1647283583153:stirling-pdf-3-ubuntu-24-04:default:latest \
  --size Standard_B2ms \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_rsa.pub \
  --public-ip-sku Standard

# Open HTTP, then limit SSH to your management network
az vm open-port --resource-group my-resource-group --name stirling-pdf --port 80 --priority 1001
az network nsg rule update --resource-group my-resource-group --nsg-name stirling-pdfNSG \
  --name default-allow-ssh --source-address-prefixes <your-mgmt-cidr>

First boot takes a few minutes. On its first boot the VM generates its own password, seeds Stirling's administrator account with it and starts the toolkit (the Java application takes a minute or two to start). If you connect as soon as the VM shows as running, wait for that setup to finish:

text sudo cloud-init status --wait

It prints status: done when the VM is ready. The credentials file below only exists after that.

Step 3: Connect and check the services

ssh azureuser@<vm-public-ip>

Docker, nginx and the first boot service should all be active, the stirling-pdf container should report healthy, nginx should be the only service on a public port, and the data disk should be mounted:

systemctl is-active docker nginx stirling-pdf-firstboot
sudo docker ps --format '{{.Names}}  {{.Image}}  {{.Status}}'
sudo ss -tlnp | grep -E ':(80|8080) '
df -h /var/lib/stirling-pdf

docker, nginx and the first boot service active, the stirling-pdf 3.5.0 container healthy, nginx on port 80, Stirling on the loopback port 8080, and the 20 GiB data disk mounted at /var/lib/stirling-pdf

Step 4: Read your password

The password is generated on the first boot of your VM and written to a file only root can read:

sudo cat /root/stirling-pdf-credentials.txt

The file holds STIRLING_PDF_URL, STIRLING_PDF_USERNAME (always admin) and STIRLING_PDF_PASSWORD. With a Standard SKU public IP (the Azure default) the URL may show the VM's private address; from your own computer use the VM's public IP, as in Step 6. Store the password somewhere safe.

The per VM credentials file with the URL, the user admin and the generated password (masked here)

Step 5: Check that the password is enforced

nginx answers /healthz without a password, so it is safe for an Azure Load Balancer probe, and refuses everything else until the per VM password is given:

curl -s http://127.0.0.1/healthz
curl -s -o /dev/null -w 'no password    -> HTTP %{http_code}\n' http://127.0.0.1/
BADPW=not-the-password
curl -s -o /dev/null -w 'wrong password -> HTTP %{http_code}\n' -u "admin:$BADPW" http://127.0.0.1/
PW=$(sudo sed -n 's/^STIRLING_PDF_PASSWORD=//p' /root/stirling-pdf-credentials.txt)
curl -s -o /dev/null -w 'per-VM password -> HTTP %{http_code}\n' -u "admin:$PW" http://127.0.0.1/
curl -s -u "admin:$PW" http://127.0.0.1/api/v1/info/status; echo

The health check prints ok, the first two requests are refused with 401, the per VM password returns 200, and the status call reports {"version":"3.5.0","status":"UP"}.

HTTP 401 without a password and with a wrong one, HTTP 200 with the per VM password, and the status endpoint reporting version 3.5.0 and status UP

Step 6: Sign in to the web interface

Browse to http://<vm-public-ip>/. Your browser asks for a user name and password: enter admin and the password from Step 4. You land on the Stirling PDF workspace: your PDF library on the left, the work area in the middle, and every tool on the right, grouped as Recommended, Signing, Document Security, Verification, Document Review, Page Formatting and more. The search box at the top finds any tool by name.

The Stirling PDF 3 workspace with the PDF library, the Add Files button and the list of PDF tools

Step 7: Merge two PDFs

Select Merge in the tool list, then Add Files and choose two or more PDFs (or drag them into the window). Each file appears as a page preview; the panel on the right lets you sort them, remove digital signatures or add a table of contents to the merged file.

The Merge tool with two PDFs loaded, their page previews, sort options and the Merge (2 files) button

Select Merge (2 files). The merged document opens in the viewer, is added to your library, and can be downloaded or passed straight on to another tool such as Compress, Convert, Sanitize or Split. Every other tool, from OCR and Redact to Add Password and Sign with Certificate, follows the same pattern: choose the tool, add files, set the options, run it.

The merged two page PDF open in the viewer, with Download and follow on tools in the review panel

Step 8: Use the REST API

Every tool is also a REST endpoint behind the same password, so you can script document work from another machine or from the VM itself. To merge two PDFs of your own, with PW set to your password as in Step 5:

curl -u "admin:$PW" \
  -F fileInput=@first.pdf -F fileInput=@second.pdf \
  -o merged.pdf http://<vm-public-ip>/api/v1/general/merge-pdfs

The full list of endpoints and their options is in Stirling's own API documentation at http://<vm-public-ip>/swagger-ui/index.html (signed in with the same password).

A merge through the REST API on the VM: HTTP 200 and a two page merged.pdf

Step 9: Settings and version

The round button at the bottom left opens a menu; Settings shows your preferences (theme, language, default view, download behaviour) and, under Software Updates, the backend version, 3.5.0 on this image.

The Stirling PDF Settings page showing Current Backend Version 3.5.0

On this image nginx is the gate and Stirling's own sign in is switched off, so the server sections of Settings (sign in and security, database, audit log) are greyed out with the note "Enable login mode first". If you want Stirling's own user accounts and teams, see Step 10.

Step 10: Stirling's own user accounts (optional)

Stirling PDF has its own login with users and roles. On this image its built in administrator account (admin) was created on first boot with the same per VM password as the nginx gate, so turning the login on never exposes the upstream default password. To turn it on, re-create the container with SECURITY_ENABLELOGIN=true (see Upgrades in Maintenance for the full command), then sign in to Stirling as admin with the password from Step 4. Keep the nginx gate in place, or remove the auth_basic lines from /etc/nginx/sites-available/cloudimg-stirling-pdf and reload nginx if you want Stirling's login to be the only one.

Step 11: Put TLS in front of it for production

Stirling PDF is served over plain HTTP on port 80. Before you put real documents through it over the internet, point a DNS name at the VM, open 443/tcp, and add a certificate to nginx, for example with certbot:

sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d <your-domain>

Step 12: Where your data lives

Everything Stirling keeps lives under /var/lib/stirling-pdf on the dedicated data disk, mounted into the container as /configs (settings, the H2 database and the credential encryption key), /logs, /customFiles, /pipeline and /storage:

findmnt /var/lib/stirling-pdf
sudo ls /var/lib/stirling-pdf

Back up that disk (for example with an Azure disk snapshot) to protect your settings and files. It can be resized on its own, without touching the OS disk.

Maintenance

  • Password: to change the nginx password, run sudo sh -c 'printf "admin:%s\n" "$(openssl passwd -apr1 NEW_PASSWORD)" > /var/lib/stirling-pdf/.htpasswd' and then sudo systemctl reload nginx. If you turned on Stirling's own login, change that password in Stirling's account settings as well.
  • Upgrades: the toolkit runs as the stirling-pdf container from the pinned stirlingtools/stirling-pdf:3.5.0 image. To upgrade, pull the newer tag, remove the container and run it again with the same options and mounts, so your settings and database are kept:
sudo docker pull stirlingtools/stirling-pdf:<version>
sudo docker rm -f stirling-pdf
sudo docker run -d --name stirling-pdf --restart unless-stopped \
  -p 127.0.0.1:8080:8080 \
  -e SECURITY_ENABLELOGIN=false -e SYSTEM_ENABLEANALYTICS=false -e LANGS=en_GB \
  -v /var/lib/stirling-pdf/configs:/configs -v /var/lib/stirling-pdf/logs:/logs \
  -v /var/lib/stirling-pdf/customFiles:/customFiles -v /var/lib/stirling-pdf/pipeline:/pipeline \
  -v /var/lib/stirling-pdf/storage:/storage \
  stirlingtools/stirling-pdf:<version>
  • Keep the loopback port: nginx reaches Stirling on 127.0.0.1:8080; keep that port mapping so Stirling is never reachable without the password.
  • OS security updates: unattended-upgrades is enabled, so Ubuntu security updates install automatically.
  • Licence: Stirling PDF's core is MIT licensed. This image ships the vendor's free community container with no Pro or Enterprise licence key. Stirling PDF 3 measures automated processing (the Processor, the API and AI features) against a free allowance of 1,000 PDFs a month, while editing PDFs in the browser stays free and unlimited; see the Stirling PDF documentation for the current terms if you plan heavy automated use.

Support

cloudimg's support team is on hand 24 hours a day by email at support@cloudimg.co.uk, with a guaranteed response within 24 hours.