Keenrig

Custom domains and HTTPS

Keenrig works on your server’s IP address from the first minute. Add a domain whenever you are ready: point a DNS record at the server, and the certificate follows on its own.

Before you have a domain

Right after install, the admin panel answers at https://<server-ip>/. Plain http:// requests are redirected to https://.

There is no public certificate for a bare IP address, so the server uses a certificate it made for itself. The connection is still encrypted, but the browser warns once; accept it to continue. The warning goes away once the server has a domain.

Two ways to get a name

You can use either one, or both on different apps.

  • Your own domain: you add a DNS record where you bought the name. Your server obtains and renews its own certificate, independent of Keenrig Cloud.
  • A Keenrig name: once the server is paired with Keenrig Cloud, it gets a free name under keenrig.app, and Keenrig Cloud handles its DNS records and certificate. That name is managed in the Console and is read-only in the admin panel.

If you ever disconnect from Keenrig Cloud, apps that only have a Keenrig name stop being reachable at it, and their data is kept. Add your own domain to each of them first.

Give the server a domain

Pass --domain when you install. It is optional; without it, the server starts on its IP address.

curl -fsSL https://get.keenrig.com | sudo sh -s -- --domain example.com

When the server has a name, the admin panel suggests an address under it for each app you install, such as nextcloud.example.com. Each of those names also has to point at the server: add one A record per app, or a single wildcard record *.example.com that covers them all.

The admin panel shows the server’s name under Domains, read-only. It is the KEENRIG_DOMAIN setting of the keenrig-box service.

Add a domain to an app

First, where you bought the domain, add an A record for the name pointing at your server’s public IP address. Keep any other records you already have.

Then open the app in the admin panel, go to its Domains tab and add the name. An app can have several names, and one of them is its primary. A name can belong to only one app: a name already attached to another app is refused.

To check where a name points, run this in Command Prompt, PowerShell or Terminal:

nslookup app.example.com

Under “Address” it should show your server’s public IP address. DNS changes can take up to an hour to show.

How HTTPS certificates work

With the default gateway (Caddy), the server asks Let’s Encrypt for a certificate as soon as the name resolves to it, and renews it on its own before it expires. There is nothing to click.

If the name does not point at the server yet, the certificate waits and the server keeps retrying, with longer pauses between attempts. Fix the DNS record and the certificate is issued on a later attempt.

Admin → Domains lists every name, the app that uses it, where it came from, and the state of its certificate.

Let’s Encrypt has to reach your server to issue a certificate, so ports 80 and 443 must be open to the internet. A server behind CGNAT, or with those ports closed, cannot get a certificate for your own domain.

Removing a domain

Removing a name from an app takes effect immediately: the app stops answering at that address and its certificate is dropped. The admin panel asks you to type the name to confirm.