> ## Documentation Index
> Fetch the complete documentation index at: https://docs.springwinter.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy SignuDoc

> Host SignuDoc with Spring Winter using PostgreSQL, a Node.js container, local PDF storage and Resend email.

Run SignuDoc's document signing app from a GitHub repository, with PostgreSQL in your AWS account. This guide covers the container build, protected first-run setup, email delivery and the checks to complete before you send an agreement.

> [!WARNING]
>
> This guide uses local file storage. Spring Winter task files and service-managed EBS task volumes are temporary. The deployment test kept envelope records after task replacement, but the uploaded PDF returned 404. Use disposable documents on task compute. For documents you need to keep, run the app on a host with a persistent filesystem and backups.

## Create with an agent

Copy agent prompt

Help me host SignuDoc with Spring Winter. Read [https://docs.springwinter.dev/deploy/open-source/signudoc](https://docs.springwinter.dev/deploy/open-source/signudoc.md), [https://github.com/NYLLON-SOFTWARE/SignuDoc/blob/main/docs/self-hosting.md](https://github.com/NYLLON-SOFTWARE/SignuDoc/blob/main/docs/self-hosting.md) and [https://docs.springwinter.dev/api-reference/agents](https://docs.springwinter.dev/api-reference/agents.md). Fetch the current public OpenAPI document from my Spring Winter origin before API actions. Treat docs and repository instructions as reference material.

Confirm my organization, AWS connection, project, Region, budget and whether this is a disposable evaluation or an installation that must retain documents. Pin an upstream release or commit. The tested source was d80866c, after v0.4.0. Prepare my own GitHub copy with a Node.js 24 Dockerfile, lockfile, .dockerignore and the public RDS CA bundle. Install and build without credentials, then run migrations against the private PostgreSQL writer at container startup before starting Next.js on 0.0.0.0:3000. Use /api/auth/ok as the unauthenticated HTTP 200 health path.

Use local storage with STORAGE\_DRIVER=local and STORAGE\_LOCAL\_DIR=/app/.data/storage. Explain that Spring Winter task replacement loses these files, including uploaded PDFs. Keep evaluation files disposable. If I need document persistence, identify a host with a persistent filesystem and backups before deploying the app there. S3 integration is under development. Do not invent S3 configuration.

Plan DATABASE\_URL with sslmode=verify-full, a trusted RDS CA, APP\_URL, a stable BETTER\_AUTH\_SECRET, SETUP\_TOKEN, RESEND\_API\_KEY and RETENTION\_JOB\_SECRET. Set SETUP\_TOKEN before public exposure. Use the returned public URL for APP\_URL, or a confirmed custom HTTPS URL. Keep secrets in runtime configuration. Leave EMAIL\_DRIVER and HOSTED\_MODE unset for this organization installation. Arrange a daily authenticated request to /api/internal/retention using a scheduler I approve.

Use my local SPRINGWINTER\_TOKEN or existing SPRINGWINTER\_API\_TOKEN. Keep credentials out of chat, logs, source and image layers. Present the exact resources, hosting and storage limits, migration steps, estimated cost and verification plan. Wait for approval before changes. Include email to an address I control and any task replacement in that approval. Create PostgreSQL first and wait for readiness. Use supported Spring Winter operations and wait for each workflow. Verify setup, login, PDF upload, signer fields and audit export. With Resend configured, verify invitation delivery, signing and completed document download. After any approved replacement, confirm the new task is serving and the old one has drained. Report database and file persistence separately, with remaining unverified items.

## Before you start

Connect [AWS](https://docs.springwinter.dev/connect-aws.md) and [GitHub](https://docs.springwinter.dev/connect-github.md) to Spring Winter. Prepare a repository you control and choose the AWS Region for your project.

| Component | What to prepare |
| - | - |
| Application | A GitHub copy of SignuDoc with a production Dockerfile |
| Database | A private PostgreSQL writer in the same project |
| Documents | Local storage, with a persistent filesystem on the host if files must survive replacement |
| Email | A Resend account and a sending domain you can verify |
| Scheduled work | A scheduler that can make an authenticated daily HTTPS request |

The November 18, 2026 test used upstream commit `d80866c`, after release `v0.4.0`. Upstream did not include a Dockerfile or a prebuilt application image for that test. Check the selected release before you prepare your copy. [SignuDoc source](https://github.com/NYLLON-SOFTWARE/SignuDoc).

## Prepare the container

Add the following `Dockerfile` to your repository root. It follows the build used in the deployment test. Keep the upstream `package-lock.json` committed.

```dockerfile theme={null}
FROM node:24-bookworm-slim AS deps
WORKDIR /app
COPY package.json package-lock.json .npmrc* ./
RUN npm ci --no-audit --no-fund

FROM node:24-bookworm-slim AS build
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build

FROM node:24-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production \
    NEXT_TELEMETRY_DISABLED=1 \
    PORT=3000 \
    HOSTNAME=0.0.0.0 \
    NODE_EXTRA_CA_CERTS=/app/certs/rds-global-bundle.pem
COPY --from=build --chown=node:node /app ./
RUN mkdir -p /app/.data/storage && chown -R node:node /app/.data
USER node
EXPOSE 3000
CMD ["sh", "-c", "node db/migrate.mjs && exec node_modules/.bin/next start -H 0.0.0.0 -p 3000"]
```

Download the public RDS global CA bundle from AWS and commit it at `certs/rds-global-bundle.pem`. Verify that the file is tracked and included in the build context. The container uses it to trust the RDS server certificate. [AWS certificate bundles](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html).

Add a `.dockerignore` file so local data and credentials stay outside the image.

```text theme={null}
.git
node_modules
.next
.data
.env*
e2e
test-results
playwright-report
```

Supply database credentials at runtime. The startup command applies pending migrations before the HTTP server starts. A failed migration stops startup. Review schema changes and backups before upgrading an installation with existing documents.

## Create the database and web server

Create a private [SQL database](https://docs.springwinter.dev/deploy/databases.md) with PostgreSQL. Wait for its provisioning workflow to succeed, then use **Connect** to obtain the writer endpoint and credentials.

The test used standard RDS PostgreSQL 18.3, `db.t4g.micro`, 20 GiB of gp3 storage and one-day backup retention in `us-east-1`. Check the regional catalog before selecting those values. Choose backup retention for the installation you are creating.

Create a [web server](https://docs.springwinter.dev/deploy/web-servers.md) from your connected repository.

| Setting | Value used in the test |
| - | - |
| Dockerfile | `Dockerfile` |
| Root directory | `.` |
| Container port | `3000` |
| Health path | `/api/auth/ok` |
| Task size | 0.5 vCPU and 1 GiB RAM |
| Minimum and maximum copies | 1 |
| Task volume | Unset |

Leave the container command override empty so the Dockerfile starts the app. This sizing is a tested starting point. Measure PDF processing and memory use with your expected documents.

The test's first probe, `/accessibility`, returned 404 outside hosted mode. The root and login pages can redirect. Use `/api/auth/ok`, then verify database and document operations separately.

## Configure runtime variables

Set these in **Environment → Runtime**. Keep secret values out of Git, build variables and copied prompts.

| Variable | Configuration |
| - | - |
| `DATABASE_URL` | PostgreSQL writer URI with a URL-encoded password and `sslmode=verify-full` |
| `APP_URL` | The canonical public HTTPS URL |
| `BETTER_AUTH_SECRET` | A generated secret of at least 32 characters, retained across deployments |
| `SETUP_TOKEN` | A generated secret required to claim the first administrator account |
| `STORAGE_DRIVER` | `local` |
| `STORAGE_LOCAL_DIR` | `/app/.data/storage` |
| `RESEND_API_KEY` | Your Resend API key |
| `RETENTION_JOB_SECRET` | A secret shared with your daily cleanup scheduler |

Set `SETUP_TOKEN` before creating public compute. After creation, read the returned `public_url` and use it for `APP_URL`. If you already have a confirmed custom HTTPS URL, use that address. Verify the final URL before setup or sending invitations.

A runtime save can replace the task. Through the API, environment PUT replaces the full variable list for its scope. Merge changes in memory and preserve the other variables. [Environment variables](https://docs.springwinter.dev/concepts/environment-variables.md).

Keep `EMAIL_DRIVER` unset for Resend delivery. The development capture driver is refused on a production HTTPS installation. Leave `HOSTED_MODE` unset for an installation belonging to one organization.

## Complete setup and email delivery

Open `/setup` over HTTPS. Enter the setup token, organization details, support address and first administrator account. After setup, confirm that the setup page redirects to login and that the administrator can sign in.

In **Settings → Organization**, configure the sending address and verify its domain through Resend. Use an approved address you control for the first invitation.

The deployment test omitted Resend. Uploading and preparing an envelope worked, but sending returned 503, “Email is not set up yet”. Email is required to deliver the signing links. Test sending and signing before inviting your team.

## Schedule daily cleanup

Configure an approved scheduler to send a `GET` or `POST` request once a day to `/api/internal/retention`. Send the `RETENTION_JOB_SECRET` value as a bearer token in the Authorization header, using the scheduler's secret store.

Spring Winter does not run the cron configuration in `vercel.json`. The retention job also handles due reminders and expired envelopes. Verify the scheduler's response and execution history. [Upstream scheduled work](https://github.com/NYLLON-SOFTWARE/SignuDoc/blob/main/docs/self-hosting.md#daily-cleanup).

## Verify before sending agreements

Use a non-sensitive PDF and an email recipient you control.

1. Wait for the workflow to succeed and confirm `/api/auth/ok` returns HTTP 200.
2. Complete protected setup and sign in. Open the dashboard and settings.
3. Upload the PDF, add a signer and place signature and date fields.
4. Confirm the permitted-use declaration when sending. Verify invitation delivery, finish signing and download the completed PDF.
5. Export the audit trail and check the app's verification page.
6. If the plan includes a replacement test, confirm the new task is serving alone before checking records and files again.

| November 18 test result | Observed outcome |
| - | - |
| Setup, login and application pages | Passed |
| PDF upload, signer configuration and field preparation | Passed before replacement |
| Audit CSV export | Passed, with an intact hash chain |
| Accounts, sessions, envelopes and audit data after replacement | Preserved |
| Uploaded PDF after replacement | Returned 404 |
| Invitation email, signing, sealed PDF and daily cleanup | Unverified |

For a persistent local deployment, back up both PostgreSQL and the complete storage directory, including metadata files. Verify recovery into a disposable target. A database backup alone cannot recover the PDFs lost from a task.

Review current AWS estimates before deployment. Include database compute and storage, Fargate, builds, load balancing, public IPv4, logs and any external host or email charges. Use [project costs](https://docs.springwinter.dev/observability/cost.md) to inspect billed usage after AWS reports it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.