

Documenso
6.0k 741What is Documenso
Documenso is the Open Source DocuSign Alternative.
Signing documents digitally should be fast and easy and should be the best practice for every document signed worldwide.
This is technically quite easy today, but it also introduces a new party to every signature: The signing tool providers. While this is not a problem in itself, it should make us think about how we want these providers of trust to work.
Documenso aims to be the world’s most trusted document-signing tool. This trust is built by empowering you to self-host Documenso and review how it works under the hood.
Join us in creating the next generation of open trust infrastructure.
Local Development
Requirements
To run Documenso locally, you will need
- Node.js
- Postgres SQL Database
- Docker (optional)
Developer Quickstart
Note: This is a quickstart for developers. It assumes that you have both docker and docker-compose installed on your machine.
Want to get up and running quickly? Follow these steps:
- Fork this repository to your GitHub account.
After forking the repository, clone it to your local device by using the following command:
git clone https://github.com/<your-username>/documenso
-
Set up your
.env
file using the recommendations in the.env.example
file. Alternatively, just runcp .env.example .env
to get started with our handpicked defaults. -
Run
npm run dx
in the root directory- This will spin up a postgres database and inbucket mailserver in a docker container.
-
Run
npm run dev
in the root directory -
Want it even faster? Just use
npm run d
Access Points for Your Application
-
App - http://localhost:3000
-
Incoming Mail Access - http://localhost:9000
-
Database Connection Details
- Port: 54320
- Connection: Use your favorite database client to connect using the provided port.
-
S3 Storage Dashboard - http://localhost:9001
Developer Setup
Manual Setup
Follow these steps to setup Documenso on your local machine:
- Fork this repository to your GitHub account.
After forking the repository, clone it to your local device by using the following command:
git clone https://github.com/<your-username>/documenso
-
Run
npm i
in the root directory -
Create your
.env
from the.env.example
. You can usecp .env.example .env
to get started with our handpicked defaults. -
Set the following environment variables:
- NEXTAUTH_URL
- NEXTAUTH_SECRET
- NEXT_PUBLIC_WEBAPP_URL
- NEXT_PUBLIC_MARKETING_URL
- NEXT_PRIVATE_DATABASE_URL
- NEXT_PRIVATE_DIRECT_DATABASE_URL
- NEXT_PRIVATE_SMTP_FROM_NAME
- NEXT_PRIVATE_SMTP_FROM_ADDRESS
-
Create the database schema by running
npm run prisma:migrate-dev
-
Run
npm run dev
in the root directory to start -
Register a new user at http://localhost:3000/signup
- Optional: Seed the database using
npm run prisma:seed -w @documenso/prisma
to create a test user and document. - Optional: Create your own signing certificate.
- To generate your own using these steps and a Linux Terminal or Windows Subsystem for Linux (WSL), see Create your own signing certificate.
Run in Gitpod
- Click below to launch a ready-to-use Gitpod workspace in your browser.
Run in DevContainer
We support DevContainers for VSCode. Click here to get started.
Video walkthrough
If you’re a visual learner and prefer to watch a video walkthrough of setting up Documenso locally, check out this video:
Docker
🚧 Docker containers and images are current in progress. We are actively working on bringing a simple Docker build and publish pipeline for Documenso.
Self Hosting
We support a variety of deployment methods, and are actively working on adding more. Stay tuned for updates!
Please note that the below deployment methods are for v0.9, we will update these to v1.0 once it has been released.
Fetch, configure, and build
First, clone the code from Github:
git clone https://github.com/documenso/documenso.git
Then, inside the documenso
folder, copy the example env file:
cp .env.example .env
The following environment variables must be set:
NEXTAUTH_URL
NEXTAUTH_SECRET
NEXT_PUBLIC_WEBAPP_URL
NEXT_PUBLIC_MARKETING_URL
NEXT_PRIVATE_DATABASE_URL
NEXT_PRIVATE_DIRECT_DATABASE_URL
NEXT_PRIVATE_SMTP_FROM_NAME
NEXT_PRIVATE_SMTP_FROM_ADDRESS
If you are using a reverse proxy in front of Documenso, don’t forget to provide the public URL for both
NEXTAUTH_URL
andNEXT_PUBLIC_WEBAPP_URL
variables!
Now you can install the dependencies and build it:
npm inpm run build:webnpm run prisma:migrate-deploy
Finally, you can start it with:
npm run start
This will start the server on localhost:3000
. For now, any reverse proxy can then do the frontend and SSL termination.
If you want to run with another port than 3000, you can start the application with
next -p <ANY PORT>
from theapps/web
folder.
Run as a service
You can use a systemd service file to run the app. Here is a simple example of the service running on port 3500 (using 3000 by default):
[Unit]Description=documensoAfter=network.target
[Service]Environment=PATH=/path/to/your/node/binariesType=simpleUser=www-dataWorkingDirectory=/var/www/documenso/apps/webExecStart=/usr/bin/next start -p 3500TimeoutSec=15Restart=always
[Install]WantedBy=multi-user.target
Railway
Render
Koyeb
Troubleshooting
I’m not receiving any emails when using the developer quickstart.
When using the developer quickstart, an Inbucket server will be spun up in a docker container that will store all outgoing emails locally for you to view.
The Web UI can be found at http://localhost:9000, while the SMTP port will be on localhost:2500.
Support IPv6
If you are deploying to a cluster that uses only IPv6, You can use a custom command to pass a parameter to the Next.js start command
For local docker run
docker run -it documenso:latest npm run start -- -H ::
For k8s or docker-compose
containers: - name: documenso image: documenso:latest imagePullPolicy: IfNotPresent command: - npm args: - run - start - -- - -H - '::'
I can’t see environment variables in my package scripts.
Wrap your package script with the with:env
script like such:
npm run with:env -- npm run myscript
The same can be done when using npx
for one of the bin scripts:
npm run with:env -- npx myscript
This will load environment variables from your .env
and .env.local
files.