Deploying PdfDing
Introduction
PdfDing is a self-hosted PDF document management platform that allows you to upload, organize, view, and annotate PDF documents. Designed for individuals and teams who work with many PDF files, PdfDing provides a centralized location for managing your document library.
Built with modern web technologies, PdfDing offers a clean interface for browsing your documents, a full-featured PDF viewer with annotation capabilities, and organizational tools to keep your files structured.
Key highlights of PdfDing:
- PDF Viewing: Full-featured PDF viewer in the browser
- Annotations: Highlight, underline, and add notes to documents
- Organization: Folders and tags for document management
- Search: Full-text search across your document library
- Upload: Drag-and-drop file upload
- Responsive: Works on desktop and mobile devices
- Multi-User: Support for multiple users with separate libraries
- Self-Hosted: Keep your documents on your own infrastructure
- Open Source: Community-driven development
This guide walks through deploying PdfDing on Klutch.sh using Docker, configuring persistent storage, and setting up the application for production use.
Why Deploy PdfDing on Klutch.sh
Deploying PdfDing on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds PdfDing without complex orchestration. Push to GitHub, and your document manager deploys automatically.
Persistent Storage: Attach persistent volumes for your PDF files. Your documents survive container restarts and redeployments.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure document access.
Always Available: Access your documents from anywhere, on any device.
Custom Domains: Use a memorable domain for your PdfDing instance.
Prerequisites
Before deploying PdfDing on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your PdfDing configuration
- Basic familiarity with Docker and containerization concepts
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for PdfDing deployment.
Repository Structure
pdfding-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM mhellmeier/pdfding:latest
# Set environment variablesENV SECRET_KEY=${SECRET_KEY}ENV ALLOWED_HOSTS=${ALLOWED_HOSTS:-*}ENV DEBUG=False
# Database configurationENV DATABASE_URL=${DATABASE_URL:-sqlite:///data/db.sqlite3}
# Create data directoriesRUN mkdir -p /data/pdfs /data/db
# Expose the web interface portEXPOSE 8000
# Use the default entrypointCreating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Store.env.env.localEnvironment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
SECRET_KEY | Yes | - | Django secret key for security |
ALLOWED_HOSTS | No | * | Comma-separated list of allowed hosts |
DEBUG | No | False | Enable debug mode (never in production) |
DATABASE_URL | No | sqlite:///data/db.sqlite3 | Database connection string |
Deploying PdfDing on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8000
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the PdfDing container
- Provision an HTTPS certificate
Generate a Secret Key
Generate a secure secret key for Django:
python -c "import secrets; print(secrets.token_urlsafe(50))"Or using OpenSSL:
openssl rand -base64 50Push Your Repository to GitHub
Initialize your repository and push to GitHub with your Dockerfile.
Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “pdfding” or “pdf-manager”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your PdfDing Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
SECRET_KEY | Your generated secret key |
ALLOWED_HOSTS | your-app-name.klutch.sh |
DEBUG | False |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data/pdfs | 50+ GB | PDF document storage |
/data/db | 1 GB | SQLite database |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access PdfDing
Once deployment completes, access your PdfDing instance at https://your-app-name.klutch.sh.
Using PdfDing
Uploading Documents
- Navigate to your PdfDing instance
- Click the upload button or drag and drop files
- Wait for processing to complete
- Your document appears in the library
Viewing Documents
- Click on a document in your library
- Use the built-in PDF viewer
- Navigate pages, zoom, and search within the document
- Full-screen mode for focused reading
Annotating Documents
The PDF viewer supports various annotation types:
- Highlighting: Select text to highlight
- Underline: Emphasize important text
- Notes: Add sticky notes to specific locations
- Freehand: Draw directly on the document
Annotations are saved automatically and persist with the document.
Organizing Documents
Keep your library organized:
- Create folders for different projects or categories
- Add tags for cross-cutting organization
- Use search to find documents quickly
- Sort by name, date, or size
Searching
PdfDing offers search capabilities:
- Search document titles and metadata
- Full-text search within PDFs (if enabled)
- Filter by tags or folders
Additional Resources
Conclusion
Deploying PdfDing on Klutch.sh gives you a self-hosted PDF management platform accessible from anywhere. The combination of document viewing, annotation capabilities, and organizational tools makes it ideal for managing your PDF library.
With persistent storage for your documents and automatic HTTPS, PdfDing provides a secure and reliable way to work with your PDFs without relying on third-party cloud services.