Deployment guide

WireGuard on a VPS: a fast, lean and private VPN

Deploy on a VPS Cloud →

Tutorial

Security & Monitoring

WireGuard on a VPS: a fast, lean and private VPN

WireGuard gets straight to the point: little configuration, very good performance and official clients on every platform. On a ServOrbit VPS, it becomes a private entry point to your internal services or your team network, with an exit address that belongs to you alone. This guide keeps the installation simple while laying the groundwork: prerequisites, first access to the wg-easy interface, clients, routing and UDP exposure.

7 min read6 steps
Contents· Why host WireGuard Server on a VPS?1/7
  1. 01Why host WireGuard Server on a VPS?
  2. 02What you can do with WireGuard Server
  3. 03Prerequisites
  4. 04Install WireGuard Server on your ServOrbit VPS
  5. 05Secure the admin interface
  6. 06Full tunnel or split tunnel
  7. 07The official documentation

Why host WireGuard Server on a VPS?

WireGuard is built on a deliberately small source code (about 4,000 lines), which makes it easier to audit and significantly less exposed to security flaws than its alternatives. By hosting it on a dedicated VPS, you obtain a fixed IP address under your control, throughput close to the server's native bandwidth, and the ability to grant or revoke access at the client's granularity. It is the preferred solution of developers and distributed teams who want to secure their communications without sacrificing performance.

Three things set it apart from a commercial VPN. The exit address is shared with no one, so you can add it to the allowlist of an API, a back office or a client's firewall. The logging policy is yours, since nobody else runs the machine. And the protocol stays lean: a single UDP port, fixed cryptography (Curve25519 for key exchange, ChaCha20 and Poly1305 for authenticated encryption) and a tunnel that survives a change of IP address, for instance when a device moves from Wi-Fi to 4G.

What you can do with WireGuard Server

  • Secure the connections of your remote-working team via a private corporate VPN
  • Get a fixed exit IP address to declare in the allowlists of an API, a back office or a partner's firewall
  • Access your internal network (servers, databases, internal services) from anywhere in an encrypted way
  • Bypass network restrictions and access your resources hosted in a specific region
  • Create a secure tunnel to protect communications between several VPSs or cloud environments
  • Replace a commercial VPN with a self-hosted, log-free solution with no monthly subscription
  • Connect mobile devices (Android, iOS) or workstations (Linux, Windows, macOS) via the official WireGuard clients

Prerequisites

WireGuard needs very few resources: with the wg-easy interface, 1 vCPU and 1 GB of RAM are enough for a small team, and the VPS bandwidth, not the CPU, sets the limit. The Marketplace template installs Ubuntu 24.04; the WireGuard module has been part of the Linux kernel since version 5.6, so there is nothing to compile.

Three things to plan before ordering:

The tunnel's UDP port (51820 by default) must be reachable from the internet. If a firewall filters traffic upstream, open it explicitly.

SSH access from your machine: the admin interface is never published, you reach it through an SSH tunnel.

A hostname (optional): an A record such as vpn.yourdomain.com pointing to the VPS IP makes client configurations easier to read and survives a server change. The bare IP address works too.

