Knowledge base / Setup

Document storage

Keep documents locally, in S3 or in Azure, and move between storages.

Documents, license files and logos live in exactly one storage. STORAGE_DRIVER decides which.

Local (default)

STORAGE_DRIVER=local
FILE_STORAGE_PATH=/data/files

The folder is mounted in compose.yaml as ./files:/data/files and belongs to UID 1000. It has to be part of the server’s backup unless you let the in-app backups write to another location.

S3 and S3-compatible storage

STORAGE_DRIVER=s3
S3_BUCKET=contracthub
S3_REGION=eu-central-1
S3_ACCESS_KEY_ID=<key>
S3_SECRET_ACCESS_KEY=<secret>
# optional: folder inside the bucket
S3_PREFIX=

For MinIO, NetApp StorageGRID and other compatible servers, add:

S3_ENDPOINT=https://s3.example.local
S3_FORCE_PATH_STYLE=true

If the credentials stay empty, Kontris uses the usual AWS chain (environment, instance role).

Azure Files

STORAGE_DRIVER=azure-files
AZURE_FILES_CONNECTION_STRING=<connection string>
AZURE_FILES_SHARE=contracthub
# optional: directory inside the share
AZURE_FILES_DIRECTORY=

Azure Blob Storage

STORAGE_DRIVER=azure-blob
AZURE_BLOB_CONNECTION_STRING=<connection string>
AZURE_BLOB_CONTAINER=contracthub
# optional: prefix inside the container
AZURE_BLOB_PREFIX=

For Azure an account key or a SAS with read, write, create, delete and list is enough.

Checking

docker compose exec contracthub node dist/storage.js check

The first line names the active storage. The command reports files that are in the database but missing from the storage. The same check is available in the app under Administration → File storage.

Moving to another storage

  1. Add the credentials of the new storage to contracthub.env, but leave STORAGE_DRIVER at the old value for now, and restart.

  2. Copy the files:

    docker compose exec contracthub node dist/storage.js copy --to s3

    This works while the application is running. Every copied file is read back and verified. You can also start the copy on the File storage page.

  3. Repeat the command shortly before switching so that recently uploaded files are included. Files already copied are skipped.

  4. Change STORAGE_DRIVER to the new storage and restart.

  5. Check with storage.js check that everything is there. You can clean up the old storage afterwards.

Full-text search in documents

Kontris reads the text of PDFs, Word, Excel, PowerPoint and OpenDocument files as well as text files and makes it searchable. This can be switched off under Administration → Settings; the extracted texts are then deleted. Scanned PDFs without a text layer are not recognized.

As of 2026-11-15 · Stuck? Write to us