Skip to Content
Technical Articles
Author's profile photo Denys van Kempen

SAP BTP Developer Onboarding V | Custom Domains

This article been updated. For the latest version, go to


The SAP Business Technology Platform (BTP) developer onboarding video tutorial series from the SAP HANA Academy has just been updated to include SAP Business Application Studio (BAS) and the Cloud Application Programming (CAP) model.

In this blog post you will find the videos embedded with references and additional information.

Questions? Please post as comment.

Useful? Give us a like and share on social media.



Hands-On Video Tutorials

Philip MUGGLESTONE updated his developer onboarding video tutorial series for the SAP Cloud Platform. In this post, you will find the videos embedded with some additional information and resources. Following along in the patented zero-to-hero format, no prior knowledge required, you will be ready to start developing business applications on the platform with minimal effort and no time wasted.

In this set of video tutorials, Philip Mugglestone shows how to configure custom domains in the SAP Cloud Platform Cloud Foundry environment.

You can watch the three video tutorials in a little over 30 minutes. What you learn is

  • How to set up the environment and install the required tools like the cf CLI, custom domain plugin and certbot
  • How to create a custom domain service instance and domain
  • How to sign a certificate and upload the certificate chain to Cloud Foundry
  • How to configure your DNS service for CNAME (using AWS Route 53 as example)
  • How to configure a basic Cloud Foundry application to use custom domains
  • How to configure a full-stack multi-target application (MTA) to use custom domains
  • How to perform housekeeping and undo a custom domain configuration

Note that custom domains require a production environment and are not supported in the trial.

Because we know your time is precious, we have included the commands in a text file so you can simply follow along without too much ado.

For the sample apps used in video number three, git clone

To bookmark the playlist on YouTube, go to

For the documentation, visit

Ready? Let’s customise a domain!


Video Tutorial | Custom Domains 1/4

In the first video, we set up the environment and install the required tools.

0:00 – Introduction using AWS S3 as example

1:15 – About TLS certificates using Let’s Encrypt and Certbot as example

2:00 – Create new subaccount, enable Cloud Foundry (org name = subdomain), and create space

3:30 – Set entitlements for Custom Domains

4:00 – Install cf CLI for your platform

4:45 – Install SAP Cloud Platform cf CLI Custom Domain plugin

6:00 – Connect with cf CLI

7:00 – Install Certbot for your platform

8:00 – Recap


Commands used in this video tutorial:

cf install-plugin custom-domain-cli
cf plugins
cf api
cf login 
cf cdl
certbot --version


To download the cf CLI and plugin, visit


For additional information, visit


Video Tutorial | Custom Domains 2/4

In the second video we configure and activates the custom domain for the Cloud Foundry subaccount. This includes the process of creating and installing the SSL certificate.

0:00 – Introduction

0:30 – Customise sample code 

2:50 – Create Custom Domain Service instance, domain, and key

4:50 – Create certificate signing request (CSR)

6:00 – Deploy DNS TXT record in AWS Route 53 (or alternative DNS service)

8:00 – Add base-64 root certificate to the chain

8:50 – Upload and activate certificate

10:00 – Configure CNAME to point to the API endpoint

11:30 – Recap

Code Sample

The sample code for this tutorial is available for download from GitHub:

For the base-64 root certificate used by Let’s Encrypt, visit

Update the

<cforg> Cloud Foundry Org Name, e.g. “demo”
<> Custom domain
<custom-domain-instance> Service instance name, e.g. customdomain
<custom-domain-key> passphrase, e.g. customdomainkey |
<C=US, ST=California, L=Palo Alto, O=ACME> Certificate configuration
<> administration e-mail account


Commands used in this video tutorial.

cf create-service INFRA custom_domains customdomain
cf create-domain demo
cf domains
cf custom-domain-create-key customdomainkey 
", C=US, ST=California, L=Palo Alto, O=SAP" "*"
cf custom-domain-get-csr customdomainkey csr.pem

Using certbot to generate the certificate with the CRS.

certbot certonly --manual --preferred-challenges dns 
--server "" 
--domain "*" 
--csr csr.pem --no-bootstrap --agree-tos

Add certificate

cf custom-domain-upload-certificate-chain customdomainkey 2upload.pem
cf custom-domain-activate customdomainkey "*"
cf cdl
cf custom-domain-show-certificates customdomainkey

Configure CNAME to point to the API endpoint.


Video Tutorial | Custom Domains 3/4

In part 3 we learn how to configure two sample applications for custom domains.

0:00 – Introduction with reference to local development tools

0:50 – Git clone sample applications and open in Visual Studio Code 

1:50 – Basic example: configure route in deployment descriptor manifest.yml

3:50 – Advanced example: configure parameter in deployment descriptor mta.yml and security descriptor xs-security.json

6:00 – Build and deploy MTA and validate

8:00 – Recap

Basic example

  - name: myappnode
      - route:

MTA example

    "oauth2-configuration": {
        "redirect-uris": [


For how to set up a local environment, see the video tutorials

Configuring MTA and security descriptor for custom domain


Video Tutorial | Custom Domains 4/4

In the last video, we cover how to de-configure custom domains by deleting deployed applications and routes, deactivating and deleting custom domain definitions and keys from a Cloud Foundry subaccount.

0:00 – Introduction

0:30 – Delete apps

2:00 – Remove custom domain configuration

4:30 – Remove CNAME record for DNS

5:00 – Recap


To delete the MTA and basic app, use commands

cf undeploy myappuaa --delete-services -f
cf d myappnode -r -f

Deactivate and delete domain

cf cdl
cf custom-domain-deactivate "*"
cf domains
cf delete-domain
cf custom-domain-delete-key customdomainkey
cf delete-service customdomain


Share and Connect

Questions? Please post as comment.

Useful? Give us a like and share on social media.


If you would like to receive updates, connect with me on

For the author page of SAP PRESS, visit

Over the years, for the SAP HANA Academy, SAP’s Partner Innovation Lab, and à titre personnel, I have written a little over 300 posts here for the SAP Community. Some articles only reached a few readers. Others attracted quite a few more.For your reading pleasure and convenience, here is a curated list of posts which somehow managed to pass the 10k-view mile stone and, as sign of current interest, still tickle the counters each month.


Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mario Bisonti
      Mario Bisonti


      very good tutorial.

      I don't understand if it renews certificate automatically evry 30 days or not.

      Could you give me some information?