Install WireGuard Server on your ServOrbit VPS

  1. Order a ServOrbit Cloud VPS

    Go to /vps-cloud and choose the plan suited to your usage. For standard WireGuard usage (around twenty simultaneous clients), a VPS with 1 vCPU and 1 GB of RAM is enough. The WireGuard Server template installs on Ubuntu 24.04: finalize the order and wait for the activation email.

  2. Access the Marketplace in the client area

    Log in to your ServOrbit client area, open the page of your newly created VPS, then navigate to the Marketplace tab. There you will find the catalog of applications available for 1-click installation, organized by category. Select the Security category to find WireGuard Server more quickly.

  3. Start the WireGuard Server installation

    Click the WireGuard Server card, check the summary (tunnel port: UDP 51820), then confirm. The template deploys the wg-easy Docker container, which bundles WireGuard and its web interface: it publishes 51820/udp on the public IP, exposes the interface (port 51821) only on 127.0.0.1 and enables IPv4 forwarding (net.ipv4.ip_forward=1) inside the container. The operation usually takes a few minutes.

  4. Log in for the first time and create the admin account

    The admin interface is not published on the internet: first open a tunnel from your machine, then go to http://127.0.0.1:51821.

    ssh -L 51821:127.0.0.1:51821 root@<VPS-IP>

    No credentials are set in advance: the first-login wizard has you create the administrator account (a name of at least two characters, a password of at least 12 characters). It then asks for the host clients will reach (the VPS IP or vpn.yourdomain.com) and the UDP port, 51820 by default.

  5. Add your first client

    In the wg-easy interface, click New Client, enter a name (the user's first name or the device name) and, if the access is temporary, an expiry date. Then download the configuration file or scan the QR code, import it into the official WireGuard app (Android, iOS, Windows, macOS and Linux) and turn the tunnel on.

  6. Check the tunnel

    On the client, check your public exit IP: with a full tunnel, it must be the VPS's. On the server, display the peer status inside the container (docker ps gives its name):

    docker exec <wg-easy-container> wg show

    A recent latest handshake line for the peer confirms the tunnel is up. The wg-easy interface shows the same information: a client is marked Online when it has completed a handshake within the last ten minutes.

Secure the admin interface

Whoever reaches wg-easy can create clients, and therefore enter your network: treat this interface like root access.

Keep it on the loopback. The SSH tunnel is enough for day-to-day use. If you must publish it, put it behind an HTTPS reverse proxy (see our Caddy guide), declare the proxy address in the TRUSTED_PROXIES variable and leave INSECURE set to false; never serve it over plain HTTP.

Turn on two-factor authentication. From the user menu, the Account page enables a TOTP code to enter at every login.

Be wary of one-time links. wg-easy can generate a short download link valid for five minutes, but its documentation warns that these links can be guessed and hand over the client's private key without authentication. Prefer the QR code or the file, sent over a private channel.

Revoke cleanly. Disabling a client cuts its access while keeping its configuration; deleting it is final. An expiry date does the job on its own for a contractor or one-off access. If the admin password is lost, the cli db:admin:reset command, run inside the container, resets it.

Full tunnel or split tunnel

By default, wg-easy generates full-tunnel configurations: AllowedIPs = 0.0.0.0/0, ::/0, all the device's traffic leaves through the VPS. That is the right choice on public Wi-Fi, or to present the same exit IP everywhere.

To use the VPN only as a gateway to your private services, switch to a split tunnel: in Admin Panel → Config → Allowed IPs (global value) or on a client's page (value for that client only), keep only the VPN subnet, 10.8.0.0/24 in a default install, and the internal networks you need to reach. The rest of the browsing goes out through the local connection. The server holds the address 10.8.0.1: bind your databases, dashboards and back offices to it rather than to 0.0.0.0, and they become reachable only through the tunnel.

Note that AllowedIPs controls routing on the client side, and the user can change it. To enforce a restriction, wg-easy offers a per-client firewall (Admin Panel → Interface → Per-Client Firewall), applied server-side with iptables and still marked experimental: test it before relying on it. Beyond a handful of machines to link together, a mesh such as Netbird saves you from managing these lists by hand.

By default, WireGuard listens on UDP port 51820. If your network blocks non-standard UDP, move to 443/UDP or 53/UDP, two ports rarely filtered. With wg-easy, the port is not set in a wg0.conf file: change the listening port under Admin Panel → Interface, the port announced to clients under Admin Panel → Config, then the container's port mapping and the firewall rule, which must stay consistent. Restart the interface (Restart Interface) and redistribute the configurations: devices do not pick up the change on their own. IPv4 forwarding, required to route client traffic to the internet, is already enabled by the template inside the container.

The official documentation

For advanced configuration, tool-specific options and version changes, refer to the official WireGuard documentation and to the wg-easy documentation, the interface deployed by the template. This guide covers going live on a ServOrbit VPS; the vendor documentation remains the reference for fine-tuning.

Deploy WireGuard Server in minutes on a ServOrbit Cloud VPS

Enjoy a high-performance Cloud VPS with 1-click WireGuard installation — your private, secure VPN with no hidden fees.