Best for · VPN

WireGuard VPN server: how to run your own, and when to just buy a VPN

We read every plan page. Paid links are labelled. Money never changes a ranking. How we pick.

Verdict Our pick

The bar guide has a call.

The vectaai bar guide pointing at the verdict
  • your own WireGuard server if you want to reach your home network from outside, or you want one fixed IP you control.
  • a commercial VPN instead if you want many countries, streaming, or privacy from your server's hosting company.

Compared here

  • 01WireGuard on a cloud server
  • 02WireGuard at home
  • 03Proton VPN
  • 04Surfshark

Short answer

A WireGuard VPN server is a small Linux machine running WireGuard, which its makers describe as "extremely simple yet fast and modern". The cheapest route is a small cloud server: DigitalOcean's smallest Basic droplet is $4 a month. Install with sudo apt install wireguard on Ubuntu, make a key pair, write one config file, open one UDP port, and add your phone with the official app. Budget an evening the first time.

Pick your own WireGuard server if you want to reach your home network from outside, or you want one fixed IP you control. Pick a commercial VPN instead if you want many countries, streaming, or privacy from your server's hosting company. A server you rent is tied to your name and card, so it hides you from the café Wi-Fi, not from the world.

Proton VPN: no server to runSurfshark: no server to run

Sponsored links. We may earn a commission; it never changes the pick.

At a glance

