Self Host Wizard Docs

Install on an Ubuntu server

What the server needs, how the thx binary gets there, the three commands that start the set-up wizard, and the cloud-firewall ports to open by hand.

This page installs Self Host Wizard by hand on one Ubuntu 24.04 server. It is written for a cloud server like the project's own: Arm, 2 cores, 12 GB of memory and 200 GB of disk. Have that server running, and its public IP address at hand, before you start.

What the server needs first

  • Ubuntu 24.04, on Arm (arm64) or Intel/AMD (amd64). The project's build makes both.
  • A public IPv4 address. In your cloud console, reserve one, so it survives a restart: every DNS record you publish points at it.
  • Caddy, installed from Caddy's own apt repository. thx apply configures Caddy and keeps it running, but does not install it. The test box uses Caddy 2.11.7.
  • iptables with netfilter-persistent (iptables-persistent), so firewall rules survive a reboot. thx apply writes the rules and saves them to /etc/iptables/rules.v4.

thx apply installs the rest itself from Ubuntu's archive: docker.io, docker-compose-v2 and python3.

Steps

  1. Build the binaries from the source tree. check.sh builds bin/thx-arm64 and bin/thx-amd64 with the helper binaries (thx-app, thx-drive, thx-boards) bundled inside thx. Copy the one for your server's architecture to the server as /usr/local/bin/thx.
  2. Tell the box its public IP: sudo thx set public_ip 203.0.113.10 (use your reserved address).
  3. Enable the home piece, which carries the set-up wizard: sudo thx enable home. It pulls in what it needs (the directory and the sign-in service).
  4. Apply: sudo thx apply. Before the box has a domain, this sets up the base: the firewall, Caddy and the home service. Run it again and the last line reads 0 changes.
  5. Print the one-time set-up link and open it in your browser:

    sudo thx-app link -ip 203.0.113.10

    The link looks like https://<ip>/#t=<token>. It works once, for one hour. Running the command again issues a new link and ends the old one.

  6. Follow the wizard: company, mail relay, DNS, first admin, apps, install. The install waits by itself until the apps' wildcard DNS record is visible, then enables the apps you picked, runs thx apply and creates your admin account.

Open the ports in the cloud firewall

thx apply opens ports in the VM's own firewall: always 80/tcp, 443/tcp and 443/udp (HTTP/3), plus each enabled piece's public ports. Mail adds 25, 465, 587 and 993; the git server adds 2222. Your cloud provider has a second firewall, the subnet's security list, and thx holds no cloud API key, so you add the same ports there yourself in your cloud console.

Why the wizard is safe on a bare IP

Before the box has a name, Caddy serves the wizard on the IP address with a short-lived Let's Encrypt IP certificate, so the wizard is never plain HTTP. The token rides in the URL fragment, which browsers never send to the server, so it never reaches a log. The page trades it for a set-up cookie that lasts 12 hours. Only hashes are stored.

After the install

Your apps live at <app>.<apps domain>: app. for the launcher, mail., dav., drive. and so on. Next: add more companies, add domains and set up the mail relay. If something stops, see troubleshooting.

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

  • check.sh
  • internal/containertest/Dockerfile
  • internal/steps/all.go
  • internal/steps/pieces.go
  • internal/firewall/firewall.go
  • internal/stats/stats.go
  • cmd/thx/main.go
  • cmd/thx-app/main.go
  • internal/webapp/setup.go
  • pieces/home/README.md
  • pieces/caddy/Caddyfile.tmpl
  • internal/containertest/run.sh

Updated