How to set up your own VPN with WireGuard
Updated 11/29/2026
Your own VPN gives you private browsing and a dedicated IP address, without depending on commercial services. WireGuard is modern, fast and easy to configure.
1. Install
apt-get update -y
apt-get install -y wireguard
2. Generate the server keys
wg genkey | tee server_private.key | wg pubkey > server_public.key
3. Configure the interface
Create /etc/wireguard/wg0.conf:
[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = SERVER_PRIVATE_KEY
[Peer]
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.0.0.2/32
4. Start the VPN
systemctl enable --now wg-quick@wg0
5. Open the port in the firewall
ufw allow 51820/udp
On the client device, install the WireGuard app and import the config with the server public key. A small plan is enough for a personal VPN, see the plans.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
Single sign-on for your applications with authentik
One account for all your team's apps: first sign-in, users, an OpenID Connect application and two-factor authentication.
Updated 11/29/2026SecurityPasswordless sign-in with Pocket ID
Passkeys for your applications over OpenID Connect: first sign-in, colleagues and connecting an application.
Updated 11/29/2026SecurityHow to protect your server from brute-force attacks with fail2ban
fail2ban automatically bans IPs that repeatedly try wrong passwords. Here is how to install and configure it.
Updated 11/29/2026