CloudLinux.ro
Security

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 pricing

Related tutorials