Intro
This repository contains the self-hosting backend for the Usercentrics CMP. Usercentrics is a Consent Management Platform ("cookie banner") that can be used either as standalone software or in conjunction with other tools for managing consents on websites and apps.
Components
The application consists of three components and is based on Docker images: a Node.js - app, a database and a reverse proxy. The following versions are used:
- Database (if enabled), one or more of the following:
- PostgreSQL 18
- Logonly (no DB)
- App
- Node.js 20.19 + Express.js
- Reverse Proxy
- NGINX
Before you start with the installation, make sure you understand the concept of the Data Flow and Static files. We recommend organising the files in a Git-Repository for proper version management.
For testing, you can also deploy the app + reverse proxy without a database connection. To do that, set DATABASE=none in the ENV-Config of the App.
Proxy Mode
Work in progress, proxy mode is currently not supported
Database
For the installation instructions, we'll use PostgreSQL (Kubernetes & Docker-Compose) or BigQuery (GCP). But it is also possible to use all of the other database types described under 'components'. Please check the database documentation here.
Installation
The application can be installed via:
- Kubernetes (recommended)
- Serverless in GCP (coming soon)
- Docker Compose (coming soon)
Image-Repository
The Docker images for both the database and app are hosted on a private Docker repository in GCP's Artifact Registry:
| Component | Repo-URL | Tags |
|---|---|---|
| App | europe-west10-docker.pkg.dev/dwc-apis-and-services/usercentrics/ucapi | latest testing |
| Database | europe-west10-docker.pkg.dev/dwc-apis-and-services/usercentrics/postgres | latest testing |
| Reverse Proxy | europe-west10-docker.pkg.dev/dwc-apis-and-services/usercentrics/nginx | latest |
You need an access key to access the images in the private repository. The access key will be provided during the onboarding phase in json - format. To authenticate, run the following command:
cat /path/to/key.json | docker login -u _json_key --password-stdin https://europe-west10-docker.pkg.dev
Kubernetes
For Kubernetes, first create a secret on the cluster:
kubectl create secret docker-registry ucapi-repo-secret \
--docker-server europe-west10-docker.pkg.dev \
--docker-username _json_key \
--docker-email EMAIL_FROM_KEY \
--docker-password="$(cat /path/to/key.json)" \
--namespace=NAME_OF_NAMESPACE
Replace EMAIL_FROM_KEY with the client_email - value from the json - key.
Then, add the key to the api-deployment.yml:
[...]
spec:
imagePullSecrets:
- name: ucapi-repo-secret
containers:
[...]