
DocuSeal is an open-source document signing platform that converts PDF files into fillable forms and collects legally binding electronic signatures. It provides a drag-and-drop field builder, multi-party signing with preserved signing order, an audit log for every signing event, and an HTTP API to automate requests. Completed documents are signed with a cryptographic certificate that DocuSeal generates during initial setup, so each finished PDF contains a Public Key Cryptography Standards #7 (PKCS#7) signature.
This article explains how to deploy DocuSeal on a Linux-based server using Docker Compose. It covers the directory and environment setup, deployment of DocuSeal with a PostgreSQL database behind a Traefik reverse proxy with automatic TLS certificates, completion of the initial setup wizard, creation of a signing template, and retrieval of the signed document together with its audit log.
Before you begin:
sign.example.com, to the server's IP address using an A record.This deployment keeps server-specific values, such as the domain and generated secrets, in an .env file. Docker Compose reads that file from the project directory and substitutes each variable reference in the Compose file.
Create the project directory.
Switch to the project directory.
Generate a database password and a secret key, and write both to the environment file.
DocuSeal uses SECRET_KEY_BASE to encrypt stored credentials and sign session cookies. Generate the value once and keep it unchanged, because a new key makes previously encrypted values unreadable.
Open the environment file to add the remaining variables.
Add the following variables below the two generated values:
Replace:
sign.example.com in DOCUSEAL_HOST: The domain name that resolves to your server. Traefik matches incoming requests against this value.https://sign.example.com in APP_URL: The full external URL, including the https:// scheme. DocuSeal builds signing links from this value.ADMIN_EMAIL: An email address on a domain that you control, which Traefik registers as the Let's Encrypt account contact. Let's Encrypt rejects addresses on reserved domains such as example.com.Save and close the file.
Restrict the environment file so that only its owner can read it.
DocuSeal serves plain HTTP on port 3000, so this deployment places Traefik in front of it. Traefik accepts external traffic on ports 80 and 443, requests a Let's Encrypt certificate through the TLS-ALPN challenge, and forwards decrypted requests to DocuSeal. PostgreSQL stores templates, submissions, and signing events, and named volumes keep the database and uploaded files when the containers are recreated.
Add your user to the docker group so that you can run docker commands without sudo.
Apply the group change to your SSH session.
Create the Compose file.
Add the following configuration:
Save and close the file.
In this configuration:
DATABASE_URL: Directs DocuSeal to PostgreSQL. Without this variable, DocuSeal uses an SQLite database inside the container.FORCE_SSL: Makes DocuSeal issue secure cookies and redirect plain HTTP requests to HTTPS.APP_URL: Sets the base URL for signing links.docuseal-data: Stores uploaded documents, generated PDFs, and audit logs. Deleting this volume destroys the signed documents.docuseal-postgres:/var/lib/postgresql: Mounts the database volume at the parent of the version-specific data directory that PostgreSQL 18 images use.depends_on with service_healthy: Delays the DocuSeal container until PostgreSQL accepts connections, which prevents a failed migration on first boot.exposedbydefault=false: Instructs Traefik to route only containers that explicitly set traefik.enable=true./var/run/docker.sock: Gives Traefik access to the Docker API, which it uses to read the container labels that define its routes. The Traefik documentation describes unrestricted access to the Docker API as a security concern../letsencrypt: Stores the issued certificate on the host so that it persists when the Traefik container is recreated.Start the stack in detached mode.
Check the status of the containers.
The output displays three running containers, with PostgreSQL reporting a healthy status and Traefik listening on ports 80 and 443.
Send a request to the DocuSeal address to test the certificate and routing. Traefik requests the certificate when the containers start, so the command can fail with a certificate error until issuance finishes, usually within a minute. Replace sign.example.com with your configured domain name.
The response returns an HTTP 302 status that redirects to /setup. The redirect continues until you complete the setup wizard. A certificate error indicates that DOCUSEAL_HOST does not match the domain in the request or that ACME_EMAIL is not a valid address. A connection failure indicates that the domain does not resolve to the server or that inbound traffic on port 443 is blocked.
A new installation exposes a setup wizard that creates the first administrator and records the application URL. The wizard also generates the certificate authority that DocuSeal uses to sign completed PDFs. The instance remains unusable until the wizard finishes, and the dashboard redirects to /setup.
Open https://sign.example.com in a web browser, and replace sign.example.com with your configured domain name.
Complete the setup form:
https://sign.example.com. DocuSeal validates this field as a URL and stores it as the base address for every signing link that it generates.Click Submit. DocuSeal creates the account, generates the signing certificate, and signs you in.
On the Developer Newsletters screen, click Skip.
The signing workflow runs under the administrator account created by the setup wizard.
A template pairs an uploaded document with the fields that each party completes. DocuSeal stores the field coordinates in the template, so you can reuse the same template for each signature request. Template creation happens in the web interface, because the API endpoints that create templates from PDF, DOCX, and HTML files are Pro features.
On the dashboard, click Upload, and select a PDF file from your local machine.
Drag a Signature field onto the location where the signer signs.
Drag a Date field onto the location that records the signing date. DocuSeal marks new fields as required by default, so it rejects a submission that leaves either field empty.
Triple-click the party name in the party selector, which is First Party by default, enter a descriptive value such as Client, and press Enter. The role value in the API request refers to this party name.
Click Save and verify that DocuSeal opens the template page.
A submission instantiates a template for one signing session and creates a submitter for each party. DocuSeal gives every submitter a unique signing link and tracks whether they opened and completed the document.
Open Settings and select API.
In the X-Auth-Token section, click Copy.
In the Reveal API Key dialog, enter your account password and click Submit.
Click Copy again to copy the revealed key.
Retrieve the template identifier. Replace sign.example.com with your configured domain name and DOCUSEAL_API_KEY with the key that you copied.
The output resembles the following:
Record the id value, because the next step uses it to identify the template.
Create the signature request. Replace TEMPLATE_ID with the id value from the previous step, signer@example.com with the recipient's email address, and SIGNER_NAME with the recipient's name.
The output resembles the following:
The response returns the submitter with a status of awaiting and an embed_src value that holds the signing link. The request sets send_email to false, so DocuSeal sends no email and you share the embed_src link with the signer. Record the submission_id value from the response for use in the following instructions to query the submission.
Open the embed_src URL from the previous response in a web browser.
Click Sign Now.
Draw your signature, or click Type and enter your name, and click Next.
Click Set Today and click Complete.
Retrieve the submission status. Replace sign.example.com with your configured domain name and SUBMISSION_ID with the submission_id value that you recorded from the signature request.
The submitter status field changes from awaiting to opened when the signer opens the link, and to completed after they submit the signature. The submission status becomes completed after every submitter finishes.
After the last submitter completes a submission, DocuSeal flattens the entered values into the PDF and applies a PKCS#7 signature using the certificate generated during setup. DocuSeal generates this certificate itself, and you can upload your own signing certificate if your organization requires one. DocuSeal also produces a separate audit log that lists each signing event with its timestamp and records each signer's IP address and user agent.
Retrieve the signed document URL. Replace sign.example.com with your configured domain name and SUBMISSION_ID with the identifier of the completed submission.
The response returns a documents array in which each entry holds the document name and a signed url.
Download the signed PDF using the URL from the response. Replace SIGNED_DOCUMENT_URL with the url value from the previous response.
In DocuSeal 3.4.0, the URL expires 40 minutes after the request. Run the previous command again to get a new URL if the download fails.
Check the downloaded file for a digital signature.
The output displays adbe.pkcs7.detached, the name of the detached PKCS#7 signature format that DocuSeal embeds.
Download the audit log. Replace AUDIT_LOG_URL with the audit_log_url value from the submission status response.
The audit log lists each submitter with their IP address, browser user agent, and session ID. Its event log records a timestamp each time the submitter views, starts, or completes the form.
You have successfully deployed DocuSeal on a Linux-based server with Docker Compose, stored its data in PostgreSQL, and secured the endpoint with automatic TLS certificates through Traefik. The instance now builds signing templates from uploaded PDFs, generates signing links for signers, and produces cryptographically signed documents alongside an audit log of every signing event. For more information, see the official DocuSeal documentation.
0 Comments
Be the first to comment and share your perspective with the community.