Complete Guide: Self-Host Your E-Signature Platform with Docker
Back to BlogTutorials

Complete Guide: Self-Host Your E-Signature Platform with Docker

Step-by-step tutorial to deploy Space Sign on your own infrastructure in under 10 minutes. Perfect for organizations requiring full data control and GDPR compliance.

Alex Kumar

DevOps Engineer

Jan 4, 202615 min read

Complete Guide: Self-Host Your E-Signature Platform with Docker

Data sovereignty isn't just a buzzword—it's a legal requirement for many organizations. Whether you're bound by GDPR, HIPAA, or internal security policies, self-hosting your e-signature platform gives you complete control over where your data lives and who can access it.

Why Self-Host Space Sign?

Complete Data Control

Your documents never leave your infrastructure. No third-party cloud providers, no data transfers to foreign jurisdictions, no vendor access to sensitive contracts.

Compliance Made Simple

Meet regulatory requirements automatically:

  • GDPR: Keep EU data within EU borders
  • HIPAA: Control PHI on your own servers
  • FedRAMP: Government-approved infrastructure
  • SOC 2: Your own audit trail, your own controls
  • Cost Savings at Scale

    No per-document fees. No per-user limits. Just your infrastructure costs.

    Prerequisites

    Before you begin, ensure you have:

  • Docker and Docker Compose installed
  • A server with at least 2GB RAM
  • Basic command line knowledge
  • SSL certificates (or use Let's Encrypt)
  • Quick Start: 5-Minute Deployment

    Step 1: Clone the Repository

    bash
    1git clone https://github.com/pmspaceai7-wq/space-sign.git
    2cd space-sign

    Step 2: Configure Environment Variables

    Create a .env file:

    env
    1DATABASE_URL="postgresql://user:password@localhost:5432/spacesign"
    2NEXTAUTH_SECRET="your-secret-here"
    3NEXTAUTH_URL="https://sign.yourdomain.com"
    4NEXT_PUBLIC_WEBAPP_URL="https://sign.yourdomain.com"

    Step 3: Start the Services

    bash
    1docker-compose up -d

    That's it! Space Sign is now running on http://localhost:3000

    Production Deployment

    For production environments, follow these additional steps:

    1. Database Setup

    Use a managed PostgreSQL instance or deploy your own:

    yaml
    1version: '3.8'
    2services:
    3  postgres:
    4    image: postgres:15
    5    environment:
    6      POSTGRES_DB: spacesign
    7      POSTGRES_USER: spacesign
    8      POSTGRES_PASSWORD: secure-password
    9    volumes:
    10      - postgres-data:/var/lib/postgresql/data

    2. SSL/TLS Configuration

    Use Nginx as a reverse proxy with Let's Encrypt:

    nginx
    1server {
    2    listen 443 ssl http2;
    3    server_name sign.yourdomain.com;
    4    
    5    ssl_certificate /etc/letsencrypt/live/sign.yourdomain.com/fullchain.pem;
    6    ssl_certificate_key /etc/letsencrypt/live/sign.yourdomain.com/privkey.pem;
    7    
    8    location / {
    9        proxy_pass http://localhost:3000;
    10        proxy_set_header Host $host;
    11        proxy_set_header X-Real-IP $remote_addr;
    12    }
    13}

    3. Backup Strategy

    Automate database backups:

    bash
    1#!/bin/bash
    2BACKUP_DIR="/backups"
    3DATE=$(date +%Y%m%d_%H%M%S)
    4docker exec postgres pg_dump -U spacesign spacesign > $BACKUP_DIR/backup_$DATE.sql

    Advanced Configuration

    Email Notifications

    Configure SMTP for document notifications:

    env
    1EMAIL_SERVER_HOST="smtp.gmail.com"
    2EMAIL_SERVER_PORT=587
    3EMAIL_SERVER_USER="your-email@gmail.com"
    4EMAIL_SERVER_PASSWORD="app-password"
    5EMAIL_FROM="noreply@yourdomain.com"

    File Storage

    Choose your storage backend:

    Local Storage:

    env
    1STORAGE_TYPE="local"
    2STORAGE_PATH="/app/uploads"

    S3-Compatible Storage:

    env
    1STORAGE_TYPE="s3"
    2S3_BUCKET="your-bucket"
    3S3_REGION="us-east-1"
    4S3_ACCESS_KEY="your-access-key"
    5S3_SECRET_KEY="your-secret-key"

    Monitoring & Maintenance

    Health Checks

    Add health check endpoints to your docker-compose:

    yaml
    1healthcheck:
    2  test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
    3  interval: 30s
    4  timeout: 10s
    5  retries: 3

    Log Management

    Centralize logs with Loki or ELK stack:

    yaml
    1logging:
    2  driver: "json-file"
    3  options:
    4    max-size: "10m"
    5    max-file: "3"

    Troubleshooting

    Common Issues

    Database Connection Failed:

  • Check DATABASE_URL format
  • Ensure PostgreSQL is running
  • Verify network connectivity
  • High Memory Usage:

  • Increase container memory limits
  • Enable Redis caching
  • Optimize database queries
  • Slow Performance:

  • Add CDN for static assets
  • Enable application caching
  • Scale horizontally with load balancer
  • Updating Space Sign

    Keep your installation up to date:

    bash
    1# Backup first!
    2docker-compose exec postgres pg_dump -U spacesign spacesign > backup.sql
    3
    4# Pull latest changes
    5git pull origin main
    6
    7# Rebuild and restart
    8docker-compose build --no-cache
    9docker-compose up -d

    Conclusion

    Self-hosting Space Sign gives you enterprise-grade e-signature capabilities with complete data sovereignty. Whether you're a startup with strict security requirements or an enterprise needing air-gapped deployments, this guide gets you started in minutes.


    *Need help with your deployment? Join our community or request professional support.*

    Ready to Try Space Sign?

    Experience the power of enterprise-grade, AI-powered e-signatures.

    Space Sign Assistant

    Hello there 👋 I’m the Space Sign Assistant. How can I help you today?