Install the builder on your server and host sites: step by step

This guide takes you from an empty Linux server to a running builder at https://builder.example.com and a first website live at its own domain. Follow it top to bottom; every step says what to do, how to check that it worked and what to do if not. Replace example.com, you@example.com and the other placeholders with your own values.

Time needed: about an hour, most of it waiting for DNS and setting up Microsoft 365.

Contents

  1. What you need
  2. Prepare the server
  3. Point the domains to the server (DNS)
  4. Create a GitHub token
  5. Optional: Microsoft 365 for e-mails
  6. Download and configure the builder
  7. Build and start
  8. Create the first administrator
  9. Put a first website online
  10. Check that everything works
  11. Keep it running: updates, backups, restore
  12. Troubleshooting

How it fits together (details: docker.md):

 Internet ──► Caddy (ports 80/443, HTTPS certificates from Let's Encrypt)
               ├─ builder.example.com      ─► builder   (the editor)
               ├─ zitzelsbergerit.de       ─► files of the published site
               └─ zitzelsbergerit.de/api/form ─► forms (sends contact form mails)
             deployer: installs approved sites and rewrites Caddy's configuration

1. What you need

WhatNotes
A Linux server (VPS or own machine), x86-64 or arm641 GB RAM and 10 GB disk are enough to start; Ubuntu 24.04 LTS or Debian 12 are assumed below
SSH access as a user with sudo
A domain for the builder, e.g. builder.example.coma subdomain of a domain you already have is fine
The domain(s) of the websites, e.g. zitzelsbergerit.deyou must be able to change their DNS records
A GitHub account with read access to Website-Builder and GoUtilsboth repositories are private
Optional: Microsoft 365for notification and password-reset mails and for contact forms; SMTP works for contact forms too

2. Prepare the server

Connect and update the system:

ssh you@your-server
sudo apt update && sudo apt upgrade -y

Install Docker (Engine and the Compose plugin) with Docker's install script, then allow your user to run it without sudo (sign out and in again afterwards):

curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
exit                      # and connect again
docker version            # shows Client and Server
docker compose version    # must be v2.x ("docker compose", with a space)

Open the firewall for SSH, HTTP and HTTPS (HTTP/3 uses UDP 443). With ufw:

sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 443/udp
sudo ufw enable
sudo ufw status

If your hosting provider has its own firewall (cloud console), open the same ports there.

3. Point the domains to the server (DNS)

Find the server's public addresses:

curl -4 ifconfig.me; echo     # IPv4, e.g. 203.0.113.10
curl -6 ifconfig.me; echo     # IPv6, if the server has one

At your DNS provider, create these records (TTL 300 is fine while setting up):

NameTypeValue
builder.example.comAthe IPv4 address
builder.example.comAAAAthe IPv6 address (only if the server has one)
zitzelsbergerit.deA (+ AAAA)the same addresses
www.zitzelsbergerit.deA (+ AAAA)the same addresses (redirects to zitzelsbergerit.de)

Check from your own computer (may take a few minutes to hours):

dig +short builder.example.com
dig +short zitzelsbergerit.de
dig +short www.zitzelsbergerit.de

All must print the server's address. HTTPS certificates are only issued once they do.

Websites on subdomains of your domain

Sites without their own domain can run on subdomains of yours, e.g. musterquelle.zitzelsbergerit.de. One wildcard record covers the builder and every subdomain, so a new site needs only one more record, for its www. address:

NameTypeValue
zitzelsbergerit.deA (+ AAAA)the server's addresses
*.zitzelsbergerit.deA (+ AAAA)the same (covers www., builder. and every <name>.)
www.<name>.zitzelsbergerit.deA (+ AAAA)the same; one per subdomain site (or *.<name>.zitzelsbergerit.de)

A wildcard matches one level only: *.zitzelsbergerit.de covers musterquelle.zitzelsbergerit.de but not www.musterquelle.zitzelsbergerit.de, which the www redirect (WWW_REDIRECT=true) also serves. Records you create explicitly (like builder.) take precedence over the wildcard.

For each new subdomain site:

  1. Add www.<name>.zitzelsbergerit.de at your DNS provider.
  2. In the builder set the site's Public address to <name>.zitzelsbergerit.de and approve it.

Caddy obtains both certificates on its own; www.<name>… redirects to <name>.zitzelsbergerit.de. Check with dig +short www.<name>.zitzelsbergerit.de. Without the record the site works, only its www. address fails (Caddy keeps retrying its certificate until the record exists).

A client's own domain (e.g. musterquelle.de) needs two records at the client's DNS provider: musterquelle.de and www.musterquelle.de, both pointing to the server.

Moving an existing website: change the DNS of its domain only when the new site is approved and installed (step 9), so the old site stays online until then. Until the DNS switch, Caddy cannot get a certificate for it; it retries automatically.

4. Create a GitHub token

The server needs read access to the two private repositories: to clone Website-Builder and to download GoUtils while building.

  1. GitHub → your picture → Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token.
  2. Name: website-builder server, expiration as you like (e.g. 1 year; a new token is only needed for the next update after it expires).
  3. Repository access: Only select repositories → Website-Builder and GoUtils.
  4. Permissions → Repository permissions → Contents: Read-only (Metadata is added automatically).
  5. Generate token and copy it (github_pat_…). Store it in your password manager.

5. Optional: Microsoft 365 for e-mails

The builder sends mails for: password resets, client invitations, publish requests and decisions. Contact forms of hosted sites can send through the same app (so that they arrive: guide-admins.md § Contact form mails). Without this, the builder works, but these mails are only written to the log, and contact forms need SMTP instead (see the SMTP_* settings in step 6).

Create the app (once):

  1. Open https://entra.microsoft.com as an administrator → Applications → App registrations → New registration.
  2. Name Website Builder, Accounts in this organizational directory only, no redirect URI → Register.
  3. On the overview page copy Application (client) ID and Directory (tenant) ID.
  4. Certificates & secrets → New client secret → description builder, expiry 24 months → Add, then copy the Value right away (it is shown only once). Put a reminder in your calendar to renew it before it expires.
  5. API permissions → Add a permission → Microsoft Graph → Application permissions → Mail.Send → Add permissions, then Grant admin consent for ….

Mailboxes: use a shared mailbox (free, no licence) as sender, e.g. website@example.com for notifications and contact forms. In the Microsoft 365 admin center: Teams & groups → Shared mailboxes → Add a shared mailbox.

Limit the app to that mailbox (strongly recommended): without this, Mail.Send allows sending as any mailbox of your organization. In PowerShell (Install-Module ExchangeOnlineManagement once):

Connect-ExchangeOnline
# A mail-enabled security group with the mailboxes the app may send as:
New-DistributionGroup -Name "Website Builder senders" -Alias wb-senders -Type Security
Add-DistributionGroupMember -Identity wb-senders -Member website@example.com
# Only members of the group:
New-ApplicationAccessPolicy -AppId <Application (client) ID> -PolicyScopeGroupId wb-senders `
  -AccessRight RestrictAccess -Description "Website Builder may only send as website@"
# Check (may take up to an hour to apply):
Test-ApplicationAccessPolicy -Identity website@example.com -AppId <Application (client) ID>   # Granted
Test-ApplicationAccessPolicy -Identity someone.else@example.com -AppId <Application (client) ID> # Denied

You now have: tenant ID, client ID, client secret, and the sending mailbox. They go into .env in the next step.

6. Download and configure the builder

Clone the repository (Git asks for a user name and password: use your GitHub user name and the token from step 4 as password):

cd ~
git clone https://github.com/marcus-zitzelsbergerit/Website-Builder.git
cd Website-Builder

The installer does steps 6–8 for you. Start it and choose role 1) server (the builder and the websites on this server):

read -s GOUTILS_TOKEN && export GOUTILS_TOKEN      # paste the token from step 4
deploy/install.sh

It checks Docker, checks out the newest release, asks for the builder's domain, the Let's Encrypt e-mail and (optionally) the Microsoft 365 or SMTP settings, writes .env, creates the folders, checks DNS and the ports, builds and starts everything, runs a health check and creates the first administrator (it asks for the password). If something stops it (e.g. a build error), fix it and run it again: it continues with the settings it already wrote. Then continue with step 8's two-factor set-up and step 9.

The same script sets up further servers: role 2) web for another web server (it asks for the builder's address and the token from Admin → Web servers), role 3) builder for a builder on its own server (Hosting).

The rest of steps 6–8 describes what the script does, for doing it by hand.

By hand

Check out the newest release (servers run releases, not whatever is on master; Updating installs newer ones) and go to the stack folder:

git checkout "$(git tag -l 'v*' --sort=-v:refname | head -n 1)"
cd deploy/server

Create the configuration and the data folders. The containers run as the unprivileged user 65532, which must own the folders:

cp .env.example .env
chmod 600 .env
mkdir -p data hosting bundles sites caddy
sudo chown 65532:65532 data hosting bundles sites caddy
nano .env

A complete .env (remove what you do not use):

# Domain of the editor (DNS from step 3 must point here)
BUILDER_DOMAIN=builder.example.com
# Contact for Let's Encrypt (expiry warnings, recommended)
ACME_EMAIL=you@example.com

# Microsoft 365 (step 5): notifications, password resets, invitations
NOTIFY_FROM=website@example.com
MSGRAPH_TENANT_ID=00000000-0000-0000-0000-000000000000
MSGRAPH_CLIENT_ID=00000000-0000-0000-0000-000000000000
MSGRAPH_CLIENT_SECRET=the-secret-value

# Contact forms of hosted sites: send via the app above, from this mailbox ...
GRAPH_FROM=website@example.com
# ... or via SMTP (used only when GRAPH_FROM is empty)
SMTP_HOST=
SMTP_PORT=587
SMTP_USERNAME=
SMTP_PASSWORD=
SMTP_FROM=

# Redirect www.<domain> to <domain> (and the reverse) for every hosted site
WWW_REDIRECT=true
# true = test certificates from Caddy's own authority instead of Let's Encrypt (staging)
LOCAL_CERTS=false

Every variable is explained in reference.md.

Optional: change the default limits for new accounts (sites, storage, pages) in compose.yaml → builder → command:; flags in reference.md.

7. Build and start

Build the image (a few minutes the first time). The token is passed as a BuildKit secret and is never stored in the image:

VERSION="$(git describe --tags --always)" GOUTILS_TOKEN=github_pat_... docker compose build
docker compose up -d
docker compose ps

docker compose ps must show four services Up: builder, deployer, forms, caddy.

Tip: to keep the token out of your shell history, put a space in front of the command (with the default HISTCONTROL=ignoreboth) or read it first: read -s GOUTILS_TOKEN && export GOUTILS_TOKEN.

Watch the start (Ctrl+C ends watching, not the services):

docker compose logs -f caddy builder

Caddy logs certificate obtained successfully for builder.example.com within a minute.

8. Create the first administrator

The installer did this already. By hand:

docker compose run --rm builder admin create -data /data -email you@example.com

It asks for a password (at least 10 characters). Then:

  1. Open https://builder.example.com and sign in.
  2. Open Account (your e-mail address at the top right) → Two-factor authentication → Turn on. Scan the QR code with 1Password (Add more → One-Time Password) or any authenticator app, enter the code, and store the 10 recovery codes (download them into 1Password). The admin area is locked until this is done.
  3. Optional: Account → Passkeys → Add a passkey, then sign in with it (password + code stay the fallback).
  4. Open Admin → Settings and enter your company name, logo and the addresses of your legal notice (Impressum) and privacy policy: the builder is reachable from the internet, so both must be one click away from every page, the sign-in page included. Add the documentation address if you host the docs (guide-admins.md § 1).
  5. The other tabs under Admin: Publish requests, Accounts, Sites, Web servers, Audit log.

New people register themselves on the sign-in page; you approve them in Admin → Accounts. To stop self-registration, add - -signup=false to the builder's command: in compose.yaml and run docker compose up -d.

9. Put a first website online

Example: the Zitzelsberger IT website from a site package (zitzelsbergerit-site-package.zip).

  1. Import: on Sites, click Import site… and choose the zip. The editor opens. (For a new site instead: type a name, Create site.)

  2. Public address: in the editor, click an empty spot of the canvas so the right panel shows Page; scroll to Site → Public address and enter https://zitzelsbergerit.de. This is the domain the site will be served at, and it is used for search engines.

  3. Contact form recipient: select the contact form on the canvas and check Recipient email (e.g. info@zitzelsbergerit.de). Messages go there; the address never appears on the website.

  4. Check the site: switch pages in the top bar (Page), look at Tablet and Phone, and look at the Accessibility panel on the left (it should say ok).

  5. Request publishing: Publish… (top right) → optional message → Publish. The current state is frozen as a version.

  6. Approve: as administrator, Admin → Publish requests → open the request → look at the preview (switch pages there), check the listed form recipients → Approve and hand over.

  7. Wait ~30 seconds. The deployer installs the site and Caddy gets certificates:

    docker compose logs --tail=20 deployer   # "installed site … (Zitzelsberger IT) at zitzelsbergerit.de, version …"
    docker compose logs --tail=20 caddy      # "certificate obtained successfully"
    
  8. Open https://zitzelsbergerit.de and https://www.zitzelsbergerit.de (redirects).

Every later change: edit → Publish… → approve. Content-only changes by clients (entries, editable texts) can go live without review: Admin → Sites → Content goes live immediately.

10. Check that everything works

CheckHow
HTTPS and redirectscurl -sI https://zitzelsbergerit.de | head -1 → HTTP/2 200; curl -sI http://zitzelsbergerit.de → 308 to https; curl -sI https://www.zitzelsbergerit.de → 301 to the bare domain
Security headerscurl -sI https://zitzelsbergerit.de | grep -iE 'strict-transport|content-security'
Page not foundcurl -sI https://zitzelsbergerit.de/nope | head -1 → HTTP/2 404 (shows the site's 404 page in a browser)
Contact formsend a message on the site; it arrives at the recipient; docker compose logs forms shows errors if not
MailsForgot password? on the sign-in page sends a mail when NOTIFY_FROM/MSGRAPH_* work; docker compose logs builder otherwise
Backupsafter the first night: ls data/backups/ shows builder-<date>.db and uploads-<date>.tar.gz
Search engineshttps://zitzelsbergerit.de/sitemap.xml and /robots.txt exist (need the public address)

11. Keep it running: updates, backups, restore

Update the builder to a new release (new features, fixes; the database migrates by itself). The script makes a backup first, shows the changelog, and checks afterwards that everything runs:

cd ~/Website-Builder/deploy/server
GOUTILS_TOKEN=github_pat_... ../update.sh
docker compose pull caddy && docker compose up -d caddy   # Caddy updates (occasionally)

Published sites keep running during the update; they are plain files. Going back, several servers, what changes on live sites: Updating.

Backups happen every night at 03:17 into data/backups/ (14 days kept). Copy them off the server regularly, e.g. with a cron job on another machine:

rsync -a you@your-server:Website-Builder/deploy/server/data/backups/ ~/builder-backups/

Run one now: docker compose run --rm builder backup -data /data.

Restore (e.g. on a new server after steps 2–7):

docker compose down
cp data/backups/builder-<date>.db data/builder.db && rm -f data/builder.db-wal data/builder.db-shm
rm -rf data/uploads && mkdir data/uploads && tar -xzf data/backups/uploads-<date>.tar.gz -C data/uploads
sudo chown -R 65532:65532 data
docker compose up -d

Published sites come back automatically (the deployer gets them from the builder again).

Account emergencies:

docker compose run --rm builder admin list -data /data                              # all accounts
docker compose run --rm builder admin reset-2fa -data /data -email you@example.com   # lost 2FA device and codes
docker compose run --rm builder admin set-password -data /data -email someone@example.com
docker compose run --rm builder admin approve -data /data -email someone@example.com
docker compose run --rm builder admin disable -data /data -email someone@example.com

12. Troubleshooting

SymptomCause and fix
docker compose build fails with could not read Username / 404 for GoUtilstoken missing or without access: GOUTILS_TOKEN=… docker compose build, token has Contents: read on GoUtils
Browser: certificate error / ERR_SSL_PROTOCOL_ERRORDNS does not point to the server yet (dig +short …), or port 80/443 blocked; docker compose logs caddy names the domain and the reason
permission denied in a logsudo chown -R 65532:65532 data sites caddy
Site not online after approvaldocker compose logs deployer: no Public address set, domain used by another site or the builder, or not a static export
www. shows a certificate errorwww.<domain> has no DNS record pointing to the server (for subdomain sites: www.<name>.<your domain>, § 3); add it, or set WWW_REDIRECT=false and docker compose up -d deployer
Contact form: "The form is not set up yet"neither GRAPH_FROM (+ MSGRAPH_*) nor SMTP_HOST/SMTP_FROM set; fix .env, docker compose up -d forms
Contact form: "Sending failed"docker compose logs forms: wrong secret, missing admin consent for Mail.Send, or the access policy does not include the sending mailbox
No mails at allNOTIFY_FROM and MSGRAPH_* in .env, then docker compose up -d builder; docker compose logs builder | grep -i mail
Locked out of the admin areaadmin reset-2fa (above), sign in, set up 2FA again
Disk fulldu -sh data/*; old backups (-backup-keep), uploads; docker system prune removes old images

More: docker.md (how the containers are built and why), deploy.md (operations runbook), reference.md (every command and setting).