Deploy with Docker Compose

The whole platform on one machine, for evaluation and development: the server, the worker, the key daemon, the Word conversion daemon (convertd, which the server reaches through OPENSEAL_CONVERTD_SOCKET), PostgreSQL, an object store, a development timestamp authority and a mail catcher. About ten minutes, most of it the first image build.

Evaluation only. This stack generates its own certificate authority and seal key on first start, keeps the key in a software HSM, uses a development timestamp authority and sends cookies over plain HTTP. Its seals validate only against the generated root, not in Adobe Acrobat. For anything that others rely on, follow Production deployment.

Prerequisites

  • Docker with Compose v2: Docker Desktop, or Docker Engine with the compose plugin. Check with docker compose version.
  • A few gigabytes of free memory for Docker and of free disk for the images and volumes.
  • Git, to fetch the Compose file and its helper files.
  • Ports 8080 (the web app and API) and 8025 (Mailpit) free on 127.0.0.1. Both can be moved.

Steps

  1. Get the files

    The Compose file builds from, and mounts helper files of, the repository. Check out the release you want to evaluate:

    git clone https://github.com/CasualOffice/openseal
    cd openseal
    git checkout v0.1.0
  2. Start the stack

    Either build the images from this checkout:

    docker compose up -d --build --wait

    or pull the release's published images instead of building:

    export OPENSEAL_IMAGE_PREFIX=ghcr.io/casualoffice/openseal OPENSEAL_VERSION=0.1.0
    docker compose pull
    docker compose up -d --wait

    --wait returns once every service reports healthy. On the first start the one-shot pki service writes a development CA, the TLS certificates between services, the seal key and certificate, a timestamp certificate, the API token key and random passwords into the secrets volume, which every other service mounts read-only. Then migrate applies the database migrations and exits, and the server starts.

  3. Create the first administrator

    An install starts empty. bootstrap creates the first organization and workspace, the built-in permission profiles and the first administrator, and prints their ids. It works once: it is refused as soon as an organization exists.

    docker compose exec -e OPENSEAL_ADMIN_PASSWORD='a long passphrase of your own' server \
        casual-sign-server bootstrap "Example Workspace" [email protected] "Example Admin"

    The password must be 12 to 256 characters. Administrators owe a second factor by default, so at the first sign-in the web app asks you to enrol an authenticator app.

  4. Sign in and send a test envelope

    Open http://localhost:8080, sign in as [email protected], and send yourself a PDF (Sending your first envelope walks through it). Every email the stack sends, including signing invitations, lands in Mailpit at http://localhost:8025.

Check that it works

Every long-running service should be running and healthy; pki and migrate have exited (0):

docker compose ps

The server answers its public keys (this is also its health check):

curl -fsS http://localhost:8080/.well-known/jwks.json

The worker has started and reached keyd (look for "event":"config" lines and no start_failed):

docker compose logs worker | tail -n 20

End to end: send an envelope to an address of your choosing, sign it through the link in Mailpit, and the envelope reaches Completed with a sealed PDF and a certificate of completion. A sealed PDF from this stack validates against the stack's own root:

docker compose exec keyd cat /secrets/ca.pem > openseal-dev-root.pem

Drop the sealed PDF on the Verify page and add openseal-dev-root.pem as a trusted certificate.

Options

ToDo
Move the web app's portOPENSEAL_HTTP_PORT=8443 docker compose up -d --wait
Move Mailpit's portOPENSEAL_MAIL_PORT=8026 docker compose up -d --wait
Scan uploads for malwareOPENSEAL_CLAMD_ADDR=clamav:3310 docker compose --profile production up -d --build --wait (ClamAV needs about 1 GB of memory and outbound HTTPS for its signatures)
Embed signing in a page of your ownAdd the page's origin under Admin, Organization, Embedding, for example http://localhost:3000 (plain http is accepted only for loopback and intranet hosts); see Embedding origins
Follow what it doesdocker compose logs -f server worker; every line is one JSON object
Ship logs to a collectorAdd -f deploy/compose.log-forwarding.yml (syslog over mutual TLS); see Monitoring

Ports bind to 127.0.0.1 only. To reach the stack from another machine, put a TLS proxy in front of it, and read Production deployment first.

Stop, restart and remove

docker compose stop            # stop; data, keys and mail are kept
docker compose up -d --wait    # start again
docker compose down            # remove the containers; volumes are kept
docker compose down -v         # remove everything, including every volume: data, keys and mail

down -v deletes the database, the documents and the generated keys. A new start generates a new CA and seal key, so PDFs sealed before no longer chain to the new root (they still verify against the old one if you kept it).

Next