Installation

How to install CDM-Server

Step 1: Install Docker Compose

Make sure Docker Engine (with docker-compose-plugin) is installed on your system. See System Requirements for more details.

Step 2: Download the Docker-Compose and Other Files

Go to the directory you want to CDM-Server run from, and execute:

curl -s https://get.apis.de/cdm.sh | bash -s v1.2.1
# Older versions: v1.1.1, v1.0.1
# Full list is available in Changelogs page
curl -s https://get.apis.de/cdm.sh | bash -s version_string_here
    

CDM-Server changelogs are available here.

If you want to do it manually, you can get the docker-compose file from the following link: https://get.apis.de/cdm/latest.tar.gz

#!/bin/bash

# Exit immediately if any command fails
set -e

# Check for --skip-download flag
skip_download=false
if [[ "$1" == "--skip-download" ]]; then
  skip_download=true
  shift # Remove the flag from arguments
fi

# Check if version argument is provided
if [ -z "$1" ]; then
  version="latest"
else
  version="$1"
fi

# URL of the tar.gz file, using the provided version or defaulting to 'latest'
url="https://get.apis.de/cdm/$version.tar.gz"
filename="$version.tar.gz"

if [ "$skip_download" = false ]; then
  # Download the tar.gz file
  curl -O --fail "$url"

  # Check if the download was successful
  if [ $? -ne 0 ]; then
    echo "Download failed. Please check the version and URL."
    exit 1
  fi

  echo "Downloaded $filename"
fi

# Extract the tar.gz file
echo "Extracting $filename (without dummy certs)..."
# Step 1: Extract all files except the PFX files
tar --exclude="cdm-ldaps.pub" --exclude="cdm-server.pfx" --exclude="cdm-server.crt" --exclude="cdm-server.key" -xzvf "$filename"

# Replace :latest with version if needed in docker compose file
services=("db" "app" "web" "proxy")
file="docker-compose.yml"
# Remove the 'v' prefix from the version
label="${version#v}"

if [ "$version" != "latest" ]; then
  echo "Updating docker-compose.yml with version $label"
  for service in "${services[@]}"; do
    sed -i "s|/$service:latest|/$service:$label|g" "$file"
  done
fi

# Step 2: Extract the PFX files only if they do not exist

echo "Extracting dummy certs if needed..."
for file in "cdm-ldaps.pub" "cdm-server.pfx" "cdm-server.crt" "cdm-server.key"; do
    if [ ! -f "$file" ]; then
        tar -xzvf "$filename" --wildcards --no-anchored "$file" || true
    fi
done


# Optional: Remove the tar.gz file after extraction
rm "$filename"

# Make the scripts executable
echo "Ensuring scripts are executable..."
chmod +x download
chmod +x start
chmod +x stop
[ -f backup ] && chmod +x backup
[ -f restore ] && chmod +x restore
[ -f pfx_to_pem.sh ] && chmod +x pfx_to_pem.sh

echo "CDM setup for version $version has been downloaded and extracted. Please follow the installation guide here: https://get.apis.de/docs/server/install/"

Step 3: Create the DotEnv Files

To use the server, you need to provide some data in the form of two DotEnv files:

  • .env
  • .env.idp

Create new DotEnv files, copy the contents of the example files, and update the values with your own configuration.

.env File

Example: .env.example

cp .env.example .env && nano .env

.env.idp File

Example: IdP (ID Provider) specific DotEnv files:

  • .env.idp.azure.example
  • .env.idp.ldaps.example
  • .env.idp.local.example
cp .env.idp.local.example .env.idp && nano .env.idp
cp .env.idp.azure.example .env.idp && nano .env.idp
cp .env.idp.ldaps.example .env.idp && nano .env.idp

Step 4: Login and Download CDM-Server Images

Use the following command to login and download the CDM-Server images. You’ll be asked to enter username and password.

sudo ./download

Step 5. Start the CDM-Server Services

sudo ./start

Step 6. Access CDM-Server

Please see Login for more information.

Last modified July 2, 2025: 15f91b8