RoamSwitch Pocket WireGuard setup

This page opens from the “Guide” QR code on the “WireGuard setup” screen of RoamSwitch Pocket. The Pocket's private key stays inside the Pocket and is never shown on this page or on your PC.

1. Register the Pocket on the server

Add the following [Peer] to the server's WireGuard configuration, then reload WireGuard on the server. AllowedIPs is the address you assign to the Pocket (e.g. 10.66.0.2/32).

[Peer]
PublicKey = <Pocket public key>
AllowedIPs = 10.66.0.2/32

2. Create wg0.conf on your PC

Change the values in the template below to match your server. Do not write a PrivateKey line. The Pocket adds its own key when it imports the file.

[Interface]
Address = 10.66.0.2/32
DNS = 1.1.1.1

[Peer]
PublicKey = (server public key)
Endpoint = 203.0.113.10:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25

Write Endpoint as an IPv4 address and port number. Host names cannot be used. If you leave out DNS, 1.1.1.1 is used.

3. Send it to the Pocket over SSH

In the folder that contains wg0.conf, run the following on your PC. The password is that of the Pocket user <user name>. Connect the PC and the Pocket to the same network.

scp wg0.conf <user name>@<Pocket IP address>:~/wg0.conf

4. Import it on the Pocket

On the Pocket screen, close the “Guide” QR code with ESC, then press 6 “Import” on the “WireGuard setup” screen. After the import, ~/wg0.conf is deleted. The setting is used from the next time protection starts.

If it does not connect

  • Check that the server's UDP port (e.g. 51820) can be reached from outside.
  • If you run the server in a Docker Desktop (Mac) container, traffic from smartphones and other devices does not get through. Run the server on the host.
  • If scp cannot connect, check that SSH is running on the Pocket (sudo systemctl enable --now ssh).