Subdomains
Every install gets a free <yourname>.sudoterm.com subdomain backed by a dedicated Cloudflare Tunnel.
How it works
install.shgenerates a 32-byte install token (one-time, random)- It POSTs to
api.sudoterm.com/api/registerwith the token + your chosen
subdomain + your VPS hostname
- The registry validates the subdomain isn't taken or reserved, creates a
Cloudflare Tunnel, and provisions a CNAME pointing your subdomain at the tunnel
- The response includes the tunnel token, which install.sh writes to
~/.sudoterm/tunnel.json (chmod 600)
- The daemon starts
cloudflaredas a child process; cloudflared dials out
to Cloudflare's edge and the URL goes live
Change the subdomain
sudoterm subdomain change <new-name>Re-registers via the registry, updates tunnel.json, restarts the daemon (cloudflared respawns with the new tunnel token). The old subdomain stops resolving immediately — there's no DNS propagation delay because the CNAME flip is at Cloudflare.
Conflict handling
If your preferred subdomain is taken, the registry returns a 409 with a list of suggestions:
{
"error": {
"code": "SUBDOMAIN_TAKEN",
"message": "Subdomain \"my-vps\" is taken",
"details": {
"requested": "my-vps",
"suggestions": ["my-vps-2", "my-vps-3", "my-vps-x7k"]
}
}
}install.sh will print these and re-prompt.
Reserved names
Names like api, www, admin, docs, blog are reserved and return 400 INVALID_SUBDOMAIN. Validation rules: 3-30 chars, lowercase letters, digits, dashes; can't start or end with a dash.