Installation
The Gateway ships as a single static binary plus an installer script. The installer is profile-driven: it knows the difference between a Raspberry Pi running an embedded WiFi AP and a remote VPS acting as a federation peer.
System requirements
Section titled “System requirements”| Component | Minimum | Notes |
|---|---|---|
| OS | Debian 12+ or Ubuntu 22.04+ | apt-based distributions only |
| Kernel | Linux 5.15+ | In-kernel WireGuard and nftables required |
| Architecture | amd64 or arm64 |
No 32-bit support |
| RAM | 1 GB (node) / 2 GB (Pi) | More for high-throughput splitting |
| Storage | 2 GB free | SQLite + logs + TLS state in /var/lib/gateway/ |
| NICs | 1 (VPS) / 2 (Pi embedded) | WAN + LAN for embedded mode |
| Privilege | root | Required for nftables, ip rule, systemd unit installation |
Install profiles
Section titled “Install profiles”The installer accepts a --profile flag that controls which packages and subsystems get provisioned.
| Profile | Use it for | Includes |
|---|---|---|
rpi |
Raspberry Pi 4 home gateway | WiFi AP (hostapd + dnsmasq), Tailscale, redsocks, SD hardening, build deps |
vps |
Remote Linux VPS | Mesh, redsocks, no WiFi, no SD tweaks |
node |
Federation peer / minimal node | Bare gatewayd + base packages only |
full |
Maximal install | Everything above + Gitea + Ollama + Go toolchain |
custom |
Operator-defined component set | Interactive prompts for each subsystem |
Quick install
Section titled “Quick install”git clone https://example.invalid/gateway.gitcd gatewaysudo ./scripts/install-gateway.sh --profile rpiThe rpi profile additionally:
-
installs
hostapdanddnsmasqfor the integrated WiFi AP -
enables the
wlan0regulatory domain -
tunes SD card mount options (
noatime, log to tmpfs) -
pins CPU governor to
ondemand -
pre-pulls the ARM64 build chain for in-place rebuilds
curl -fsSL https://thegateway.pro/install.sh | sudo bashThe bootstrap honours these environment variables:
| Variable | Default | Effect |
|---|---|---|
GATEWAY_PROFILE |
vps |
Install profile (see table above) |
GATEWAY_VERSION |
latest |
Pin a specific release tag |
GATEWAY_FROM_SOURCE |
0 |
Set to 1 to compile from source |
GATEWAY_BASE_URL |
CDN | Override download mirror |
GATEWAY_UPDATE |
0 |
Set to 1 to upgrade an existing installation |
sudo ./scripts/install-gateway.sh \ --profile vps \ --binary /tmp/gatewayd-linux-arm64Use this when you’ve cross-compiled the daemon elsewhere and want to skip the download.
git clone https://example.invalid/gateway.gitcd gatewaygo build -o gatewayd ./cmd/gatewayd/sudo install -m 0755 gatewayd /usr/local/bin/sudo ./scripts/install-gateway.sh --profile node --skip-binaryCross-compilation for the Pi from x86 dev box:
GOOS=linux GOARCH=arm64 go build -o gatewayd-arm64 ./cmd/gatewayd/What the installer does
Section titled “What the installer does”-
Installs OS packages for the selected profile:
nftables,wireguard-tools,iproute2,redsocks,unbound-anchor, optionallyhostapd,dnsmasq,tailscale,headscale. -
Creates the runtime layout:
/usr/local/bin/gatewayd ← daemon binary/usr/local/bin/gwctl ← CLI tool/etc/gateway/tls/{ca,server}.crt ← internal CA + server cert (ECDSA P-256)/etc/gateway/tls/{ca,server}.key/var/lib/gateway/config.yaml ← bootstrap config (YAML)/var/lib/gateway/gateway.db ← SQLite store/etc/systemd/system/gatewayd.service -
Generates a self-signed internal CA and a server certificate so the API listens over TLS from the first boot.
-
Writes the bootstrap config based on profile defaults. You can edit it before enabling the service.
-
Enables the systemd unit but does not auto-start it — review the config first.
Network modes
Section titled “Network modes”Choose a network.mode in your bootstrap config:
| Mode | NICs | Use it for |
|---|---|---|
primary |
Manages WAN + LAN, runs DHCP | Dedicated home or office gateway |
embedded |
Sits inline between router + LAN | Adding The Gateway to an existing home network without replacing the ISP router |
portable |
Single NIC | Travel router, laptop, ad-hoc deployments |
Start the daemon
Section titled “Start the daemon”sudo systemctl enable gatewaydsudo systemctl start gatewaydsystemctl status gatewaydjournalctl -u gatewayd -fHealth check:
curl -k https://127.0.0.1:8080/health# → {"status":"ok"}Open the web UI
Section titled “Open the web UI”https://<gateway-ip>:8080The first hit lands on the setup wizard, which creates the admin account and walks you through:
- Admin username + password (stored as bcrypt hash)
- Network mode confirmation (
primary/embedded/portable) - WiFi AP SSID + WPA2 passphrase (Pi only)
- First WireGuard tunnel (paste or generate)
- Default privacy class
After setup the wizard hands you off to the dashboard.
Updating
Section titled “Updating”GATEWAY_UPDATE=1 curl -fsSL https://thegateway.pro/install.sh | sudo bashThe update procedure:
- Sends
SIGTERMtogatewaydand waits for a clean SQLite WAL flush (neverSIGKILL). - Snapshots the old binary to
/usr/local/bin/gatewayd.bak.<timestamp>. - Installs the new binary.
- Starts the daemon and waits up to 4 seconds for
/healthto returnok. - Rolls back to the snapshot if the health check fails.
Uninstall
Section titled “Uninstall”sudo systemctl stop gatewaydsudo systemctl disable gatewaydsudo rm /etc/systemd/system/gatewayd.servicesudo rm -rf /etc/gateway /var/lib/gateway /usr/local/bin/gatewayd /usr/local/bin/gwctlsudo nft delete table inet gateway # remove the firewall tableNext steps
Section titled “Next steps”The daemon is up. In order of what most operators do first:
- Run the quick start. Add one tunnel, one policy, one device, and verify the kill-switch works. 10 minutes.
- Set the secrets passphrase. The daemon auto-generated one on first boot — override it with one you control and store a copy off-box.
- Pick a posture. Skim the threat model so the next decisions you make match the protections you actually need.
- Take a baseline backup.
gwctl backup export > /var/backups/gateway-init.json— sanitized plaintext, useful when comparing against future state. For the encrypted-with-secrets variant see Backup.
Related
Section titled “Related”- Configuration — what each section of
config.yamlcontrols. - Sizing & performance — capacity expectations for the hardware you just installed on.
- FAQ — common pre-install questions.