Your own trunk
A small server you rent, at a provider and in a country you choose. Your phone and your computers all reach it. Your computers dial out to it, so nothing at home opens a port.
What you need
- A server: Linux x86_64 with systemd, Debian 11+ or Ubuntu 20.04+ (tested on Debian 12). The smallest plan is enough: 1 CPU, 512 MB. Admin access (
sudo). - A name for it on a domain you own, for example
trunk.example.org: a DNS record (A, and AAAA if it has IPv6) pointing at the server. - Ports 443 and 80 open, also in your provider's firewall panel. 443 carries everything, voice included. 80 is only for Let's Encrypt.
Install it
curl -fsSLO https://github.com/veraldar/yggdrasil/releases/download/v0.9.1/trunk.sh sudo bash trunk.sh --name trunk.example.org
It checks the server first, then downloads the trunk and checks it: the signature, then the checksum. It makes the server's key and gets a certificate that renews by itself. It turns the firewall on with only ssh, 443 and 80 open (if other services listen there, it says which and leaves the firewall as it is), turns on Debian's automatic security updates, and checks once a week for a newer signed release.
It ends with one connect line, wss://trunk.example.org/ap#pin=…,token=…. It is shown once. Paste it at home when install.sh asks (step 2), never in a command: the token in it is a secret. The server keeps only a fingerprint of it.
Lost the line? sudo bash trunk.sh --rotate-token prints a new one, and the old one stops working.
Good to know
- No
sudoon the server? Log in as its admin user and leave the word out. Nocurl?apt install curlfirst. - Running it again is safe. It keeps the key and the token, so your home computer needs nothing new.
- A website already on that server: run it with
--behind-proxy. It prints how to share port 443 by name; your website keeps its own certificate. The details. - Take it away:
sudo bash trunk.sh --uninstalllists what it removes and asks first. - What the server can see →
Check the release yourself, before running anything
curl -fsSLO https://github.com/veraldar/yggdrasil/releases/download/v0.9.1/trunk.sh curl -fsSLO https://github.com/veraldar/yggdrasil/releases/download/v0.9.1/SHA256SUMS curl -fsSLO https://github.com/veraldar/yggdrasil/releases/download/v0.9.1/SHA256SUMS.sig echo 'release@yggdrasil namespaces="yggdrasil-release" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJyKwTSmRf3Cy1cHpzKHl3teRvCQtgK8/dcFRvlNCDJg' >allowed_signers ssh-keygen -Y verify -f allowed_signers -I release@yggdrasil -n yggdrasil-release -s SHA256SUMS.sig <SHA256SUMS sha256sum --ignore-missing -c SHA256SUMS
It needs ssh-keygen, which every server you reach by ssh has. The same key is written into every script, which never fetches the key it checks with.