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└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM node:20-alpine
WORKDIR /app
# Install dependenciesRUN apk add --no-cache git python3 make g++ tesseract-ocr
# Clone Papra repositoryRUN git clone https://github.com/papra-hq/papra.git . && \ npm install && \ npm run build
# Create storage directoriesRUN mkdir -p /data/documents /data/thumbnails
# Set environment variablesENV NODE_ENV=productionENV STORAGE_PATH=/data/documentsENV THUMBNAILS_PATH=/data/thumbnails
# Expose the application portEXPOSE 3000
# Start PapraCMD ["npm", "start"]Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Storenode_modules/.env.env.localEnvironment Variables Reference
| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Yes | Database connection string |
SECRET_KEY | Yes | Secret key for session encryption |
STORAGE_PATH | No | Path for document storage (default: /data/documents) |
OCR_ENABLED | No | Enable OCR processing (default: true) |
MAX_UPLOAD_SIZE | No | Maximum file upload size in bytes |
Deploying Papra on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Papra container
- Provision an HTTPS certificate
Generate a Secret Key
Generate a secure secret key for your deployment:
openssl rand -base64 32Set 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:
Set Environment Variables
Add the following environment variables:
| Variable | Value |
|---|---|
DATABASE_URL | Your database connection string |
SECRET_KEY | Your generated secret key |
OCR_ENABLED | true |
Attach Persistent Volumes
Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data/documents | 50+ GB | Document storage |
/data/thumbnails | 5 GB | Document previews and thumbnails |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
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
- Navigate to your Papra instance
- Complete the initial setup wizard
- Create your administrator account
- Configure basic settings
Organizing Documents
- Create folders for different document categories
- Define tags for cross-cutting organization
- Set up custom metadata fields if needed
- 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.