Self Host Wizard Docs

Troubleshooting

The errors and stuck states the code knows about, from the set-up link and certificates to the relay refusing mail, and the thx commands that show what is wrong.

Start with the box's own checks, then find the symptom below.

First: ask the box

  • sudo thx verify probes the box and exits 1 if any probe fails.
  • sudo thx apply is safe to run again at any time: it only fixes what differs from the state, and a healthy box ends with 0 changes. To rerun one part, use --only, for example sudo thx apply --only stalwart.
  • sudo thx pieces shows which pieces are enabled.

thx exits with code 2 and prints its usage when a command is malformed, and with code 1 for other errors, with a message that names the fix.

The link from thx-app link works once and for one hour. Run the command again for a fresh one; that also ends the old link. The token travels after the # in the address, so copy the whole link. Opening it in a second browser does not work once the first has used it.

The install waits for DNS

The wizard's install step waits until the wildcard record (* A to the box's public IP) is visible on the apps domain, because every app address needs its own certificate. It checks again by itself every 30 seconds; nothing needs pressing. Check the record at your DNS host and give it time to spread.

A browser warns about the certificate

Caddy asks Let's Encrypt for a certificate only once DNS points the name at the box and ports 80 and 443 are open on both firewalls. thx apply opens them in the VM's own firewall. The cloud firewall (the subnet's security list) is separate: add 80/tcp, 443/tcp and 443/udp there by hand, plus 25, 465, 587 and 993 for mail. On the bare IP address, the wizard uses a short-lived IP certificate that Caddy renews by itself.

Mail sent from the box bounces with 535

The cloud provider's email service refuses a From address that is not an Approved Sender, and the bounce goes back to the person who sent it. Add the address as an Approved Sender in your cloud console. Then:

  • sudo thx relay check: exit 1 means the relay refused the stored credentials; exit 3 means it could not ask (network, a temporary error, or no credentials stored yet).
  • sudo thx relay test --to you@example.com sends one message through the relay as noreply@.
  • sudo thx relay status acme.example shows which steps are still to do.

The mail admin page does not load

Stalwart downloads its admin web interface from GitHub on first start, so the box needs outgoing HTTPS. On a domain other than the apps domain, the mail. name serves only what mail clients use; the admin page is on mail.<apps domain>.

The directory will not start: "private key has changed"

LLDAP's key and its data were restored from different moments. Restore /etc/thx/secrets/lldap/ and the directory's data together, from the same copy.

Sign-in fails for a few seconds after enabling an app

Adding or removing an OIDC app changes Authelia's client list, which recreates its container. Wait a few seconds and sign in again.

An install started from the Home app seems lost

thx apply started from Home runs as its own systemd unit, so it survives Home restarting. If Home restarts, its progress view forgets the run, but the output stays in /var/lib/thx-app/<job id>.log and the result shows in the box's state.

Commands that refuse, and why

  • "site_domain … is not in domains": add the domain first with thx domain add, then thx set site_domain.
  • "… serves the site; clear it first": the apps domain cannot be removed until you run sudo thx set site_domain ''.
  • "… is the last admin who can sign in": make another admin before you suspend or remove this one.
  • "org … may not end in -admins": that suffix names a company's admin group; choose another short name.

Facts on this page come from these files in the selfhostwizard repository:

  • cmd/thx/main.go
  • cmd/thx/relay.go
  • cmd/thx/users.go
  • internal/state/state.go
  • internal/webapp/setup.go
  • pieces/home/README.md
  • pieces/stalwart/README.md
  • pieces/lldap/README.md
  • pieces/authelia/README.md
  • pieces/caddy/Caddyfile.tmpl
  • internal/firewall/firewall.go

Updated