From wireguard.com, DigitalOcean's droplet pricing and Proton VPN's pricing page, read 3 December 2026. Prices in US dollars as shown to us.
RouteMonthly costGood forNot good forEffort
WireGuard on a cloud serverFrom $4 (DigitalOcean's smallest droplet: 512 MiB, 1 vCPU, 500 GiB transfer)Fixed IP you control, safe public Wi-FiAnonymity, many countriesAn evening, then updates
WireGuard at home (router or Raspberry Pi)Hardware you own, plus electricityReaching your home files, cameras, NASHiding your home IPAn evening plus router port forward
Commercial VPN (Proton VPN)VPN Plus from $3.49/mo on a 2-year term, renews $83.88/yrMany countries, streaming, no adminReaching your home networkMinutes

Money talk first. Running your own WireGuard server earns us nothing, and we still think it is the right answer for some of you. Proton VPN and Surfshark have affiliate programs and may pay us if you buy one instead. Read the section on who should not bother and decide for yourself.

We wrote this from the official WireGuard docs read on 3 December 2026. We did not benchmark speeds. The steps below are the standard path; your Linux version may differ a little, so keep the official page open.

What you are building

A WireGuard server is just a Linux machine with WireGuard installed and one config file. Your phone or laptop holds a matching config. When you connect, your traffic goes encrypted to that machine and out to the internet from there.

WireGuard's own site describes it as "extremely simple yet fast and modern" and says it "aims to be as easy to configure and deploy as SSH." It started in the Linux kernel and now runs on Windows, macOS, BSD, iOS and Android. One honest line from the same page: "All issues of key distribution and pushed configurations are out of scope of WireGuard." Translation: adding devices is your job.

Where to run it

  • A small cloud server. DigitalOcean's smallest Basic droplet is $4 a month: 512 MiB of memory, 1 vCPU, 10 GiB of SSD and 500 GiB of transfer. That is plenty for one person. Other hosts have similar small servers.
  • At home. A router that supports WireGuard, such as one running OpenWrt (see the OpenWrt server guide), or a small always-on computer. This is the one to pick if the point is reaching your home files, cameras or NAS from outside.

Step by step on Ubuntu

1. Install. From the install page:

sudo apt install wireguard

On Debian it is apt install wireguard as root; releases older than Bullseye need backports first.

2. Make a key pair. From the quick start:

umask 077
wg genkey | tee privatekey | wg pubkey > publickey

Do the same on each client, or let the client app generate its own keys.

3. Write the server config at /etc/wireguard/wg0.conf:

[Interface]
Address = 10.8.0.1/24
ListenPort = 51820
PrivateKey = <server private key>

[Peer]
PublicKey = <phone public key>
AllowedIPs = 10.8.0.2/32

The 51820 port is the one the official quick start uses in its example. Any free UDP port works. Each device gets its own [Peer] block and its own address.

4. Let the server forward traffic. If you want all your internet traffic to go through the server, turn on IP forwarding (net.ipv4.ip_forward=1 in sysctl) and add a NAT rule for your server's outside network interface. Most distribution guides show the exact firewall lines for your setup. Skip this step if you only want to reach the server or your home network.

5. Open the port. Allow inbound UDP on your ListenPort in the server firewall and in your cloud provider's firewall. At home, forward that UDP port on your router.

6. Start it.

sudo systemctl enable --now wg-quick@wg0
sudo wg show

The quick start says wg-quick automates the routine bring-up and tear-down steps. wg show lists peers and shows a recent handshake once a device connects.

Adding your phone and laptop

Official apps exist for Windows, macOS (Mac App Store), iOS (App Store) and Android (Google Play), per the install page. In the client, set:

  • Address: the peer address you gave it, like 10.8.0.2/32.
  • Endpoint: your server's public IP and port.
  • AllowedIPs: 0.0.0.0/0 sends all traffic through the tunnel; your home subnet only sends just that.
  • PersistentKeepalive = 25: the quick start suggests 25 seconds for peers behind NAT so the tunnel stays open.

Most apps can import a config by QR code, which saves typing keys on a phone.

What WireGuard itself says it cannot do

Before you build a server, read the project's own known limitations, read 4 December 2026. Three lines matter for a home built VPN:

  • No obfuscation. "WireGuard does not focus on obfuscation." If a network blocks VPN traffic by its shape, that has to be handled "at a layer above WireGuard".
  • No TCP. "WireGuard explicitly does not support tunneling over TCP." The page points to tools like udptunnel and udp2raw for wrapping UDP, and blames TCP over TCP performance problems. So if you sit behind a network that only allows TCP, such as some hotel Wi-Fi, a plain WireGuard server may not connect.
  • Roaming. The page says roaming "happens without an additional round trip or other authentication", and that an active man in the middle could replace source IP addresses. It adds that ordinary firewalling can lock the WireGuard socket to a particular IP address.

The page does not discuss logging or dynamic IP assignment. That is your own server, so what gets logged is your choice, but you do have to open a UDP port, and check your provider allows it.

Practical consequence: your own server is great for reaching home and for safe public Wi-Fi. It is not a way to get around a network that blocks VPNs, and the page says as much by leaving obfuscation to other layers. If you are on a network that restricts VPN use, follow that network's rules.

Keep it healthy

  • Keep the server's system updated, since it is exposed to the internet.
  • Open only the UDP port WireGuard uses and SSH.
  • Keep one config backup somewhere safe, away from the server.
  • Remove a device's key when you lose the device.

Who should not bother

Be honest with yourself here. A self-hosted server is a bad fit if:

  • You want privacy from websites and trackers. Your server's IP is rented in your name. Websites see one fixed IP that leads back to your account.
  • You want to stream from other countries. One server in one country does not help, and streaming services know cloud IP ranges. See our VPN for streaming guide.
  • You will never update it. A forgotten server is a risk. Security updates are your job now.

For those cases a commercial service is easier. Proton VPN VPN Plus is $3.49 a month on a 2-year term ($83.76 upfront), renewing at $83.88 a year, with 10 devices and a 30-day money-back guarantee. Try it at Proton VPN. Our Surfshark review covers the other big option, also at Surfshark.

Troubleshooting in one minute

  • No handshake in wg show: the UDP port is blocked somewhere, or the keys are swapped. Public key of the phone goes on the server, and the other way round.
  • Connected but no internet: IP forwarding or the NAT rule is missing.
  • Drops after a while on mobile: add PersistentKeepalive = 25 on the client.

How we checked

We read the WireGuard home page, quick start and install page, DigitalOcean's droplet pricing and Proton VPN's pricing page on 3 December 2026. Prices were shown in US dollars. We did not test speeds. More VPN pages in the VPN hub; method on how we pick.

Questions people ask

How do I set up a WireGuard VPN server?

On Ubuntu: install with sudo apt install wireguard, generate keys with wg genkey and wg pubkey, write /etc/wireguard/wg0.conf with an address, listen port and your private key, turn on IP forwarding, allow the UDP port in your firewall, then start it with wg-quick. Add each device as a peer with its own key and address.

What port does WireGuard use?

Whatever you set as ListenPort. The official quick start uses 51820 in its example, and most guides copy that, but WireGuard does not force it. It is UDP only. Whatever you pick, open that UDP port in the server's firewall and, at home, forward it on your router.

Is a self-hosted WireGuard VPN private?

It encrypts your traffic between your device and your server, so the café or hotel Wi-Fi cannot read it. But websites see your server's IP, and that server is rented in your name or sits at your home address. For hiding who you are, a self-hosted VPN does less than a commercial no-logs service.

Can I run a WireGuard server at home?

Yes, on a router that supports it, such as OpenWrt, or a small always-on computer. You need to forward the UDP port on your router, and a dynamic DNS name if your home IP changes. It is the best way to reach your own files and devices while away.

Is WireGuard better than OpenVPN?

WireGuard says it aims to be faster, simpler and leaner than IPsec and as easy to set up as SSH, with a much smaller codebase. In practice its config is shorter and it reconnects quickly on phones. OpenVPN is older, more widely supported in strict networks, and runs over TCP when UDP is blocked.

Sources

Every fact above comes from these pages. Prices change, so each one carries the date we read it.

  1. WireGuard home page, checked 3 Dec 2026
  2. WireGuard quick start, checked 3 Dec 2026
  3. WireGuard installation, checked 3 Dec 2026
  4. DigitalOcean droplet pricing, checked 3 Dec 2026
  5. OpenWrt: WireGuard server guide, checked 3 Dec 2026
  6. Proton VPN pricing, checked 3 Dec 2026