.env.example from your release. Set deployment values in .env in the docker/ directory. Keep it out of source control and use your deployment’s protected secret store for production credentials.
Configure Keycloak
- Set
KOONJ_KEYCLOAK_EXTERNAL_URLandkeycloakUrlinui/config.jsto the browser-facing Keycloak base URL, without the realm path or trailing slash. - In
keycloak/koonj-realm.json, set thekoonj-uiclient’sredirectUrisandpost.logout.redirect.uristo your console URL followed by/*. The template derives allowed web origins from the redirects. For an existing realm, update the client in the Keycloak Admin Console. - Serve the console and Keycloak over HTTPS. Set
KOONJ_CORS_ALLOWED_ORIGINSto the console origin. Use a reverse proxy to make Keycloak reachable from browsers or configureKOONJ_KEYCLOAK_BINDfor the appropriate interface. - Replace imported development accounts or rotate their passwords before exposing the service. Assign Koonj roles in Keycloak.
Choose storage authentication
Connect a customer AWS bucket
- Give the Koonj workload identity
sts:AssumeRoleaccess to the approved customer role. In a shared deployment, setKOONJ_AWS_ALLOW_DEFAULT_CHAIN=false. - Set a stable UUID in
KOONJ_AWS_EXTERNAL_ID_NAMESPACEand use the same value across API and worker replicas. - In the selected project, add an AWS S3 connection, choose Assume AWS IAM role, enter the role ARN, and select Get external ID.
- In the customer role trust policy, trust the exact Koonj workload role and require that external ID with a
StringEqualscondition onsts:ExternalId. Scope S3 permissions to the configured bucket and prefix. Includes3:RestoreObjectfor cold recall and applicable KMS permissions for SSE-KMS. - Enter the bucket’s region, test access, and save the connection. The prefix acts as the connection root. Register a separate connection to change the root of an already cataloged location.
Protect access keys
For encrypted access keys, setKOONJ_STORAGE_KEY_PROVIDER=aws-kms and KOONJ_STORAGE_KMS_KEY_ARN on the API and workers. Use a symmetric customer-managed key. Grant the API kms:GenerateDataKey and both the API and workers kms:Decrypt on the applicable keys. Retain previous wrapping keys while connection records or backups still need them.
For AWS Secrets Manager, set KOONJ_AWS_SECRETS_REGION. Grant access to the approved project secrets and applicable KMS key. In Koonj, use a reference such as aws-sm:archive-storage for the secret koonj/<project-uuid>/archive-storage. The secret JSON contains accessKeyId, secretAccessKey, and bucket, plus the exact endpointUrl for custom S3 and objectPrefix if configured. Temporary sessions also require sessionToken and an ISO-8601 expiresAt.
Configure transfer workers
The packaged stack starts a separatekoonj-transfer-worker. Keep KOONJ_TRANSFER_RABBIT_ENABLED=true across API and worker processes that share a database. Ensure the API and eligible workers can see each mounted path at the registered location. Use the same storage routing and capacity settings across replicas.
See Operations and troubleshooting for notifications, upgrades, and health checks.