Custom Domains
In this guide we will show you how to deploy an app on KraftCloud 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 KraftCloud’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 KraftCloud’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 KraftCloud’s metro
Launching your App
Let’s assume we want to use NGINX as our app:
Make sure to log into KraftCloud 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 KraftCloud will request a new certificate from Let’s Encrypt.
You’re all set! You can test your deployment with curl
:
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 group and (2) remove the service group. After that you can remove the actual certificate with:
Learn More
- The
kraft cloud
CLI reference - KraftCloud’s REST API reference
- Many more guides here