Create the first hub
Start with direct egress and no devices. Add provider files only after the ingress and recovery path are known to work.
Prerequisites
Section titled “Prerequisites”- VPN Hub binaries installed on the host.
/etc/vpn-hubowned by root with mode0700.- The public endpoint
vpn.example.com:51820replaced with the operator’s host.
Generate the hub key
Section titled “Generate the hub key”sudo install -d -m 0700 /etc/vpn-hub /var/lib/vpn-hubsudo hubctl keygen --output /etc/vpn-hub/server.keyCopy the printed server_public_key into this configuration; the shown value is synthetic:
hub: endpoint: "vpn.example.com:51820" server_public_key: "W/kKaUP1n48AgIzxs8po0HKV+UEk1vMcTuBW648atSE=" client_cidr: "10.80.0.0/24" dns_address: "10.80.0.1"devices: []tunnels: []client_acls: []Write it to /etc/vpn-hub/hub.yaml with mode 0600, then run:
sudo touch /etc/vpn-hub/hub.yamlsudo chmod 0600 /etc/vpn-hub/hub.yamlsudoedit /etc/vpn-hub/hub.yamlsudo hubctl --config /etc/vpn-hub/hub.yaml validatesudo hubctl --config /etc/vpn-hub/hub.yaml deploy --dry-runExpected result: validate prints valid: revision=… tunnels=0 devices=0; the dry run says that nothing was written.
Apply and verify
Section titled “Apply and verify”sudo hubctl --config /etc/vpn-hub/hub.yaml deploysudo systemctl restart vpn-hub-agentsudo vpn-hub-agent statusOn the first deploy there is no previous revision, so a requested confirmation window cannot arm rollback. Preserve SSH access and check the agent journal.
Roll back
Section titled “Roll back”Before a first active revision there is nothing to restore. If the unused setup must be abandoned:
sudo systemctl disable --now vpn-hub-agentsudo rm -f /var/lib/vpn-hub/desired-state.jsonOnce a previous revision exists, use sudo hubctl rollback instead of deleting state.