Skip to content

ComPDFKit/compdf-self-hosted

Repository files navigation

English | 繁體中文 | 简体中文

ComPDF Self-Hosted — Open Source PDF Editor & PDF Converter

Leverage ComPDF Self-hosted (Part of the KDAN ecosystem), an open-source PDF platform in Docker containers for private deployment—use it to edit, convert, and transform documents across PDFs, Office formats, HTML, TXT, CSV, RTF, JSON, and images.

  • If you find ComPDF Self-hosted useful, please consider giving us a ⭐ Star on GitHub. It helps us grow and improve.
  • Got questions or ideas? Join the conversation in our Discussions.

License Docker GitHub Stars PRs Welcome

FeaturesQuick StartArchitectureUpgrade to EnterprisesupportLicenseEnterprise →

Why ComPDF Self-Hosted?

Unlike traditional SDKs that require deep integration, ComPDF Self-Hosted is a ready-to-deploy open-source PDF processing platform. It combines PDF editing and conversion capabilities, while also supporting image format conversion—covering the full spectrum from documents to images. This enables enterprises to quickly establish a fully controllable, self-owned document center.

Key Advantages

  • Docker Compose deployment
  • Complete PDF tool center — edit, convert, merge, split
  • API key management and license management
  • Private deployment with enterprise-ready architecture
  • Commercial support and dedicated assistance available

Whether you're building an internal document platform, document automation workflow, or enterprise PDF service, ComPDF Self-Hosted helps you get started in minutes.

Features

Tools

ComPDF Self-Hosted provides a ready-to-use open source PDF editor, open source PDF converter, and open source image converter center directly accessible through a browser.

PDF Editing

  • Merge PDF
  • Split PDF
  • Rotate PDF
  • Insert Pages
  • Delete Pages
  • Extract Pages
  • Add Watermark
  • Remove Watermark
  • Encrypt PDF
  • Decrypt PDF

PDF Conversion

PDF to Others

  • PDF to Word
  • PDF to Excel
  • PDF to Slide
  • PDF to Image
  • PDF to HTML
  • PDF to TXT
  • PDF to CSV
  • PDF to RTF
  • PDF to JSON
  • PDF to SearchablePDF
  • PDF to OFD

Others to PDF

  • Word to PDF
  • Excel to PDF
  • Slide to PDF
  • HTML to PDF
  • TXT to PDF
  • CSV to PDF
  • RTF to PDF
  • TIFF to PDF

Image Conversion (photo converter open source)

  • Image to Word
  • Image to Excel
  • Image to Slide
  • Image to HTML
  • Image to CSV
  • Image to TXT
  • Image to RTF

Quick Start

1. Start with Docker Compose

Clone the repository and enter the project directory:

git clone https://github.com/ComPDFKit/compdf-self-hosted.git
cd compdf-self-hosted

Prepare the environment file before starting services:

cp .env.example .env

Update .env if you need to override the built-in defaults. Docker Compose automatically loads .env from the project directory. The repository already contains docker-compose.yml, and the compdf-web image includes default files under /app/configs; the local ./configs:/app/configs mount can override the image defaults.

Start the full stack:

docker compose up -d

Open ComPDF Web:

http://localhost:8080/

There's a free license in the env files. Apply for the Enterprise version to obtain the following benefits:

  • Watermark-free document processing
  • No limit on the number of document pages processed
  • Batch document processing

2. Start the development environment

Development uses Docker for the infra and SDK services, while the middleware and Web UI can run locally for hot reload.

Terminal 1: start MySQL, Redis, RustFS, and the SDK services:

docker compose -f docker-compose.dev.yml up -d compdf-infra compdf-app
docker compose -f docker-compose.dev.yml ps

Terminal 2: start the NestJS middleware locally. It connects to the dev Compose services through their host-mapped ports:

cd server
npm install
DATABASE_HOST=127.0.0.1 \
DATABASE_PORT=13306 \
DATABASE_USER=compdfkit \
DATABASE_PASSWORD=compdfkit-pass-2026 \
DATABASE_NAME=compdfkit \
REDIS_HOST=127.0.0.1 \
REDIS_PORT=16379 \
COMPDF_SDK_BASE_URL=http://127.0.0.1:7000 \
PDF_SDK_BASE_URL=http://127.0.0.1:7001 \
CONVERSION_BASE_URL=http://127.0.0.1:7000 \
LICENSE_TOKEN_PATH=../configs/license.jwt \
SETTINGS_PATH=../configs/settings.yml \
STORAGE_DIR=./storage \
npm run start:dev

