Skip to content
sitesolide

Docs Guides

Custom domains

Every project answers at https://<slug>.<zone> from its first deploy. To serve it on a domain of its own too, declare the domain, deploy, point the DNS at the server, then switch.

  • The owner's SSH access: switching a domain is never a token's command.
  • A project that serves a page. One that only runs in the background takes no domain.
  • A domain outside your zone, which the wildcard certificate already covers.

In sitesolide.json:

{
  "slug": "shop",
  "start": "/usr/local/bin/bun run server.ts",
  "domain": { "name": "example.com", "aliases": ["example.net"] }
}

aliases is optional. A second level name, such as example.com or example.net, also answers on its www. An app redirects these other names to name, the path kept; a static site serves its pages on each. A name belongs to one project on the server.

sitesolide deploy

The server now knows the domain. The site still answers at its preview address only.

At your DNS provider, create an A record for example.com with the server's IPv4 address. If the server has an IPv6 address, add an AAAA record with it too, as setup does for your zone.

Point www.example.com and each alias the same way. The CLI checks name alone; the other names answer once they resolve to the server.

sitesolide domain --activate

It sets "active": true in sitesolide.json, puts the manifest on the server and authorizes the domain's certificate. Caddy obtains the certificate on the first HTTPS request, then renews it. Commit sitesolide.json, or a later deploy brings back the inactive state.

Warning

--activate refuses a domain that does not resolve to the server yet. --force switches anyway, and each certificate the authority refuses counts against the name: a few can block it for a week.

sitesolide domain
-> domain of shop
   declared   example.com (aliases: example.net)
   manifest   active
   table      present
   dns        points to 203.0.113.10
   https      200

The domain opens as the preview does: Public, Restricted or Anyone with the code. On a closed site, --activate first checks that Caddy will close the domain too, and says what to run when it would not. The preview address keeps answering, and tells search engines not to index it; the domain does not.

sitesolide domain --deactivate

Commit sitesolide.json again.