Skip to content

Move the Hub to a new domain

Use this when your domain is expiring or you want a new one. The old domain keeps working until the last step, so nothing goes down while you move.

Create the same DNS records on the new domain that the old one has: an A record for the Hub (e.g. hub.new.example → 203.0.113.10) and one for every app domain. Wait until they resolve:

Terminal window
dig +short hub.new.example

On the Hub’s server, edit /opt/asdl-hub/.env:

PUBLIC_URL=https://hub.new.example
OIDC_EXTRA_AUDIENCES=https://hub.old.example
WG_ENDPOINT=hub.new.example:51821
  • OIDC_EXTRA_AUDIENCES keeps GitHub deploys working from workflows that still say hub: https://hub.old.example. Remove it once every workflow uses the new address.
  • WG_ENDPOINT is where nodes dial the Hub’s WireGuard tunnel. Keep the same port. Nodes pick up the new address on their next heartbeat: each agent checks that it resolves, then updates its tunnel and its WireGuard config. Agents older than December 2026 don’t, so update them first, or change the Endpoint line in /etc/wireguard/asdl-*.conf on those nodes by hand.

Add the new name to the dashboard’s nginx site (/etc/nginx/sites-available/asdl-hub) next to the old one, get a certificate for it, and restart:

Terminal window
sudo certbot --nginx -d hub.new.example
sudo systemctl restart asdl-hub

Check every node still shows online with asdl-hub nodes.

Set each app’s domain to its new name. The Hub writes the route and gets a certificate:

Terminal window
asdl-hub app set myapp domain=myapp.new.example

Then update the hub: address in each repository’s deploy workflow.

Until the old domain expires, redirect it to the new one so bookmarks and links still work. In nginx, a 308 keeps the method and body, so API calls are redirected correctly too:

server {
listen 443 ssl;
server_name myapp.old.example;
ssl_certificate /etc/letsencrypt/live/myapp.old.example/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/myapp.old.example/privkey.pem;
return 308 https://myapp.new.example$request_uri;
}

Don’t forget things outside the Hub that store the address: OAuth redirect URLs, webhooks, phones or laptops with a WireGuard profile for the Hub, and email addresses on the old domain.