Deploying EveryDocs
Introduction
EveryDocs Core is a simple yet powerful Document Management System (DMS) designed for private use. Built with Ruby on Rails, EveryDocs helps you organize your documents digitally with features like PDF uploading, folder organization, full-text search, and optional encryption for secure document storage. Whether you’re managing personal documents, business records, or family archives, EveryDocs provides an intuitive interface for keeping track of your important files.
The system extracts content from PDF files for comprehensive full-text search capabilities, allows you to add custom metadata like people and processing states to documents, and supports encrypted storage for sensitive files. With its REST API and mobile-friendly web interface, you can access and manage your documents from anywhere.
This guide walks you through deploying EveryDocs Core on Klutch.sh using Docker. You’ll learn how to set up MySQL for database storage, configure persistent volumes for document files, enable encryption features, and implement production-ready best practices for a secure and reliable document management system.
Prerequisites
Before deploying EveryDocs on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your EveryDocs project
- A MySQL database (we’ll cover deployment on Klutch.sh)
- Basic understanding of Docker and document management systems
- Familiarity with Ruby on Rails applications (helpful but not required)
Why Deploy EveryDocs on Klutch.sh
- Automatic Dockerfile Detection - Klutch.sh automatically detects and builds your Dockerfile without manual configuration
- Persistent Document Storage - Attach volumes to ensure your uploaded documents persist across deployments
- Database Integration - Easy connection to MySQL databases deployed on Klutch.sh or external services
- Secure Environment Variables - Store sensitive database credentials and encryption keys securely
- HTTP Traffic Routing - Built-in load balancing and SSL termination for web access
- Continuous Deployment - Automatic builds and deployments when you push to GitHub
- Scalable Infrastructure - Start small and scale as your document library grows
- Custom Domains - Connect your own domain with automatic HTTPS certificates
- Zero Downtime Updates - Rolling deployments keep your document system accessible during updates
Understanding EveryDocs Architecture
EveryDocs is built with several key components:
Core Features
Document Upload and Organization
- Upload PDF documents with title, description, and creation date
- Organize documents in folders and subfolders with hierarchical structure
- Add people and processing states to track document workflows
- Extract content from PDF files for full-text search capabilities
Security and Encryption
- Encrypted storage of PDF files on disk (optional)
- Automatic encryption activation for newly created users (v1.5.0+)
- User-specific encryption keys for maximum security
- Note: Encrypted documents don’t support full-text search
Search and Discovery
- Search all documents by title, description, or content
- Full-text search across extracted PDF content (for non-encrypted documents)
- Quick filtering and organization by folders and metadata
Multi-User Support
- Create multiple user accounts with individual encryption settings
- Authentication via JsonWebToken (JWT)
- REST API for programmatic access to all CRUD operations
- Mobile-friendly web UI for on-the-go document management
Technology Stack
- Backend: Ruby on Rails 8.0+ (Ruby 3.4+)
- Database: MySQL/MariaDB for storing metadata and user information
- File Storage: Local filesystem with optional encryption
- Authentication: JWT-based authentication system
- API: RESTful API for all document operations
- Frontend: Mobile-friendly web interface (separate project: everydocs-web)
Preparing Your EveryDocs Repository
Step 1: Fork or Clone the EveryDocs Repository
Start by getting the EveryDocs Core source code:
# Clone the official repositorygit clone https://github.com/jonashellmann/everydocs-core.gitcd everydocs-core
# Or fork it first on GitHub, then clone your forkgit clone https://github.com/your-username/everydocs-core.gitcd everydocs-coreStep 2: Review the Existing Dockerfile
EveryDocs Core includes a production-ready Dockerfile. Let’s examine it:
FROM ruby:3.4.2
LABEL org.opencontainers.image.authors="Jonas Hellmann <mail@jonas-hellmann.de>"
# Create directory for document storageRUN mkdir -p /var/everydocs-files
WORKDIR /usr/src/app
# Set environment variablesENV RAILS_ENV=productionENV EVERYDOCS_DB_ADAPTER=mysql2ENV EVERYDOCS_DB_NAME=everydocsENV EVERYDOCS_DB_USER=everydocsENV EVERYDOCS_DB_HOST=localhostENV EVERYDOCS_DB_PORT=3306
# Copy application codeCOPY . .
# Clean up unnecessary filesRUN rm -f Gemfile.lockRUN rm -rf .git/
# Install Ruby dependenciesRUN bundle install
# Install Node.js for asset compilationRUN apt-get updateRUN apt-get install nodejs -y --no-install-recommends
# Initialize Rails credentials (required for production)RUN EDITOR="mate --wait" bin/rails credentials:edit
# Expose application portEXPOSE 5678
# Start script and Rails serverENTRYPOINT ["./bin/entrypoint.sh"]CMD ["rails", "server", "-b", "0.0.0.0", "--port", "5678"]Step 3: Customize the Dockerfile (Optional)
For production deployment on Klutch.sh, you may want to create a customized version:
FROM ruby:3.4.2-alpine
LABEL org.opencontainers.image.authors="Your Name <your-email@example.com>"
# Install system dependenciesRUN apk add --no-cache \ build-base \ mysql-dev \ nodejs \ npm \ tzdata \ git \ bash
# Create application directory and document storageRUN mkdir -p /usr/src/app /var/everydocs-filesWORKDIR /usr/src/app
# Set environment defaults (will be overridden by Klutch.sh environment variables)ENV RAILS_ENV=productionENV EVERYDOCS_DB_ADAPTER=mysql2ENV EVERYDOCS_DB_NAME=everydocsENV EVERYDOCS_DB_USER=everydocsENV EVERYDOCS_DB_HOST=localhostENV EVERYDOCS_DB_PORT=3306ENV RAILS_LOG_TO_STDOUT=trueENV RAILS_SERVE_STATIC_FILES=true
# Copy Gemfile and install dependenciesCOPY Gemfile Gemfile.lock ./RUN bundle config set --local deployment 'true' && \ bundle config set --local without 'development test' && \ bundle install --jobs=4 --retry=3
# Copy application codeCOPY . .
# Precompile assetsRUN bundle exec rails assets:precompile
# Create a script to handle database setup and credentialsRUN echo '#!/bin/bash\n\set -e\n\\n\# Set up Rails master key if not present\n\if [ ! -f config/master.key ]; then\n\ echo "Generating Rails master key..."\n\ bundle exec rails credentials:edit --environment=production\n\fi\n\\n\# Run database migrations\n\echo "Running database migrations..."\n\bundle exec rails db:migrate RAILS_ENV=production\n\\n\# Start the Rails server\n\echo "Starting EveryDocs..."\n\exec bundle exec rails server -b 0.0.0.0 -p ${PORT:-5678}\n\' > /usr/src/app/docker-entrypoint.sh
RUN chmod +x /usr/src/app/docker-entrypoint.sh
# Expose application portEXPOSE 5678
# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \ CMD curl -f http://localhost:5678/ || exit 1
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"]Step 4: Create Environment Configuration
Create a .env.example file to document required environment variables:
# Rails ConfigurationRAILS_ENV=productionSECRET_KEY_BASE=generate_with_rails_secret_command
# Database ConfigurationEVERYDOCS_DB_ADAPTER=mysql2EVERYDOCS_DB_NAME=everydocsEVERYDOCS_DB_USER=everydocsEVERYDOCS_DB_PASSWORD=your_secure_database_passwordEVERYDOCS_DB_HOST=mysql-app.klutch.shEVERYDOCS_DB_PORT=8000
# Application ConfigurationPORT=5678RAILS_SERVE_STATIC_FILES=trueRAILS_LOG_TO_STDOUT=true
# Encryption (Optional - for user document encryption)# Generate with: openssl rand -hex 32SECRET_KEY=your_encryption_secret_key
# Time ZoneTZ=America/New_YorkStep 5: Create a README
Document your deployment with a README.md:
# EveryDocs Core - Klutch.sh Deployment
Document Management System deployed on Klutch.sh.
## Prerequisites
- MySQL database- Persistent storage for documents
## Environment Variables
See `.env.example` for required configuration.
## Deployment
1. Deploy MySQL database on Klutch.sh2. Set environment variables in Klutch.sh dashboard3. Attach persistent volume to `/var/everydocs-files`4. Deploy the application
## First-Time Setup
After deployment, access the web interface and create your first user account.
## Enabling Encryption
For users who want encrypted document storage:1. Generate a secret key: `openssl rand -hex 32`2. Add the key to the user's database record3. Set `encryption_activated_flag` to true in the users table4. Note: Encrypted documents won't have full-text search
## License
GPL-3.0 - See LICENSE file for detailsStep 6: Initialize Git Repository
If you’ve created a new directory or made customizations:
git initgit add .git commit -m "Initial EveryDocs deployment setup for Klutch.sh"git branch -M maingit remote add origin https://github.com/your-username/everydocs-klutch.gitgit push -u origin mainDeploying MySQL Database
EveryDocs requires a MySQL database. You can deploy MySQL on Klutch.sh or use an external managed service.
Option 1: Deploy MySQL on Klutch.sh
-
Create a MySQL Deployment
In your Klutch.sh project, create a new app for MySQL. You can follow our comprehensive MySQL deployment guide or use this quick setup:
-
Create a MySQL Repository
Create a new GitHub repository with a
Dockerfile:FROM mysql:8.4ENV MYSQL_DATABASE=everydocsENV MYSQL_USER=everydocsENV MYSQL_PASSWORD=secure_password_hereENV MYSQL_ROOT_PASSWORD=secure_root_password_hereEXPOSE 3306 -
Deploy MySQL on Klutch.sh
- Go to klutch.sh/app
- Create a new app and connect your MySQL repository
- Select TCP as the traffic type
- Set internal port to 3306
- Deploy the application
-
Attach Persistent Storage
Add a persistent volume for MySQL data:
- Mount Path:
/var/lib/mysql - Size: 10GB or more depending on expected document volume
- Mount Path:
-
Note Connection Details
After deployment, your MySQL database will be accessible at:
- Host:
your-mysql-app.klutch.sh - Port:
8000(Klutch.sh routes TCP traffic through port 8000) - Database:
everydocs - Username:
everydocs - Password: The password you set in the Dockerfile
- Host:
Option 2: Use External MySQL Service
You can also use managed MySQL services like:
- AWS RDS
- Google Cloud SQL
- Azure Database for MySQL
- PlanetScale
- DigitalOcean Managed Databases
Simply note the connection details (host, port, database name, username, password) for use in your EveryDocs configuration.
Deploying EveryDocs on Klutch.sh
-
Log in to Klutch.sh
Navigate to klutch.sh/app and sign in to your account.
-
Create a New Project (if you haven’t already)
- Click “New Project”
- Enter a project name (e.g., “Document Management”)
- Select your organization or personal account
-
Create a New App
- Within your project, click “New App”
- Give your app a name (e.g., “everydocs-core”)
-
Connect Your GitHub Repository
- Select GitHub as your Git source
- Authorize Klutch.sh to access your repositories if prompted
- Choose the repository containing your EveryDocs code
- Select the branch to deploy (typically
mainormaster)
-
Configure Network Settings
Klutch.sh will automatically detect your Dockerfile. Configure the following:
- Traffic Type: Select HTTP (EveryDocs is a web application)
- Internal Port: Set to 5678 (or the PORT you configured in your Dockerfile)
-
Set Environment Variables
Add the following environment variables in the Klutch.sh dashboard:
Required Variables:
RAILS_ENV=productionSECRET_KEY_BASE=<generate with: rails secret>EVERYDOCS_DB_ADAPTER=mysql2EVERYDOCS_DB_NAME=everydocsEVERYDOCS_DB_USER=everydocsEVERYDOCS_DB_PASSWORD=<your mysql password>EVERYDOCS_DB_HOST=your-mysql-app.klutch.shEVERYDOCS_DB_PORT=8000PORT=5678RAILS_SERVE_STATIC_FILES=trueRAILS_LOG_TO_STDOUT=trueOptional Variables:
TZ=America/New_YorkSECRET_KEY=<openssl rand -hex 32 for encryption>Important: Mark
SECRET_KEY_BASE,EVERYDOCS_DB_PASSWORD, andSECRET_KEYas sensitive/secret variables. -
Attach Persistent Volume for Documents
EveryDocs needs persistent storage for uploaded PDF files:
- Click “Add Volume” in the storage section
- Mount Path:
/var/everydocs-files - Size: Start with 20GB (adjust based on expected document volume)
This ensures your uploaded documents persist across deployments and container restarts.
-
Configure Additional Settings
- Region: Choose the region closest to your users
- Compute Resources: Minimum 512MB RAM, 1GB+ recommended for production
- Instances: Start with 1 instance
-
Deploy the Application
Click “Create” or “Deploy” to start the deployment. Klutch.sh will:
- Detect your Dockerfile automatically
- Build the Docker image
- Install Ruby dependencies
- Set up Rails environment
- Run database migrations
- Start the application server
- Assign a URL (e.g.,
https://everydocs-app.klutch.sh)
-
Wait for Deployment
Monitor the build logs. The initial deployment may take 5-10 minutes as it:
- Builds the Ruby environment
- Installs gems
- Compiles assets
- Sets up database connections
- Runs migrations
-
Verify Deployment
Once deployed, visit your application URL (
https://your-app.klutch.sh). You should see the EveryDocs login/registration page.
Initial Setup and Configuration
Creating Your First User Account
-
Access the Web Interface
Navigate to your deployed EveryDocs URL (e.g.,
https://everydocs-app.klutch.sh) -
Create an Account
- Click on “Sign Up” or “Register”
- Enter your email address
- Choose a strong password
- Click “Create Account”
-
Login
- Use your new credentials to log in
- You’ll be directed to the dashboard
Setting Up Document Encryption (Optional)
If you want encrypted document storage for enhanced security:
-
Generate an Encryption Key
Terminal window openssl rand -hex 32 -
Add the Key to Your User Record
You’ll need to access your MySQL database to set this up:
Terminal window # Connect to your MySQL databasemysql -h your-mysql-app.klutch.sh -P 8000 -u everydocs -p everydocs# Add the secret key and enable encryption for your userUPDATE usersSET secret_key = 'your_generated_key_here',encryption_activated_flag = 1WHERE email = 'your-email@example.com'; -
Understand Encryption Trade-offs
Benefits:
- Documents are encrypted at rest on disk
- Enhanced security for sensitive files
- User-specific encryption keys
Limitations:
- Encrypted documents don’t support full-text search
- Content extraction is disabled for encrypted documents
- You can only search by title and description metadata
Organizing Your First Documents
-
Create Folders
- Click “New Folder” from the dashboard
- Enter a folder name (e.g., “Personal Documents”, “Tax Records”)
- Create subfolders for better organization
-
Upload a Document
- Navigate to a folder
- Click “Upload Document”
- Select a PDF file from your computer
- Add metadata:
- Title: Document name
- Description: Brief description of contents
- Date: Document creation or relevant date
- People: Associated individuals (optional)
- Processing State: Current status (optional)
- Click “Upload”
-
Search Documents
- Use the search bar to find documents by title, description, or content
- Full-text search works for non-encrypted documents
- Filter by folder, date, people, or processing state
Using the EveryDocs REST API
EveryDocs provides a comprehensive REST API for programmatic access to your documents.
Authentication
The API uses JWT (JsonWebToken) for authentication:
# Login to get JWT tokencurl -X POST https://everydocs-app.klutch.sh/api/login \ -H "Content-Type: application/json" \ -d '{ "email": "your-email@example.com", "password": "your-password" }'
# Response includes JWT token{ "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}API Examples
List All Documents
curl -X GET https://everydocs-app.klutch.sh/api/documents \ -H "Authorization: Bearer YOUR_JWT_TOKEN"Upload a Document
curl -X POST https://everydocs-app.klutch.sh/api/documents \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -F "document[title]=Invoice 2024-001" \ -F "document[description]=Monthly service invoice" \ -F "document[document_date]=2024-01-15" \ -F "document[file]=@/path/to/invoice.pdf"Get Document Details
curl -X GET https://everydocs-app.klutch.sh/api/documents/123 \ -H "Authorization: Bearer YOUR_JWT_TOKEN"Update a Document
curl -X PATCH https://everydocs-app.klutch.sh/api/documents/123 \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "document": { "title": "Updated Invoice Title", "description": "Updated description" } }'Delete a Document
curl -X DELETE https://everydocs-app.klutch.sh/api/documents/123 \ -H "Authorization: Bearer YOUR_JWT_TOKEN"Search Documents
curl -X GET "https://everydocs-app.klutch.sh/api/documents/search?q=invoice" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"Create a Folder
curl -X POST https://everydocs-app.klutch.sh/api/folders \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "folder": { "name": "Tax Documents 2024", "parent_id": null } }'Viewing All Available API Routes
To see all available API endpoints and their parameters:
# If you have access to the Rails consolebundle exec rails routesThis will show you all CRUD operations available for:
- Documents
- Folders
- People
- Processing states
- Users (authentication)
Environment Variables Reference
Here’s a complete reference of all environment variables supported by EveryDocs:
Required Variables
| Variable | Description | Example |
|---|---|---|
RAILS_ENV | Rails environment mode | production |
SECRET_KEY_BASE | Rails secret key for encryption | Generate with rails secret |
EVERYDOCS_DB_ADAPTER | Database adapter | mysql2 |
EVERYDOCS_DB_NAME | Database name | everydocs |
EVERYDOCS_DB_USER | Database username | everydocs |
EVERYDOCS_DB_PASSWORD | Database password | Your secure password |
EVERYDOCS_DB_HOST | Database host | mysql-app.klutch.sh |
EVERYDOCS_DB_PORT | Database port | 8000 |
Optional Variables
| Variable | Description | Default |
|---|---|---|
PORT | Application port | 5678 |
RAILS_SERVE_STATIC_FILES | Serve static assets | true |
RAILS_LOG_TO_STDOUT | Log to standard output | true |
TZ | Timezone | UTC |
SECRET_KEY | User encryption key | Empty (encryption disabled) |
RAILS_MAX_THREADS | Max threads per process | 5 |
WEB_CONCURRENCY | Number of worker processes | 2 |
Production Best Practices
Security Hardening
1. Use Strong Passwords
Generate secure passwords for all credentials:
# Generate SECRET_KEY_BASErails secret
# Generate encryption keyopenssl rand -hex 32
# Generate database passwordopenssl rand -base64 322. Enable Encryption for Sensitive Documents
For highly sensitive documents, enable per-user encryption:
- Generate unique secret keys for each user
- Set
encryption_activated_flag = 1in the users table - Understand that encrypted documents won’t be searchable by content
3. Regular Security Updates
Keep EveryDocs and its dependencies updated:
# Update Ruby gemsbundle update
# Check for security vulnerabilitiesbundle audit
# Update base Docker image# Change FROM ruby:3.4.2 to latest stable version4. Implement HTTPS Only
Klutch.sh provides HTTPS automatically, but ensure:
- Force SSL in Rails:
config.force_ssl = true - Set secure cookie flags
- Use HSTS headers
5. Limit Access with Authentication
- Don’t expose user registration publicly if not needed
- Implement IP whitelisting for admin users if possible
- Use strong password policies
- Consider implementing two-factor authentication
Database Optimization
1. Regular Backups
Set up automated database backups:
# Manual backupmysqldump -h your-mysql-app.klutch.sh -P 8000 -u everydocs -p everydocs > backup_$(date +%Y%m%d).sql
# Compress backupgzip backup_$(date +%Y%m%d).sql2. Index Optimization
Ensure proper database indexes for search performance:
-- Check existing indexesSHOW INDEX FROM documents;
-- Add index for common searchesCREATE INDEX idx_documents_title ON documents(title);CREATE INDEX idx_documents_created_at ON documents(created_at);CREATE INDEX idx_folders_parent_id ON folders(parent_id);3. Database Maintenance
Run regular maintenance:
-- Analyze tables for query optimizationANALYZE TABLE documents, folders, users;
-- Optimize tables to reclaim spaceOPTIMIZE TABLE documents;Performance Optimization
1. Enable Caching
Configure Rails caching for better performance:
config.cache_store = :memory_storeconfig.action_controller.perform_caching = true2. Asset Optimization
Ensure assets are precompiled and compressed:
RAILS_ENV=production bundle exec rails assets:precompile3. Database Connection Pooling
Optimize database connections:
production: pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 50004. Monitor Resource Usage
Keep an eye on application resources:
- CPU usage
- Memory consumption
- Disk space (especially
/var/everydocs-files) - Database size and query performance
Storage Management
1. Monitor Volume Usage
Regularly check disk usage:
# Check document storagedu -sh /var/everydocs-files
# List largest filesdu -h /var/everydocs-files | sort -rh | head -202. Implement Storage Policies
Consider implementing:
- Document retention policies
- Automatic archival of old documents
- Storage quotas per user
3. Volume Scaling
If you’re running out of space:
- Increase volume size in Klutch.sh dashboard
- Consider moving old documents to archival storage
- Implement document compression for older files
Backup and Disaster Recovery
1. Automated Backups
Set up regular automated backups:
#!/bin/bashDATE=$(date +%Y%m%d_%H%M%S)BACKUP_DIR="/backups"
# Backup databasemysqldump -h your-mysql-app.klutch.sh -P 8000 -u everydocs -p${DB_PASSWORD} everydocs | gzip > ${BACKUP_DIR}/db_${DATE}.sql.gz
# Backup documents (if accessible)tar -czf ${BACKUP_DIR}/documents_${DATE}.tar.gz /var/everydocs-files
# Keep only last 7 days of backupsfind ${BACKUP_DIR} -name "*.gz" -mtime +7 -delete
echo "Backup completed: ${DATE}"2. Test Restore Procedures
Regularly test your backup restoration:
# Restore databasegunzip < db_backup.sql.gz | mysql -h your-mysql-app.klutch.sh -P 8000 -u everydocs -p everydocs
# Restore documentstar -xzf documents_backup.tar.gz -C /3. Off-Site Backup Storage
Store backups in multiple locations:
- Cloud storage (AWS S3, Google Cloud Storage)
- External backup service
- Local encrypted backups
Monitoring and Logging
1. Application Monitoring
Monitor application health:
# Check application statuscurl -f https://everydocs-app.klutch.sh/ || echo "Application down"
# Monitor response timestime curl -s -o /dev/null https://everydocs-app.klutch.sh/2. Log Management
Configure proper logging:
config.log_level = :infoconfig.logger = ActiveSupport::Logger.new(STDOUT)config.log_formatter = ::Logger::Formatter.new3. Error Tracking
Consider integrating error tracking services:
- Sentry
- Honeybadger
- Rollbar
- Bugsnag
4. Performance Metrics
Track key metrics:
- Request response times
- Database query performance
- Document upload/download speeds
- Search query performance
- User session duration
Troubleshooting Common Issues
Database Connection Errors
Problem: Application can’t connect to MySQL database
ActiveRecord::ConnectionNotEstablishedCould not connect to databaseSolutions:
-
Verify MySQL is running and accessible:
Terminal window mysql -h your-mysql-app.klutch.sh -P 8000 -u everydocs -p -
Check environment variables are set correctly:
Terminal window echo $EVERYDOCS_DB_HOSTecho $EVERYDOCS_DB_PORTecho $EVERYDOCS_DB_NAME -
Ensure database exists:
CREATE DATABASE IF NOT EXISTS everydocs; -
Verify user permissions:
GRANT ALL PRIVILEGES ON everydocs.* TO 'everydocs'@'%';FLUSH PRIVILEGES;
Application Won’t Start
Problem: Container starts but application crashes
Solutions:
-
Check logs in Klutch.sh dashboard for error messages
-
Verify
SECRET_KEY_BASEis set:Terminal window # Generate if missingrails secret -
Run database migrations:
Terminal window bundle exec rails db:migrate RAILS_ENV=production -
Check for missing environment variables:
Terminal window env | grep EVERYDOCSenv | grep RAILS
Document Upload Failures
Problem: PDF uploads fail or timeout
Solutions:
-
Check persistent volume is attached:
Terminal window ls -la /var/everydocs-files -
Verify write permissions:
Terminal window chmod 777 /var/everydocs-files -
Check disk space:
Terminal window df -h /var/everydocs-files -
Increase file upload limits if needed:
config/application.rb config.action_dispatch.max_request_upload_size = 50.megabytes
Full-Text Search Not Working
Problem: Search doesn’t find document content
Solutions:
-
Check if encryption is enabled - Encrypted documents don’t support full-text search:
SELECT email, encryption_activated_flag FROM users; -
Verify PDF text extraction - Ensure documents have extractable text:
- Scanned PDFs without OCR won’t be searchable
- Check if PDF has text layer using a PDF viewer
-
Rebuild search index (if applicable):
Terminal window bundle exec rails db:seed # Or equivalent reindexing command
Slow Performance
Problem: Application is slow or unresponsive
Solutions:
-
Check resource allocation:
- Increase CPU/RAM in Klutch.sh dashboard
- Monitor resource usage during peak times
-
Optimize database queries:
-- Check slow queriesSHOW FULL PROCESSLIST;-- Add missing indexesSHOW INDEX FROM documents; -
Clear Rails cache:
Terminal window bundle exec rails cache:clear -
Reduce document storage size:
- Archive old documents
- Compress PDF files before upload
Authentication Issues
Problem: Can’t log in or JWT token errors
Solutions:
-
Verify
SECRET_KEY_BASEhasn’t changed:- Changing this invalidates all existing sessions
-
Clear browser cookies and try again
-
Check user exists in database:
SELECT * FROM users WHERE email = 'your-email@example.com'; -
Reset user password if needed:
Terminal window bundle exec rails consoleuser = User.find_by(email: 'your-email@example.com')user.update(password: 'newpassword')
Updating EveryDocs
To update your EveryDocs deployment to a newer version:
-
Check for Updates
Terminal window cd everydocs-coregit fetch origingit log HEAD..origin/master --oneline -
Review Changelog
Check the EveryDocs releases page for breaking changes and migration notes.
-
Backup Everything
Terminal window # Backup databasemysqldump -h your-mysql-app.klutch.sh -P 8000 -u everydocs -p everydocs > backup_before_update.sql# Note current document countls -1 /var/everydocs-files | wc -l -
Update Code
Terminal window git pull origin masterbundle install -
Run Migrations
Terminal window bundle exec rails db:migrate RAILS_ENV=production -
Push to GitHub
Terminal window git add .git commit -m "Update to EveryDocs version X.X.X"git push origin main -
Klutch.sh Auto-Deploy
Klutch.sh will automatically detect the changes and rebuild your application.
-
Verify Update
- Check application logs for errors
- Test document upload
- Verify search functionality
- Test API endpoints
Advanced Configuration
Integrating the Web Interface
EveryDocs Core provides the API backend. For the full web interface, deploy the companion project:
To integrate:
- Deploy everydocs-web separately
- Configure it to point to your EveryDocs Core API URL
- Set CORS headers in EveryDocs Core to allow the web interface domain
Custom Domain Setup
-
Add Domain in Klutch.sh
- Go to your app settings
- Add your custom domain (e.g.,
docs.yourcompany.com)
-
Configure DNS
Add a CNAME record pointing to your Klutch.sh app:
docs.yourcompany.com CNAME your-app.klutch.sh -
Update Environment Variables
Update any hardcoded URLs to use your custom domain:
APP_URL=https://docs.yourcompany.com
Email Notifications (Future Enhancement)
While EveryDocs Core doesn’t include built-in email notifications, you can extend it:
# Add to Gemfilegem 'mail'
# Configure in config/environments/production.rbconfig.action_mailer.delivery_method = :smtpconfig.action_mailer.smtp_settings = { address: 'smtp.gmail.com', port: 587, user_name: ENV['SMTP_USERNAME'], password: ENV['SMTP_PASSWORD'], authentication: 'plain', enable_starttls_auto: true}Multi-User Management
For organizations with multiple users:
-
Create Admin User
UPDATE users SET is_admin = 1 WHERE email = 'admin@company.com'; -
Implement Role-Based Access
Extend the user model to include roles:
- Admin: Full access
- Editor: Upload and edit documents
- Viewer: Read-only access
-
Set Up User Invitations
Instead of open registration, implement invite-only user creation.
Resources and Further Reading
Official Documentation
Related Klutch.sh Guides
Community and Support
- GitHub Issues - Report bugs or request features
- Ruby Community - General Ruby help
- Rails Forum - Rails-specific questions
Additional Tools
- MySQL Workbench - Database management GUI
- Postman - API testing tool
- PDF Compression Tools - Optimize PDFs before upload
Conclusion
You’ve successfully deployed EveryDocs Core on Klutch.sh! Your document management system is now running with persistent storage for documents, MySQL database integration, and full API access. With features like full-text search, folder organization, optional encryption, and a mobile-friendly interface, you have a powerful tool for managing your digital documents.
Remember to:
- Regularly backup your database and document files
- Monitor disk usage as your document library grows
- Keep the application and dependencies updated
- Implement proper security measures for production use
- Consider enabling encryption for sensitive documents
Whether you’re organizing personal documents, managing business records, or building a custom document workflow, EveryDocs on Klutch.sh provides a reliable, self-hosted solution with the flexibility to scale as your needs grow.
For questions or issues, consult the troubleshooting section above or reach out to the EveryDocs community on GitHub.