Nocward
Unified Network Tools
Unified Network Tools How-to guides 4 min read

Set up a VPN server for the app

What a WireGuard, OpenVPN or IKEv2/IPsec server needs so the app can connect to it, and what to give each phone.

Last updated 26 November 2026

The app connects to any standard WireGuard, OpenVPN or IKEv2/IPsec server: a router, a firewall or a Linux server. Each device has its own menus and commands. This page lists what the server must have and what each phone needs, so you can follow your device’s own documentation with a clear target.

Before you start

  • The server needs a public address or DNS name. If it sits behind NAT, forward the VPN port to it.
  • Give VPN clients their own address range that doesn’t overlap the office LAN or common home networks, for example 10.66.2.0/24.
  • Allow the VPN port in the server’s firewall, above any rule that drops everything else.
  • Make one client per phone - its own key, certificate or login - so you can remove one phone without touching the others.
  • Back up the server’s configuration before you change it.
Type Port to open What the phone needs
WireGuard UDP 51820 (or any port you choose) its VPN address, the server’s public key, the server as host:port
OpenVPN UDP or TCP 1194 the CA certificate, a client certificate and key, a TLS key if used, a login if the server asks
IKEv2/IPsec UDP 500 and 4500, and ESP the server address, the pre-shared key or a certificate, an identity

WireGuard

  1. On the server, create a WireGuard interface with a listen port and give it the first address of the VPN range, for example 10.66.2.1/24.
  2. In the app: Add VPN → New WireGuard connection. The app makes the phone’s key pair. Copy its Public key.
  3. On the server, add a peer with that public key and the phone’s address as the allowed address, for example 10.66.2.2/32.
  4. Allow the UDP port in the firewall. To send All traffic through the VPN, the server must also route and NAT the VPN range to the internet.
  5. In the app, fill in This phone’s VPN address, Server public key and Server address (host:port), choose All traffic, then Save and Connect.

The server side in the standard WireGuard format looks like this:

[Interface]
Address = 10.66.2.1/24
ListenPort = 51820
PrivateKey = SERVER_PRIVATE_KEY

[Peer]
# phone1
PublicKey = PHONE_PUBLIC_KEY
AllowedIPs = 10.66.2.2/32

If your server can show a peer as a QR code, scan it in the app instead of typing the fields.

OpenVPN

  1. Create a certificate authority (CA), a server certificate for the server’s public address, and one client certificate per phone.
  2. Set up the server on port 1194 (UDP is faster, TCP passes stricter networks). Require the client certificate. AES-256-GCM with SHA256 is a good choice.
  3. To send all traffic through the VPN, push the default route and a DNS server to clients.
  4. If the server also asks for a user name and password, create a login for each phone.
  5. Export the CA certificate, the client certificate and the client key as PEM files. If the key is exported with a password, note it.
  6. In the app: Add VPN → New OpenVPN connection. Fill in the server, port, protocol, cipher and digest, pick the three files, and type the Private key password and the login if you have them.

If your server can export an .ovpn file for the client, open that file in the app instead: it carries all of the above.

IKEv2/IPsec with a pre-shared key

IKEv2 uses Android’s own VPN client (Android 11 or later).

  1. Create an address pool for clients, for example 10.66.3.0/24, and a DNS server to hand out.
  2. Offer proposals Android supports: AES-256 or AES-128 (GCM or CBC), SHA-256, and Diffie-Hellman group 14 (MODP 2048) or 19 (ECP 256).
  3. Add a peer that accepts IKEv2 with pre-shared key authentication. Use a long, random key.
  4. In the firewall, allow UDP 500 and 4500 and the ESP protocol in, and allow forwarding of traffic that comes from the client pool.
  5. In the app: Add VPN → IKEv2/IPsec. Enter the server address, choose PSK, type an identity (for example phone1) and the key.

Important

Don’t skip the forwarding rule in step 4. Without it IKEv2 connects but nothing loads: the decrypted traffic arrives on the internet side of the server, and the usual rule that drops unsolicited traffic from the internet drops it.

Check that it works

  • Connect from the VPN screen. For WireGuard, the profile shows when the last handshake happened.
  • Open a site or ping an office address. If the VPN connects but nothing opens, check routing, NAT and DNS on the server.

Next

Was this page helpful?

Have an idea for the product itself? Suggest an idea