Skip to content

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.md

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM node:18-alpine
WORKDIR /app
# Install dependencies for PDF processing
RUN apk add --no-cache \
python3 \
make \
g++ \
cairo-dev \
pango-dev \
jpeg-dev \
giflib-dev
# Clone OpenSign repository
RUN apk add --no-cache git && \
git clone https://github.com/OpenSignLabs/OpenSign.git . && \
apk del git
# Install dependencies
RUN npm install
# Build the application
RUN npm run build
# Environment variables
ENV NODE_ENV=production
ENV PORT=3000
# Expose the application port
EXPOSE 3000
# Start the application
CMD ["npm", "start"]

Environment Variables Reference

OpenSign requires several environment variables for proper operation:

VariableRequiredDescription
MONGODB_URIYesMongoDB connection string
JWT_SECRETYesSecret key for JWT token generation
SMTP_HOSTYesSMTP server hostname
SMTP_PORTYesSMTP server port
SMTP_USERYesSMTP authentication username
SMTP_PASSYesSMTP authentication password
APP_URLYesPublic URL of your OpenSign instance
STORAGE_PATHNoPath for document storage (default: /app/uploads)

Deploying OpenSign on Klutch.sh

Once your repository is prepared, follow these steps to deploy OpenSign:

    Generate Security Keys

    Before deployment, generate secure keys for your application:

    Terminal window
    # Generate JWT secret
    openssl rand -hex 32

    Save these keys securely for the environment variables configuration.

    Push Your Repository to GitHub

    Initialize and push your repository:

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial OpenSign deployment configuration"
    git remote add origin https://github.com/yourusername/opensign-deploy.git
    git push -u origin main

    Create 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:

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

    Set Environment Variables

    Configure the required environment variables:

    VariableValue
    MONGODB_URIYour MongoDB connection string
    JWT_SECRETYour generated secret key
    SMTP_HOSTYour SMTP server hostname
    SMTP_PORTYour SMTP port (typically 587)
    SMTP_USERYour SMTP username
    SMTP_PASSYour SMTP password
    APP_URLhttps://your-app-name.klutch.sh

    Attach Persistent Volumes

    Add persistent storage for documents:

    Mount PathRecommended SizePurpose
    /app/uploads50 GBSigned documents and templates
    /app/logs1 GBApplication 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:

  1. Navigate to your OpenSign URL
  2. Click “Sign Up” to create the first user
  3. This first user automatically receives admin privileges
  4. Verify your email address to activate the account

Configuring Email Templates

Customize the email notifications sent to signers:

  1. Log in as admin
  2. Navigate to Settings > Email Templates
  3. Customize templates for signature requests, reminders, and completions
  4. Save your changes

Setting Up Templates

Create reusable document templates:

  1. Go to Templates in the main menu
  2. Upload a PDF document
  3. Add signature fields, text fields, and other form elements
  4. Save the template for future use

Document Workflow

Creating a Signature Request

  1. Upload a document or select a template
  2. Add recipients with their email addresses
  3. Place signature fields on the document
  4. Add any additional fields (dates, text, checkboxes)
  5. Send the signature request

Signing Documents

Recipients receive an email with a link to sign:

  1. Click the link in the email
  2. Review the document
  3. Click on signature fields to add signature
  4. Complete all required fields
  5. 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

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.