Lab: your own domain (optional)

Verified lab · 30 min · Module 6, lesson 4 of 535 min left in this module

Module 6 · Domains and SSLLesson 4 of 5

Self-checked for now. Automatic checking arrives with sign-in; until then, tick off each item under Check your work yourself.

Goal: Put a domain you own in front of a web service, with a certificate, and prove it serves over HTTPS.

You need A domain you own, access to its DNS, and hello-web Running from lab 5.1.4.

Why a subdomain, and why optional

Use a subdomain such as learn.yourdomain.com. It keeps the lab clear of anything already on your main site and needs only one CNAME. The lab is optional because it needs a domain of your own; the rest of the path doesn't depend on it.

If you've deleted hello-web, deploy it again as in lab 5.1.4.

  1. Add the domain

    Open hello-web. On its Overview, in the Custom domain card, choose Add domain. Enter your subdomain and leave SSL certificate on Automatic.

    You should seeThe Add Custom Domain dialog, with a DNS Configuration table showing one CNAME.

  2. Copy the record, then save

    Copy the CNAME's Name and Value from the table. Choose Add domain.

    You should seeYour domain in the Custom Domain card at Waiting for DNS.

  3. Create the record at your DNS provider

    Add a CNAME with that name and value. On Cloudflare, set Proxy status to DNS only (grey cloud) before saving.

    You should seeYour provider lists the new CNAME.

  4. Check it from outside

    dig @1.1.1.1 learn.yourdomain.com CNAME +short
    

    On Windows: nslookup learn.yourdomain.com 1.1.1.1.

    You should seeYour service's computesphere.app hostname.

  5. Watch the status

    Watch the Custom domain card. This usually takes a few minutes once DNS is right; Verify now checks straight away.

    Check yourself

    Your domain moved to Validating. What does that tell you?

    You should seeWaiting for DNS, then Validating, Issuing certificate, and Active.

  6. Open it

    curl -I https://learn.yourdomain.com
    

    You should seeHTTP/2 200, and a padlock for your domain in the browser.

Check your work

  • If this doesn't pass

    Stuck at Waiting for DNS: run the dig command from step 4; no answer means the record is missing, at the wrong provider, or misnamed (often it's just learn). Stuck at Validating: switch the Cloudflare record to DNS only, remove other records for the name, and choose Verify now. Active but no 200: check hello-web is Running on its default URL.

Tidy up

Keep the domain if you like. To remove it, run csph deployments domains remove learn.yourdomain.com --deployment <id>, then delete the CNAME at your DNS provider so the name doesn't point at a service you no longer run.

In the docs