Skip to content
ComPDF
DemoAPI ReferenceFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

Getting Started Guide

ComPDF Self-hosted is a Docker Compose based private PDF processing platform. It serves ComPDF Web, Dashboard, and /api/v1 APIs from the unified application entry on port 8080.

Requirements

  • A 64-bit Linux server or Docker Desktop environment.
  • At least 4 GB RAM.
  • Docker Engine and Docker Compose v2.
  • A valid ComPDF License Key for production use.

Quick Start

bash
git clone https://github.com/ComPDFKit/compdf-self-hosted.git
cd compdf-self-hosted
cp .env.example .env
docker compose up -d

After startup, open:

EntryURL
ComPDF Webhttp://localhost:8080/
Dashboardhttp://localhost:8080/admin
Health checkhttp://localhost:8080/api/v1/status

To use an Enterprise license, replace COMPDF_LICENSE_KEY in .env and restart the services.

Dashboard Console

ComPDF Self-hosted provides a unified management console for viewing API Key details, API usage, and License status, as well as supporting operation log auditing, account management, and core system configuration. It is available at /admin.

  • Overview Panel: Displays API Key details, API usage statistics, License scope, and usage status.
  • Operation Logs: Track, search, and export all the operation logs.
  • Account Management: Set the user name and password.
  • System Settings: Set the name, logo, theme color of the system.

On the first visit, the Dashboard guides you through creating the initial admin account. After setup, sign in with that account to manage the deployment.

API Key

Conversion, PDF tool, and async task APIs require x-api-key. Set API_KEY in .env for a fixed key. If it is empty, the application generates one on first boot and saves it to STORAGE_DIR/.api-key-plaintext; ComPDF Web and Dashboard use this key automatically.

bash
curl -X POST "http://localhost:8080/api/v1/process/pdf/docx" \
  -H "x-api-key: your_api_key_here" \
  -F "[email protected]"

Configuration

VariableDefaultDescription
PORT8080Application listening port.
JWT_SECRETchange-me-in-prodDashboard admin-session JWT secret. Change it in production.
API_KEYemptyPlaintext key for protected APIs. If empty, first startup generates one automatically.
CORS_ORIGINS*Allowed CORS origins. Use commas for multiple origins.
COMPDF_TOOLS_ENABLEDfalseComPDF Web configuration flag. Only literal true enables it.
DATABASE_HOST / DATABASE_PORTcompdf-infra / 3306MySQL host and port used by the application.
DATABASE_USER / DATABASE_PASSWORD / DATABASE_NAMEcompdfkit / compdfkit-pass-2026 / compdfkitMySQL credentials and database name.
REDIS_HOST / REDIS_PORTcompdf-infra / 6379Redis host and port used by the application.
LICENSE_TOKEN_PATH/app/configs/license.jwtLicense token file path.
COMPDF_LICENSE_KEYemptyComPDF License Key.
COMPDF_LICENSE_SECRETemptyOptional License Secret.
COMPDF_AI_MODEL/opt/compdf_sdk/models/documentai.modelDocument AI model path.
PUBLIC_DIR/app/publicFrontend static asset directory in the production image.
SETTINGS_PATH/app/configs/settings.ymlDashboard system settings file path.
STORAGE_DIR/app/storageStorage directory for task results and generated API key file.

Operations

bash
docker compose ps
docker compose logs -f compdf-server
docker compose restart compdf-server

Development Mode

For development, follow the README in the project repository. The common flow is to start Docker Compose services, run the server locally, and run the Web UI with hot reload.