How to set up your own VPN with WireGuard
Updated 7/20/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
How to scan your server for malware with ClamAV
Install ClamAV, an open-source antivirus, and periodically scan your server for infected files.
Updated 7/20/2026SecurityHow to check which ports are open on your server
Find out which services are listening for connections on your server and close what you do not need, for less exposure.
Updated 7/20/2026SecurityHow to add security headers to your website
A few HTTP headers protect your visitors from common attacks like clickjacking and content injection.
Updated 7/20/2026