How it works
BentoPDF’s WASM module URLs are baked into the compiled JavaScript at build time. When a user opens the app, their browser fetches those WASM files at runtime from whatever URL was configured during the build. Docker does not download WASM files during the image build. For an air-gapped deployment you need to:- On a machine with internet: download the WASM packages, build a Docker image configured to point at your internal server, and bundle everything together.
- Transfer the bundle into the isolated network via USB drive, internal artifact repo, or other approved method.
- On the air-gapped side: extract the WASM files to your internal web server, load the Docker image, and run the container.
Automated script (recommended)
The includedprepare-airgap.sh script automates the entire preparation process: it downloads all WASM packages, builds the Docker image with your internal URLs, exports everything, and produces a self-contained bundle with a setup script.
Script options
| Flag | Description | Default |
|---|---|---|
--wasm-base-url <url> | Where WASM files will be hosted internally. This sets the base for all WASM and OCR URLs. | (required; prompted if missing) |
--image-name <name> | Docker image tag | bentopdf |
--output-dir <path> | Output bundle directory | ./bentopdf-airgap-bundle |
--simple-mode | Enable Simple Mode | off |
--base-url <path> | Subdirectory base URL (e.g. /pdf/) | / |
--language <code> | Default UI language (e.g. fr, de) | (none) |
--brand-name <name> | Custom brand name | (none) |
--brand-logo <path> | Logo path relative to public/ | (none) |
--footer-text <text> | Custom footer text | (none) |
--ocr-languages <list> | Comma-separated OCR language codes to bundle (e.g. eng,deu,fra) | eng |
--list-ocr-languages | Print all supported OCR codes and names, then exit | off |
--search-ocr-language <term> | Search OCR codes by name or abbreviation (e.g. search german) | off |
--dockerfile <path> | Dockerfile to use | Dockerfile |
--skip-docker | Skip the Docker build and export step | off |
--skip-wasm | Skip WASM download (reuse existing .tgz files) | off |
Output bundle structure
Transfer and set up
Transfer the bundle
Copy the entire
bentopdf-airgap-bundle/ directory into the air-gapped network via USB drive, internal artifact repository, or another approved transfer method.Run the setup script
On the air-gapped machine:The setup script:
- Loads the Docker image from
bentopdf.tar - Extracts all WASM packages to the directory your web server will serve
- Optionally starts the container
Manual steps
Step 1: Download WASM packages (on a machine with internet)
Step 1: Download WASM packages (on a machine with internet)
Step 2: Build the Docker image with internal URLs
Step 2: Build the Docker image with internal URLs
Step 3: Export the Docker image
Step 3: Export the Docker image
Step 4: Transfer into the air-gapped network
Step 4: Transfer into the air-gapped network
Transfer these files via USB, internal artifact repo, or approved method:
bentopdf.tar— Docker imagebentopdf-pymupdf-wasm-*.tgz— PyMuPDF WASM packagebentopdf-gs-wasm-*.tgz— Ghostscript WASM packagecoherentpdf-*.tgz— CoherentPDF WASM packagetesseract.js-7.0.0.tgz— Tesseract worker packagetesseract.js-core-7.0.0.tgz— Tesseract core runtime packagetesseract-langdata/— OCR traineddata filesocr-fonts/— OCR text-layer font files
Step 5: Set up inside the air-gapped network
Step 5: Set up inside the air-gapped network
Building from source instead of Docker
If you prefer to build a staticdist/ folder and serve it without Docker, set the WASM variables in .env.production before building:
OCR fonts note
For fully offline searchable PDF output (OCR with a text layer), BentoPDF needs to load NotoSans font files to embed into the PDF. WithoutVITE_OCR_FONT_BASE_URL, the app will try to fetch them from public Google Fonts CDN URLs.
Set VITE_OCR_FONT_BASE_URL to the internal directory serving the bundled ocr-fonts/ contents:
ocr-fonts/ directory is included in the automated script output bundle and contains the required NotoSans-Regular.ttf file.