Deploying OpenSign
Introduction
OpenSign is an open-source electronic signature platform that provides a self-hosted alternative to commercial services like DocuSign and Adobe Sign. Built with modern web technologies, OpenSign enables individuals and organizations to create legally binding digital signatures while maintaining complete control over their document data and signing workflows.
The platform offers a comprehensive document signing solution with support for multiple signers, custom fields, email notifications, and audit trails. OpenSign uses industry-standard security practices including end-to-end encryption and secure document storage to ensure the integrity and confidentiality of signed documents.
Key highlights of OpenSign:
- Electronic Signatures: Create legally binding digital signatures that comply with eIDAS, ESIGN, and other electronic signature regulations
- Multi-Signer Support: Send documents to multiple recipients for sequential or parallel signing
- Custom Fields: Add text fields, checkboxes, dates, and other form elements to documents
- Audit Trail: Complete tracking of document history including views, signatures, and timestamps
- Email Notifications: Automatic notifications for signature requests, completions, and reminders
- Template System: Create reusable document templates for frequently used forms
- API Access: RESTful API for integrating signing capabilities into other applications
- Mobile Friendly: Responsive design allows signing documents from any device
- Self-Hosted: Full control over your data with no third-party dependencies
This guide walks through deploying OpenSign on Klutch.sh using Docker, configuring the necessary services, and setting up the application for production use.
Why Deploy OpenSign on Klutch.sh
Deploying OpenSign on Klutch.sh provides several advantages for managing your document signing needs:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds OpenSign without complex orchestration. Push to GitHub, and your signing platform deploys automatically.
Persistent Storage: Attach persistent volumes for documents, database, and configuration. Your signed documents and audit trails survive container restarts without data loss.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure document transmission and signature validation.
GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments, keeping your deployment synchronized.
Scalable Resources: Allocate CPU and memory based on your document volume and expected traffic. Scale resources as your signing needs grow.
Environment Variable Management: Securely store sensitive configuration like API keys and database credentials through Klutch.sh’s environment variable system.
Custom Domains: Assign a custom domain for a professional, branded signing experience for your clients and partners.
Always-On Availability: Your signing platform remains accessible 24/7 for recipients to review and sign documents at their convenience.
Prerequisites
Before deploying OpenSign on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your OpenSign configuration
- Basic familiarity with Docker and containerization concepts
- An SMTP server or email service for sending notifications
- (Optional) A custom domain for your OpenSign instance
Understanding OpenSign Architecture
OpenSign consists of several components working together:
Node.js Backend: The core application runs on Node.js with Express, handling API requests, document processing, and business logic.
React Frontend: A modern single-page application built with React provides the user interface for document management and signing.
MongoDB Database: Stores user accounts, document metadata, templates, and audit logs. OpenSign requires MongoDB 4.4 or later.
File Storage: Documents are stored on the filesystem or cloud storage, with references maintained in the database.
Email Service: SMTP integration sends signature requests, reminders, and completion notifications.
Preparing Your Repository
Create a GitHub repository containing your Dockerfile and configuration for OpenSign deployment.
Repository Structure
opensign-deploy/├── Dockerfile├── .dockerignore└── README.mdCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM node:18-alpine
WORKDIR /app
# Install dependencies for PDF processingRUN apk add --no-cache \ python3 \ make \ g++ \ cairo-dev \ pango-dev \ jpeg-dev \ giflib-dev
# Clone OpenSign repositoryRUN apk add --no-cache git && \ git clone https://github.com/OpenSignLabs/OpenSign.git . && \ apk del git
# Install dependenciesRUN npm install
# Build the applicationRUN npm run build
# Environment variablesENV NODE_ENV=productionENV PORT=3000
# Expose the application portEXPOSE 3000
# Start the applicationCMD ["npm", "start"]Environment Variables Reference
OpenSign requires several environment variables for proper operation:
| Variable | Required | Description |
|---|---|---|
MONGODB_URI | Yes | MongoDB connection string |
JWT_SECRET | Yes | Secret key for JWT token generation |
SMTP_HOST | Yes | SMTP server hostname |
SMTP_PORT | Yes | SMTP server port |
SMTP_USER | Yes | SMTP authentication username |
SMTP_PASS | Yes | SMTP authentication password |
APP_URL | Yes | Public URL of your OpenSign instance |
STORAGE_PATH | No | Path for document storage (default: /app/uploads) |
Deploying OpenSign on Klutch.sh
Once your repository is prepared, follow these steps to deploy OpenSign:
- Select HTTP as the traffic type
- Set the internal port to 3000
Generate Security Keys
Before deployment, generate secure keys for your application:
# Generate JWT secretopenssl rand -hex 32Save these keys securely for the environment variables configuration.
Push Your Repository to GitHub
Initialize and push your repository:
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial OpenSign deployment configuration"git remote add origin https://github.com/yourusername/opensign-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Name it descriptively like “opensign” or “document-signing”.
Deploy MongoDB Database
OpenSign requires MongoDB. Deploy a MongoDB instance first or use a managed MongoDB service. Note the connection string for the next step.
Create a New App
Within your project, create a new app. Connect your GitHub account and select the repository containing your OpenSign Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Configure the required environment variables:
| Variable | Value |
|---|---|
MONGODB_URI | Your MongoDB connection string |
JWT_SECRET | Your generated secret key |
SMTP_HOST | Your SMTP server hostname |
SMTP_PORT | Your SMTP port (typically 587) |
SMTP_USER | Your SMTP username |
SMTP_PASS | Your SMTP password |
APP_URL | https://your-app-name.klutch.sh |
Attach Persistent Volumes
Add persistent storage for documents:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/app/uploads | 50 GB | Signed documents and templates |
/app/logs | 1 GB | Application logs |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will build the container, attach volumes, and provision an HTTPS certificate.
Access OpenSign
Once deployment completes, access your OpenSign instance at https://your-app-name.klutch.sh. Create your admin account to begin using the platform.
Initial Configuration
Creating Your Admin Account
On first access, create your administrator account:
- Navigate to your OpenSign URL
- Click “Sign Up” to create the first user
- This first user automatically receives admin privileges
- Verify your email address to activate the account
Configuring Email Templates
Customize the email notifications sent to signers:
- Log in as admin
- Navigate to Settings > Email Templates
- Customize templates for signature requests, reminders, and completions
- Save your changes
Setting Up Templates
Create reusable document templates:
- Go to Templates in the main menu
- Upload a PDF document
- Add signature fields, text fields, and other form elements
- Save the template for future use
Document Workflow
Creating a Signature Request
- Upload a document or select a template
- Add recipients with their email addresses
- Place signature fields on the document
- Add any additional fields (dates, text, checkboxes)
- Send the signature request
Signing Documents
Recipients receive an email with a link to sign:
- Click the link in the email
- Review the document
- Click on signature fields to add signature
- Complete all required fields
- Submit the signed document
Managing Documents
Track document status from the dashboard:
- Pending: Awaiting signatures
- Completed: All parties have signed
- Declined: A recipient declined to sign
- Expired: The signing deadline passed
Security Best Practices
Protecting Your Installation
- Use strong, unique passwords for all accounts
- Enable two-factor authentication when available
- Regularly rotate the JWT secret key
- Keep the application updated with security patches
- Monitor access logs for suspicious activity
Document Security
- Documents are encrypted at rest
- Secure HTTPS transmission for all data
- Audit trails track all document access
- Automatic session expiration for inactive users
Troubleshooting Common Issues
Email Not Sending
Symptoms: Signature requests not being delivered.
Solutions:
- Verify SMTP credentials are correct
- Check SMTP port is not blocked
- Review application logs for email errors
- Test SMTP connection independently
Documents Not Loading
Symptoms: Uploaded documents fail to display.
Solutions:
- Check storage volume is properly mounted
- Verify sufficient disk space
- Review file permissions on upload directory
- Check application logs for processing errors
Database Connection Errors
Symptoms: Application cannot connect to MongoDB.
Solutions:
- Verify MongoDB is running and accessible
- Check connection string format
- Ensure network connectivity between services
- Review MongoDB logs for connection issues
Additional Resources
- OpenSign Official Website
- OpenSign GitHub Repository
- OpenSign Documentation
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying OpenSign on Klutch.sh provides a powerful, self-hosted document signing solution with automatic builds, persistent storage, and secure HTTPS access. With OpenSign, you maintain complete control over your signing workflows and document data while providing a professional signing experience for your clients and partners.
The combination of OpenSign’s comprehensive feature set and Klutch.sh’s simplified deployment means you can focus on your documents rather than infrastructure management. Whether you need occasional signature collection or high-volume document processing, OpenSign on Klutch.sh scales to meet your needs.