Skip to content

Deploying Papra

Introduction

Papra is a self-hosted document management system designed to help you organize, search, and manage your digital documents efficiently. Built with modern web technologies, Papra provides an intuitive interface for storing and retrieving documents while keeping your data under your control.

Whether you’re managing personal files, business documents, or archiving important records, Papra offers the tools you need to maintain an organized digital filing system.

Key highlights of Papra:

  • Document Organization: Categorize documents with folders, tags, and custom metadata
  • Full-Text Search: Find documents quickly with powerful search capabilities
  • OCR Processing: Extract text from scanned documents and images for searchability
  • File Preview: View documents directly in the browser without downloading
  • Version Control: Track document changes and maintain revision history
  • Secure Storage: Keep your documents encrypted and access-controlled
  • REST API: Integrate with other applications and automate workflows
  • Multi-User Support: Collaborate with team members with role-based permissions
  • Mobile Friendly: Responsive design works on all devices
  • Open Source: Self-hosted with full control over your data

This guide walks through deploying Papra on Klutch.sh using Docker, configuring persistent storage, and setting up the application for production use.

Why Deploy Papra on Klutch.sh

Deploying Papra on Klutch.sh provides several advantages for document management:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Papra without complex orchestration. Push to GitHub, and your document system deploys automatically.

Persistent Storage: Attach persistent volumes for your documents and database. Your files survive container restarts and redeployments.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your sensitive documents.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Environment Variable Management: Securely store database credentials and API keys through Klutch.sh’s environment variable system.

Custom Domains: Assign a professional domain to your Papra instance for easy team access.

Scalable Resources: Allocate CPU and memory based on your document volume and OCR processing needs.

Prerequisites

Before deploying Papra on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Papra configuration
  • Basic familiarity with Docker and containerization concepts
  • A database (PostgreSQL or MySQL) for storing metadata

Preparing Your Repository

Create a GitHub repository containing your Dockerfile for Papra deployment.

Repository Structure

papra-deploy/
├── Dockerfile
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM node:20-alpine
WORKDIR /app
# Install dependencies
RUN apk add --no-cache git python3 make g++ tesseract-ocr
# Clone Papra repository
RUN git clone https://github.com/papra-hq/papra.git . && \
npm install && \
npm run build
# Create storage directories
RUN mkdir -p /data/documents /data/thumbnails
# Set environment variables
ENV NODE_ENV=production
ENV STORAGE_PATH=/data/documents
ENV THUMBNAILS_PATH=/data/thumbnails
# Expose the application port
EXPOSE 3000
# Start Papra
CMD ["npm", "start"]

Creating the .dockerignore File

Create a .dockerignore file:

.git
.github
*.md
LICENSE
.gitignore
*.log
.DS_Store
node_modules/
.env
.env.local

Environment Variables Reference

VariableRequiredDescription
DATABASE_URLYesDatabase connection string
SECRET_KEYYesSecret key for session encryption
STORAGE_PATHNoPath for document storage (default: /data/documents)
OCR_ENABLEDNoEnable OCR processing (default: true)
MAX_UPLOAD_SIZENoMaximum file upload size in bytes

Deploying Papra on Klutch.sh

    Generate a Secret Key

    Generate a secure secret key for your deployment:

    Terminal window
    openssl rand -base64 32

    Set Up Database

    Deploy a PostgreSQL or MySQL database on Klutch.sh or use an external database service. Note the connection URL.

    Push Your Repository to GitHub

    Initialize your repository and push to GitHub with your Dockerfile and configuration files.

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “papra” or “document-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 Papra Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 3000

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    DATABASE_URLYour database connection string
    SECRET_KEYYour generated secret key
    OCR_ENABLEDtrue

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /data/documents50+ GBDocument storage
    /data/thumbnails5 GBDocument previews and thumbnails

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will:

    • Detect your Dockerfile automatically
    • Build the container image
    • Attach the persistent volumes
    • Start the Papra container
    • Provision an HTTPS certificate

    Access Papra

    Once deployment completes, access your Papra instance at https://your-app-name.klutch.sh and create your first user account.

Initial Setup

Creating Your Account

  1. Navigate to your Papra instance
  2. Complete the initial setup wizard
  3. Create your administrator account
  4. Configure basic settings

Organizing Documents

  1. Create folders for different document categories
  2. Define tags for cross-cutting organization
  3. Set up custom metadata fields if needed
  4. Configure document types and templates

Using Papra

Uploading Documents

  • Drag and drop files onto the interface
  • Use the upload button to select files
  • Bulk upload multiple documents at once
  • Supported formats include PDF, images, and office documents

Searching Documents

  • Use the search bar for full-text search
  • Filter by tags, folders, or date ranges
  • Search within OCR-processed content
  • Save frequent searches for quick access

Managing Permissions

  • Assign roles to team members
  • Configure folder-level access control
  • Set document-specific permissions
  • Manage sharing and collaboration

Additional Resources

Conclusion

Deploying Papra on Klutch.sh gives you a powerful, self-hosted document management system with full control over your data. The combination of Papra’s organization features and Klutch.sh’s deployment simplicity means you can focus on managing your documents rather than infrastructure.

With full-text search, OCR processing, and team collaboration features, Papra provides the tools you need to maintain an organized and searchable document archive.