Deploying to Custom Domains
In this guide we will show you how to deploy an app on Unikraft Cloud (UKC) and link it to a domain name you own (e.g., mydomain.com).
Configuring your External DNS Provider
Before we can launch an app, you need to ensure that you have configured things correctly with your DNS provider. There are two cases here:
- For a subdomain you own such as docs.mydomain.com, a CNAME is enough.
In this case, you can just add a
CNAME
record with your sub-domain (docs
) as the host and point the record to UKC’s metro e.g.,fra0.kraft.host
. - For an apex domain (e.g., mydomain.com), add an ALIAS, ANAME, or flattened CNAME record. Depending on your provider, leave the host field empty or enter @.
Point the record to UKC’s metro e.g.,
fra0.kraft.host
. If your DNS provider does not support ALIAS, ANAME, or flattened CNAME records, add an A record and point the record to the IP address of UKC’s metro
Launching your App
Let’s assume we want to use NGINX as our app:
Make sure to log into Unikraft Cloud by setting your token and a metro close to you.
We use fra0
(Frankfurt, 🇩🇪) in this guide:
With this in place, we’ll use the kraft cloud deploy
command to create an instance of the web server and to link it to a custom name; the latter is done through the -d
flag:
The resulting output of the deploy
command should be similar to:
In case you’re curious, when issuing the -d
flag Unikraft Cloud will request a new certificate from Let’s Encrypt.
You’re all set! You can test your deployment with curl
:
Custom and Wildcard Certificates
If you want to use a custom certificate instead of the auto-generated Let’s Encrypt one, you can use the create
command:
The provided common name (CN) must match the one for which the certificate has been issued. As shown in the example, this can also be a wildcard domain.
To see and manage your certificates you can use the kraft cloud cert
command. For instance,
to list your certificate, run:
To see and manage your certificates you can use the kraft cloud cert
command.
For instance, to list your certificate, run:
You should see output similar to:
You can also retrieve full information about your certificate via
You should see output similar to:
Finally, if you want to remove the certificate, first make sure you (1) remove any instances from the relevant service and (2) remove the service. After that you can remove the actual certificate with:
Learn More
- The
kraft cloud
CLI reference - Unikraft Cloud’s REST API reference
- Many more guides here