Overview
This guide will walk you through setting up Documenso on your local machine for development. Documenso is a full-stack document signing platform built with React Router (Remix), TypeScript, Prisma, and PostgreSQL.Prerequisites
Before you begin, ensure you have the following installed:- Node.js v22.0.0 or higher
- npm v10.7.0 or higher
- PostgreSQL database (or Docker to run one)
- Git for version control
- Docker and Docker Compose (optional, but recommended)
Quick Start (Recommended)
The fastest way to get started is using the developer quickstart, which uses Docker Compose to set up all dependencies.Fork and clone the repository
Set up environment variables
Copy the example environment file:The default values in
.env.example are configured to work with the Docker Compose setup out of the box.Run the developer quickstart
The quickest way to get everything running:This single command:
- Installs all dependencies
- Starts PostgreSQL, MinIO (S3), and Inbucket (email) in Docker
- Runs database migrations
- Seeds the database with test data
- Compiles translations
- Starts the development server
Access the application
Once everything is running, you can access:
- Application: http://localhost:3000
- Email Inbox (Inbucket): http://localhost:9000
- S3 Dashboard (MinIO): http://localhost:9001
- Database: localhost:54320 (postgres://documenso:password@localhost:54320/documenso)
Create your account
Navigate to http://localhost:3000/signup and register a new user account to get started.
Manual Setup
If you prefer to set up services manually without Docker:Configure environment variables
Create a Update the following required variables:
.env file from the example:Set up the database
Start the development server
Development Workflow
Available Scripts
The following npm scripts are available for development:Project Structure
Documenso is organized as a monorepo:Environment Variables
Key environment variables you’ll work with:Required Variables
| Variable | Description | Example |
|---|---|---|
NEXTAUTH_SECRET | Secret for NextAuth.js session encryption | your-random-secret |
NEXT_PUBLIC_WEBAPP_URL | Public URL of your application | http://localhost:3000 |
NEXT_PRIVATE_DATABASE_URL | PostgreSQL connection string | postgres://user:pass@localhost:5432/db |
NEXT_PRIVATE_DIRECT_DATABASE_URL | Direct database connection (non-pooled) | Same as above for local dev |
NEXT_PRIVATE_SMTP_FROM_NAME | Email sender name | Documenso |
NEXT_PRIVATE_SMTP_FROM_ADDRESS | Email sender address | noreply@documenso.com |
NEXT_PRIVATE_ENCRYPTION_KEY | 32+ character encryption key | Random string |
NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY | 32+ character secondary key | Random string |
Development Services (with Docker Compose)
| Variable | Default | Description |
|---|---|---|
NEXT_PRIVATE_SMTP_HOST | 127.0.0.1 | SMTP server (Inbucket) |
NEXT_PRIVATE_SMTP_PORT | 2500 | SMTP port |
NEXT_PRIVATE_UPLOAD_ENDPOINT | http://127.0.0.1:9002 | MinIO S3 endpoint |
NEXT_PRIVATE_UPLOAD_BUCKET | documenso | S3 bucket name |
NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID | documenso | MinIO access key |
NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY | password | MinIO secret key |
Optional Features
| Variable | Description |
|---|---|
NEXT_PRIVATE_GOOGLE_CLIENT_ID | Google OAuth client ID |
NEXT_PRIVATE_GOOGLE_CLIENT_SECRET | Google OAuth client secret |
NEXT_PRIVATE_MICROSOFT_CLIENT_ID | Microsoft OAuth client ID |
NEXT_PRIVATE_MICROSOFT_CLIENT_SECRET | Microsoft OAuth client secret |
NEXT_PRIVATE_STRIPE_API_KEY | Stripe API key for billing |
GOOGLE_VERTEX_API_KEY | Google Vertex AI API key for AI features |
Using Environment Variables in Scripts
If you need to run a script with environment variables loaded, use thewith:env wrapper:
.env and .env.local files.
Common Issues
Not Receiving Emails
When using the Docker quickstart, emails are captured by Inbucket instead of being sent. Access the web UI at http://localhost:9000 to view all outgoing emails.Environment Variables Not Loading
If you’re running package scripts directly, wrap them withwith:env:
Port Already in Use
If port 3000 is already in use, you can change it by setting thePORT environment variable:
.env file:
Database Connection Issues
If you’re having trouble connecting to the database:- Ensure PostgreSQL is running (check Docker with
docker psif using Docker Compose) - Verify the connection string in
NEXT_PRIVATE_DATABASE_URL - Check that the database exists
- Ensure the database port (default 54320 for Docker) is not blocked
Next Steps
- Using Docker for Development - Detailed Docker setup guide
- Database Setup and Migrations - Learn about Prisma and migrations
- Running Tests - Test strategy and execution
- Contributing Guide - Guidelines for contributors
Video Tutorial
Prefer a video walkthrough? Check out this setup guide:
