ezvpnguides

Set up a server

One ezvpn server runs on one device at a site — a home LAN, an AWS VPC — and clients dial it by its endpoint ID, so it needs no public IP and no open inbound port. This guide installs the CLI, gives the server its identity, authorizes client keys, and starts it. With no routes, a client then reaches the server host itself at its VPN address; to reach the other devices at the site, continue with Reach the whole site LAN.

Install ezvpn

The same ezvpn binary is the server and the CLI client. It creates a TUN device and edits routes, so it runs as root on Linux and macOS and as Administrator on Windows.

Linux and macOS

curl -sSL https://flexaccessdev.github.io/ezvpn/install.sh | sudo bash

The binary goes in /usr/local/bin. Prebuilt binaries cover Linux amd64 and arm64 and Apple Silicon macOS; on other Macs, build from source.

Windows

Run this from an elevated (Administrator) PowerShell:

irm https://flexaccessdev.github.io/ezvpn/install.ps1 | iex

It installs the binary in %ProgramData%\ezvpn and adds that directory to the machine PATH. Windows also needs wintun.dll from WinTun:

  1. Download and extract the WinTun zip.
  2. Copy wintun/bin/amd64/wintun.dll next to ezvpn.exe (by default %ProgramData%\ezvpn\) or into a directory on the system PATH.

Failed to create TUN device: LoadLibraryExW failed means Windows cannot find the DLL.

A specific release, or a prerelease

Linux and macOS
curl -sSL https://flexaccessdev.github.io/ezvpn/install.sh | sudo bash -s <RELEASE_TAG>
curl -sSL https://flexaccessdev.github.io/ezvpn/install.sh | sudo bash -s -- --prerelease
Windows PowerShell
& ([scriptblock]::Create((irm https://flexaccessdev.github.io/ezvpn/install.ps1))) <RELEASE_TAG>
& ([scriptblock]::Create((irm https://flexaccessdev.github.io/ezvpn/install.ps1))) -PreRelease

From source

With a Rust toolchain, from a clone of the repository:

git clone https://github.com/flexaccessdev/ezvpn
cd ezvpn
cargo install --path .      # or: cargo build --release

Give the server its identity

The server's identity is a secret key file. Its public half is the server's endpoint ID, the stable address clients dial instead of an IP and port:

ezvpn generate-server-key --output ./vpn-server.key
ezvpn show-server-id --secret-file ./vpn-server.key    # print the endpoint ID

Keep the key safe: a new key means a new endpoint ID, and every client has to be given it.

Authorize client keys

Each client makes its own keypair, keeps the secret half, and sends you only its public entry — a line like ed25519-pub:… alice laptop. The CLI makes it with flexaccess-keys (see Install and make a key); the macOS and iOS, Windows, and Android apps generate keys themselves.

On the server, collect the entries in an authorized_keys file, one per line. Lines starting with # and blank lines are ignored.

authorized_keys
# who may connect
ed25519-pub:AAAA...  alice laptop
ed25519-pub:BBBB...  build server

The server reads this file at startup and needs at least one key in it. Restart the server after adding or removing a key.

Write the server config

The smallest config sets an IPv4 address pool, the authorized keys, and the identity key:

vpn_server.toml
role = "vpnserver"

[network]
network = "10.0.0.0/24"

[auth]
authorized_keys_file = "./authorized_keys"

[iroh]
secret_file = "./vpn-server.key"

Unknown settings are an error at startup. The annotated vpn_server.toml.example has every setting.

SettingWhat it does
roleAlways "vpnserver".
[network] networkThe IPv4 VPN prefix clients get addresses from. The server takes the first address (10.0.0.1) unless you set server_ip.
[network] network6The IPv6 VPN prefix, for dual stack or IPv6 only, for example fd00::/64. At least one of network and network6 is required.
[network] ip6_strategy"sequential" (default) hands out fd00::2, fd00::3, …; "node-id" derives each address from the peer's node ID (needs a /64 or wider, and no server_ip6).
[auth] authorized_keys_fileThe file of client public keys described above.
[iroh] secret_fileThe server's identity key.
[iroh] relay_urls, relay_auth_token, relay_quic_addr_discoveryCustom relays; see Relays and address lookup.

Relative paths are resolved against the directory the server is started from, not the config file's, so under a service manager use absolute paths.

Pick VPN prefixes that overlap neither the networks clients need to reach nor the LANs they connect from. The server caps concurrent clients at 254, and a smaller address pool can limit that further. The example IPv4 /24 has room for 253 clients after reserving the server, network, and broadcast addresses.

An IPv6-only server leaves out network:

vpn_server.toml (IPv6 only)
[network]
network6 = "fd00::/64"
ip6_strategy = "node-id"   # or leave out for sequential

Start the server

sudo ezvpn server start -c vpn_server.toml

Or keep the config in the system config directory as vpn_server.toml and start with --default-config:

PlatformSystem config directory
Linux/etc/ezvpn
macOS/usr/local/etc/ezvpn
Windows%ProgramData%\ezvpn

On startup the server logs the command clients connect with, including its endpoint ID:

Clients connect with: ezvpn client start --server-node-id SERVER_ENDPOINT_ID --auth-key-file <KEY FILE>

Give that endpoint ID to each client. From a client whose key you authorized, connect and ping the server at its VPN address:

sudo ezvpn client start \
  --server-node-id SERVER_ENDPOINT_ID \
  --auth-key-file ./client.key

# in a second terminal
ping 10.0.0.1

The recording shows exactly this between two Linux hosts.

Loading the recording…

Real output from both hosts, nothing edited; pauses longer than two seconds are shortened on playback. The server's config is the four-setting one above.

The server runs in the foreground until Ctrl+C or SIGTERM; only one runs per machine. To keep it running across reboots, see Run it as a service. On a Windows server, also allow the VPN prefix through Windows Firewall.

Check on the server

ezvpn server status          # uptime, clients and their paths, packet counters
ezvpn server status --json
ezvpn server list            # server instances on this host

Neither needs root or Administrator. For log levels and where output goes, see Logs.

Relays and address lookup

A client finds the server by endpoint ID, then iroh hole-punches a direct path when it can, and falls back to a relay when it cannot. Traffic stays end-to-end encrypted, so a relay cannot read it. With no relay settings, both ends use the public default relays and iroh's address lookup.

Custom relays

One custom relay is enough. Set relay_urls and the server uses only those relays, with public address lookup off. Configure every client with the same full list (relay_urls in its config, or --relay-url).

vpn_server.toml
[iroh]
secret_file = "./vpn-server.key"
relay_urls = ["https://relay.example.com"]
# relay_auth_token = "your-shared-relay-token"
# relay_quic_addr_discovery = false
  • Failover requires at least two distinct relays. With a single relay, the server logs a startup warning about reduced redundancy.
  • relay_auth_token is a shared bearer token for a private relay deployment; the server, clients, and relays must all use the same one.
  • Set relay_quic_addr_discovery = false, on the server and the clients, for relays behind a Cloudflare Tunnel or another HTTP-only front.

More in the shared docs: relays and address lookup, and self-hosting a relay.

Restarts and reconnects

Clients reconnect on their own, so the server can be restarted, upgraded, or started after its clients (see Reconnect behavior). After changing network or network6, restart the clients too.

Reaching more than the server host

To reach other devices on the server's network, add --route for IPv4 prefixes or --route6 for IPv6 prefixes on the client. The server host needs IP forwarding, firewall rules that allow forwarding, and a return path for the VPN prefix. ezvpn never touches the host's firewall or NAT; Reach the whole site LAN walks through it.

Upgrade both ends together

The server and clients must speak the same protocol version. Releases that share a protocol version can connect to one another.

To see which protocol each end speaks, run ezvpn --version on the server and on any CLI client. It prints the release and the protocol, as in ezvpn X.Y.Z (protocol N). The Apple, Android and Windows apps show the same number in their footer, after the core version: core X.Y.Z · protocol N. Older releases may omit the protocol number. In that case, check VPN_PROTOCOL_VERSION in src/tunnel/signaling.rs at the reported core release tag.

When an upgrade changes the protocol version:

  1. Upgrade the server and every client.
  2. Compare your configs with the current server and client examples, since unknown or removed settings are rejected at startup.
  3. Keep the server's identity key so clients can keep dialing the same endpoint ID. If a client still cannot connect, check its authorized key, relay settings, and the logs on both ends. As a last resort, regenerate the server's identity key. That changes the endpoint ID, so update every client profile with the new one.

Command reference

CommandWhat it does
ezvpn server startStart the server from -c, --config <FILE>, or from vpn_server.toml in the system config directory with --default-config.
ezvpn server statusUptime, connected clients with addresses and paths, packet counters. --json.
ezvpn server listServer instances on this host. --json.
ezvpn generate-server-key-o, --output <PATH> writes a new identity key. --force overwrites an existing file; --json.
ezvpn show-server-id-s, --secret-file <PATH> prints the endpoint ID of a key. --json.

Environment variables

VariableEffect
RUST_LOGLog filter; see Logs.
EZVPN_RUNTIME_DIRMoves the runtime directory; see The runtime directory.

Testing knobs

For measuring throughput, server start and client start accept two command-line-only flags. Each governs only the local sender, so the two ends can differ.

FlagEffect
--congestion-control <NAME>cubic (default), bbr3, or new-reno.
--congestion-initial-window <BYTES>Initial congestion window, from 2660 to 8388608. Default 12000.

Measurements are in Benchmarks, and the internals in Architecture.