Deploying an Unomi App
Introduction
Apache Unomi is an open-source customer data platform for profiles, events, and segmentation. This guide shows how to containerize Unomi with a Dockerfile, connect it to Elasticsearch, persist data, and deploy it to Klutch.sh over HTTP.
Prerequisites
- GitHub repository containing your Dockerfile.
- Elasticsearch/OpenSearch cluster (managed or deployed separately).
- Klutch.sh project ready in klutch.sh/app.
Project structure
.└── DockerfileSample Dockerfile
FROM apache/unomi:latest
# Default Unomi portENV HTTP_PORT=8181EXPOSE 8181Required environment variables
ELASTICSEARCH_ADDRESSES– e.g.,http://HOST:9200ELASTICSEARCH_USERNAMEandELASTICSEARCH_PASSWORD– if security is enabledHTTP_PORT– internal port (default8181)UNOMI_CLUSTER_NAME– cluster name for Unomi/ElasticsearchUNOMI_ROOT_PASSWORD– set a strong password for Karaf/Unomi console
Optional environment variables
UNOMI_KARAF_DEBUG=false– keep debug off in productionUNOMI_ELASTICSEARCH_SSL=false– set true if using HTTPSUNOMI_HOST– public host URL (e.g.,https://example-app.klutch.sh)
Persistence
Persist Unomi data and logs:
- Mount path:
/opt/unomi/data - Size: based on profile/event volume and retention
Networking
- Protocol: HTTP
- Internal port:
8181 - Users and services reach
https://example-app.klutch.shwhile Klutch.sh routes to port8181in the container.
Health check (recommended)
curl -I http://localhost:8181/cxs/clusterDeployment on Klutch.sh
- Push your Dockerfile to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
8181. - Add environment variables for Elasticsearch (
ELASTICSEARCH_ADDRESSES, credentials, SSL toggle), Unomi cluster name, andUNOMI_ROOT_PASSWORD. Mark sensitive values as secrets. - Attach a persistent volume at
/opt/unomi/datasized for your expected profiles and events. - Deploy. After startup, access the Unomi endpoints at
https://example-app.klutch.sh/cxsand configure your segments and rules.
Verification
-
Cluster check:
Terminal window curl -s https://example-app.klutch.sh/cxs/cluster -
Basic auth check (if enabled): ensure the endpoint returns status 200 and cluster info.
Next steps
- Secure Elasticsearch with TLS and role-based access.
- Set retention policies for events and profiles.
- Enable backups for both the Elasticsearch cluster and the mounted
/opt/unomi/datavolume.