Why Self-Host?
Self-hosting Documenso provides several advantages:- Data sovereignty: Keep all your documents and signatures on your own infrastructure
- Full control: Customize and configure Documenso to meet your specific needs
- Privacy: No third-party access to your sensitive documents
- Cost savings: Avoid per-user or per-document pricing for larger deployments
- Compliance: Meet regulatory requirements for data residency
System Requirements
Before deploying Documenso, ensure your system meets these minimum requirements:Minimum Requirements
- CPU: 2 cores
- RAM: 4GB minimum (8GB recommended for production)
- Storage: 20GB minimum (depends on document volume)
- Node.js: v22.0.0 or higher
- Database: PostgreSQL 15 or higher
Required Services
PostgreSQL Database
A PostgreSQL database (v15+) is required for storing application data, user accounts, and document metadata.
SMTP Server
An SMTP server is required for sending email notifications to document signers and recipients.
Optional Services
S3-Compatible Storage
Use S3 or compatible storage (MinIO, DigitalOcean Spaces) for document storage instead of the database.
OAuth Providers
Configure Google, Microsoft, or OIDC providers for single sign-on authentication.
Deployment Options
Documenso can be deployed in several ways depending on your infrastructure and expertise:Docker Compose
Fastest way to get started with a complete production-ready stack including database.
Manual Installation
Build and deploy from source for maximum control and customization options.
Railway
One-click deployment to Railway with automatic provisioning of database and services.
Render
Deploy to Render with automatic builds and managed PostgreSQL database.
Core Environment Variables
All deployment methods require configuring essential environment variables:Required Variables
Secret key for NextAuth.js encryption. Generate with
openssl rand -hex 32.Primary encryption key (minimum 32 characters). Generate with
openssl rand -hex 32.Secondary encryption key (minimum 32 characters). Generate with
openssl rand -hex 32.Public URL where your Documenso instance will be accessible (e.g.,
https://documenso.example.com).PostgreSQL connection string with connection pooling.Example:
postgresql://user:password@localhost:5432/documensoPostgreSQL connection string for migrations (without connection pooling).Usually the same as
NEXT_PRIVATE_DATABASE_URL for self-hosted deployments.SMTP Configuration
Sender name for outgoing emails (e.g., “Documenso”).
Sender email address (e.g., “[email protected]”).
SMTP server hostname (required for
smtp-auth transport).SMTP server port (required for
smtp-auth transport).SMTP authentication username.
SMTP authentication password.
Signing Certificate
Password for the signing certificate file.
Path to the
.p12 certificate file. Defaults to /opt/documenso/cert.p12.Base64-encoded certificate contents (alternative to file path).
Security Considerations
Best Practices
- Use strong random secrets: Generate all secrets using
openssl rand -hex 32or similar cryptographically secure methods - Enable HTTPS: Always use HTTPS in production with valid SSL certificates
- Secure your database: Use strong passwords and restrict database access to your application only
- Regular backups: Implement automated backups for your database and signing certificates
- Keep updated: Regularly update Documenso to get the latest security patches
- Restrict signup: Consider setting
NEXT_PUBLIC_DISABLE_SIGNUP=trueand manually create user accounts
Storage Options
By default, Documenso stores documents in the PostgreSQL database. For production deployments with many documents, consider using S3-compatible storage:- Amazon S3
- MinIO
- DigitalOcean Spaces
- Backblaze B2
- Any S3-compatible storage
Next Steps
Choose your preferred deployment method and follow the detailed guide:Docker Deployment
Get started with Docker Compose in minutes
Manual Installation
Build from source for custom deployments
Railway Deployment
One-click deploy to Railway
Render Deployment
Deploy to Render platform
Need Help?
If you encounter issues during deployment:- Check the Troubleshooting Guide
- Join the Discord Community
- Review GitHub Issues
- Read the full .env.example for all configuration options
