---
title: How to Deploy DocuSeal - Open-Source Document Signing Platform
url: https://docs.vultr.com/how-to-deploy-docuseal-open-source-document-signing-platform
description: Deploy DocuSeal with Docker Compose, PostgreSQL, and Traefik TLS on a Linux server, then build a signing template and download signed PDFs with audit logs.
publish_date: 2026-12-01T16:16:28.456647Z
last_updated: 2026-12-01T16:29:38.967098Z
author: Zulkarnain Chauhan
header_image: https://lhr1.vultrobjects.com/docs-main-doc-assets-1/2691/50679678-84ed-4827-924d-7d30374feb5a.png
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

[DocuSeal](https://www.docuseal.com/) 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](https://traefik.io/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.

## Prerequisites

Before you begin:

* Have access to a [Linux-based server](https://www.vultr.com/features/operating-systems/) as a [non-root user with sudo privileges](https://docs.vultr.com/how-to-create-a-sudo-user-in-linux).
* [Install Docker and Docker Compose](https://docs.vultr.com/how-to-install-docker-on-ubuntu-24-04#install-docker).
* Point a domain name, such as `sign.example.com`, to the server's IP address using an `A` record.

## Set Up the Directory Structure and Environment Variables

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.

1. Create the project directory.

    ```console
    $ mkdir ~/docuseal
    ```

1. Switch to the project directory.

    ```console
    $ cd ~/docuseal
    ```

1. Generate a database password and a secret key, and write both to the environment file.

    ```console
    $ printf 'POSTGRES_PASSWORD=%s\nSECRET_KEY_BASE=%s\n' "$(openssl rand -hex 16)" "$(openssl rand -hex 64)" > .env
    ```

    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.

1. Open the environment file to add the remaining variables.

    ```console
    $ nano .env
    ```

1. Add the following variables below the two generated values:

    ```ini
    DOCUSEAL_HOST=sign.example.com
    APP_URL=https://sign.example.com
    ACME_EMAIL=ADMIN_EMAIL
    POSTGRES_USER=docuseal
    POSTGRES_DB=docuseal
    ```

    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.

1. Restrict the environment file so that only its owner can read it.

    ```console
    $ chmod 600 .env
    ```

## Deploy DocuSeal with Docker Compose

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.

1. Add your user to the `docker` group so that you can run `docker` commands without `sudo`.

    ```console
    $ sudo usermod -aG docker $USER
    ```

1. Apply the group change to your SSH session.

    ```console
    $ newgrp docker
    ```

1. Create the Compose file.

    ```console
    $ nano docker-compose.yml
    ```

1. Add the following configuration:

    ```yaml
    services:
      docuseal:
        image: docuseal/docuseal:3.4.0
        container_name: docuseal
        restart: unless-stopped
        depends_on:
          postgres:
            condition: service_healthy
        environment:
          DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
          SECRET_KEY_BASE: ${SECRET_KEY_BASE}
          FORCE_SSL: ${DOCUSEAL_HOST}
          APP_URL: ${APP_URL}
        volumes:
          - docuseal-data:/data
        networks:
          - docuseal-network
        labels:
          - "traefik.enable=true"
          - "traefik.http.routers.docuseal.rule=Host(`${DOCUSEAL_HOST}`)"
          - "traefik.http.routers.docuseal.entrypoints=websecure"
          - "traefik.http.routers.docuseal.tls.certresolver=letsencrypt"
          - "traefik.http.services.docuseal.loadbalancer.server.port=3000"

      postgres:
        image: postgres:18
        container_name: docuseal-postgres
        restart: unless-stopped
        environment:
          POSTGRES_USER: ${POSTGRES_USER}
          POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
          POSTGRES_DB: ${POSTGRES_DB}
        healthcheck:
          test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
          interval: 5s
          timeout: 5s
          retries: 10
        volumes:
          - docuseal-postgres:/var/lib/postgresql
        networks:
          - docuseal-network

      traefik:
        image: traefik:v3.7.20
        container_name: traefik
        restart: unless-stopped
        command:
          - "--providers.docker=true"
          - "--providers.docker.exposedbydefault=false"
          - "--entrypoints.web.address=:80"
          - "--entrypoints.web.http.redirections.entrypoint.to=websecure"
          - "--entrypoints.web.http.redirections.entrypoint.scheme=https"
          - "--entrypoints.websecure.address=:443"
          - "--certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}"
          - "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
          - "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
        ports:
          - "80:80"
          - "443:443"
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock:ro
          - ./letsencrypt:/letsencrypt
        networks:
          - docuseal-network

    volumes:
      docuseal-data:
      docuseal-postgres:

    networks:
      docuseal-network:
        driver: bridge
    ```

    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.

1. Start the stack in detached mode.

    ```console
    $ docker compose up -d
    ```

1. Check the status of the containers.

    ```console
    $ docker compose ps
    ```

    The output displays three running containers, with PostgreSQL reporting a `healthy` status and Traefik listening on ports 80 and 443.

1. 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.

    ```console
    $ curl -I https://sign.example.com/
    ```

    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.

## Access and Configure DocuSeal

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`.

1. Open `https://sign.example.com` in a web browser, and replace `sign.example.com` with your configured domain name.

1. Complete the setup form:

    * **First name** and **Last name**: The administrator name.
    * **Email**: The administrator account email address.
    * **Company name**: The organization name shown to signers.
    * **Password**: The administrator account password.
    * **App URL**: The full external URL of the instance. DocuSeal pre-fills this field from the address in your browser, so verify that it reads `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.
    * **Language**: The interface language.

1. Click **Submit**. DocuSeal creates the account, generates the signing certificate, and signs you in.

1. On the **Developer Newsletters** screen, click **Skip**.

## Test the Signing Workflow

The signing workflow runs under the administrator account created by the setup wizard.

### Create a Signing Template

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.

1. On the dashboard, click **Upload**, and select a PDF file from your local machine.

1. Drag a **Signature** field onto the location where the signer signs.

1. 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.

1. Triple-click the party name in the party selector, which is **First Party** by default, enter a descriptive value such as `Client`, and press :key_enter:. The `role` value in the API request refers to this party name.

1. Click **Save** and verify that DocuSeal opens the template page.

### Create and Complete a Signature Request

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.

1. Open **Settings** and select **API**.

1. In the **X-Auth-Token** section, click **Copy**.

1. In the **Reveal API Key** dialog, enter your account password and click **Submit**.

1. Click **Copy** again to copy the revealed key.

1. Retrieve the template identifier. Replace `sign.example.com` with your configured domain name and `DOCUSEAL_API_KEY` with the key that you copied.

    ```console
    $ curl -s https://sign.example.com/api/templates \
        -H "X-Auth-Token: DOCUSEAL_API_KEY"
    ```

    The output resembles the following:

    ```
    {
      "data": [
        {
          "id": 1,
          "slug": "JwXGhZt6QMbGR6",
          "name": "Service Agreement",
          "fields": [
            { "name": "", "type": "signature", "required": true, ... },
            { "name": "", "type": "date", "required": true, ... }
          ],
          "submitters": [ { "name": "Client", ... } ],
          ...
        }
      ],
      "pagination": { "count": 1, ... }
    }
    ```

    Record the `id` value, because the next step uses it to identify the template.

1. 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.

    ```console
    $ curl -s -X POST https://sign.example.com/api/submissions \
        -H "X-Auth-Token: DOCUSEAL_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{"template_id": TEMPLATE_ID, "send_email": false, "submitters": [{"role": "Client", "email": "signer@example.com", "name": "SIGNER_NAME"}]}'
    ```

    The output resembles the following:

    ```
    [
      {
        "id": 1,
        "slug": "gKMqYf67Chfuur",
        "name": "Example Signer",
        "email": "signer@example.com",
        "submission_id": 1,
        "sent_at": null,
        "completed_at": null,
        "status": "awaiting",
        "role": "Client",
        "embed_src": "https://sign.example.com/s/gKMqYf67Chfuur",
        ...
      }
    ]
    ```

    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.

1. Open the `embed_src` URL from the previous response in a web browser.

1. Click **Sign Now**.

1. Draw your signature, or click **Type** and enter your name, and click **Next**.

1. Click **Set Today** and click **Complete**.

1. 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.

    ```console
    $ curl -s https://sign.example.com/api/submissions/SUBMISSION_ID \
        -H "X-Auth-Token: DOCUSEAL_API_KEY"
    ```

    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.

### Download the Signed Document and Audit Log

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](https://www.docuseal.com/resources/add-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.

1. Retrieve the signed document URL. Replace `sign.example.com` with your configured domain name and `SUBMISSION_ID` with the identifier of the completed submission.

    ```console
    $ curl -s https://sign.example.com/api/submissions/SUBMISSION_ID/documents \
        -H "X-Auth-Token: DOCUSEAL_API_KEY"
    ```

    The response returns a `documents` array in which each entry holds the document `name` and a signed `url`.

1. Download the signed PDF using the URL from the response. Replace `SIGNED_DOCUMENT_URL` with the `url` value from the previous response.

    ```console
    $ curl -L -o signed-agreement.pdf "SIGNED_DOCUMENT_URL"
    ```

    > [!NOTE]
    > 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.

1. Check the downloaded file for a digital signature.

    ```console
    $ grep -a -o 'adbe.pkcs7.detached' signed-agreement.pdf
    ```

    The output displays `adbe.pkcs7.detached`, the name of the detached PKCS#7 signature format that DocuSeal embeds.

1. Download the audit log. Replace `AUDIT_LOG_URL` with the `audit_log_url` value from the submission status response.

    ```console
    $ curl -L -o audit-log.pdf "AUDIT_LOG_URL"
    ```

    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.

## Conclusion

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](https://www.docuseal.com/docs).