The middleware exposes the API at:

http://localhost:8080/api/v1/*

Terminal 3: start the Vue Web UI. Vite proxies /api to the middleware on port 8080:

cd frontend/compdf-web
npm install
npm run dev

Open the URL printed by Vite, for example:

http://localhost:5173/

For LAN access, use the machine IP printed by Vite's Network URL and make sure the middleware is also reachable from that machine.

If you prefer running the middleware in Docker during development:

docker compose -f docker-compose.dev.yml up -d --build compdf-infra compdf-app web

3. Check status and logs

docker compose ps
docker compose logs -f compdf-web

The production deployment stores persistent data in Docker volumes and mounts ./configs into the middleware container.

4. Build the production image from source

Keep this path when you changed local source code and need to package a new production compdf-web image from the root Dockerfile. The Dockerfile compiles frontend/compdf-web, builds the NestJS server, copies the Web UI into /app/public/compdf-web, and starts the middleware on port 8080.

docker compose -f docker-compose.yml up -d --build compdf-infra compdf-app compdf-web

All features above come with ComPDF — check them out here.

Architecture

┌────────────────────────────────────────────────────────────────────┐
│                              Browser                               │
│                   http://localhost:8080/ in production             │
└───────────────────────────────┬────────────────────────────────────┘
                                │
                                │ HTML/CSS/JS + HTTP /api/v1/*
                                ▼
┌────────────────────────────────────────────────────────────────────┐
│                         compdf-web container                       │
│                 frontend/compdf-web + server                       │
│ NestJS middleware, port 8080                                       │
├────────────────────────────────────────────────────────────────────┤
│ - Serves the Vue 3 Web UI from /app/public/compdf-web              │
│ - Proxies PDF edit APIs: /api/v1/pdf/*                             │
│ - Proxies conversion APIs: /api/v1/* conversion routes             │
│ - Orchestrates async task status and downloads                     │
│ - Injects display-only license metadata into the Web UI            │
│ - Normalizes upstream errors and writes operation logs             │
└───────────────┬───────────────────────────────┬────────────────────┘
                │                               │
                │ HTTP                          │ MySQL / Redis
                ▼                               ▼
┌────────────────────────────────┐   ┌────────────────────────────────┐
│ compdf-app container           │   │ compdf-infra container         │
│ Third-party SDK services       │   │ MySQL 8 + Redis 7 + RustFS     │
│ :7000 conversion APIs          │   │ persistent Docker volumes      │
│ :7001 PDF SDK /v1/sync/* APIs  │   │                                │
│ :9903 service health           │   │                                │
└────────────────────────────────┘   └────────────────────────────────┘
                │
                ▼
┌────────────────────────────────────────────────────────────────────┐
│                         Project-mounted data                       │
├────────────────────────────────────────────────────────────────────┤
│ configs/: license.jwt, settings.yml, init.sql                      │
│ storage/: async task result files                                  │
│ fonts/: optional fonts mounted into the SDK container              │
└────────────────────────────────────────────────────────────────────┘

In local development, compdf-infra and compdf-app still run in Docker. The NestJS middleware can run from server/, and the Web UI can run from frontend/compdf-web with Vite hot reload.

Upgrade to Enterprise

Contact sales to update to the Enterprise Edition.

Compare Card

Support

Have suggestions? Start a discussion. If you find ComPDF Self-Hosted useful, please consider giving us a ⭐ Star on GitHub. It helps us grow and improve.

License

  • This project is licensed under the MIT License. See the LICENSE file for details.

  • Contact Sales for the Commercial / Enterprise licenses for ComPDF Self-Hosted.


Built by the ComPDF team.
Website · Docs · Enterprise Inquiries

About

Leverage ComPDF Self-hosted (Part of the KDAN ecosystem), an open-source PDF platform in a single Docker container for private deployment—use it to edit, convert, and transform documents across PDFs, Office formats, HTML, TXT, CSV, RTF, JSON, and images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors