Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Legends 

Build Your Own WireGuard VPN (2025 Edition)

[Image: legends3.gif]

Build Your Own WireGuard VPN (2025 Edition)

[Image: divider.gif]

Want full control over your VPN? Here's how to build one with WireGuard on your own VPS — clean, fast, no middlemen.

No subscriptions. No sketchy apps. No logs except the ones you create.

[Image: divider.gif]

Step 1: Get a VPS

Code
• Ubuntu 20.04 or 22.04  
• Root SSH access  
• KVM (not OpenVZ)  
• Port 51820 (or whatever you want) open

GreenCloud, Hetzner, RackNerd — whatever’s cheap and solid. SSH in once it’s deployed.

Step 2: Install WireGuard

Code
sudo apt update && sudo apt upgrade -y  
sudo apt install wireguard qrencode -y

Enable IPv4 forwarding:

Code
sudo nano /etc/sysctl.conf

Uncomment this line:
Code
net.ipv4.ip_forward=1

Then apply it:

Code
sudo sysctl -p

Step 3: Generate Server Keys & Config

Code
cd /etc/wireguard  
umask 077  
wg genkey | tee server.key | wg pubkey > server.pub

Now create the server config:

Code
sudo nano /etc/wireguard/wg0.conf

Paste this and replace `[YOUR_SERVER_PRIVATE_KEY]`:

Code
[Interface]
PrivateKey = [YOUR_SERVER_PRIVATE_KEY]
Address = 10.0.0.1/24
ListenPort = 51820
SaveConfig = true
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

Bring it up:

Code
sudo systemctl enable wg-quick@wg0  
sudo systemctl start wg-quick@wg0

Step 4: Add a Client

Create client keys:

Code
wg genkey | tee client.key | wg pubkey > client.pub

Then write the client config:

Code
[Interface]
PrivateKey = [CLIENT_PRIVATE_KEY]
Address = 10.0.0.2/24
DNS = 1.1.1.1

[Peer]
PublicKey = [SERVER_PUBLIC_KEY]
Endpoint = your.vps.ip:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25

On the server, register the client:

Code
sudo wg set wg0 peer [CLIENT_PUBLIC_KEY] allowed-ips 10.0.0.2/32

Step 5: Use It on Mobile (QR Setup)

Install WireGuard app from App Store or Play Store.
To generate a QR from your client config:

Code
qrencode -t ansiutf8 < client.conf

Scan that with the WireGuard app — done in 5 seconds.

Step 6: Use It on Windows

1. Download the official client:
https://www.wireguard.com/install/

2. Open the app
3. Click Add Tunnel > Add empty tunnel
4. Paste your client config
5. Save & connect

It runs in the background, routes traffic cleanly, and doesn’t leak.

[Image: divider.gif]

Extras

Code
• You can create as many clients as you want
• Port can be changed if you want stealth (e.g. 443)
• Add firewall rules if you're paranoid
• Works on mobile data and public WiFi without detection

Fast, silent, and actually yours.

[Image: divider.gif]

Legends don’t lease privacy. They build it.
[Image: vibesignature.gif]
The Brotherhood Vibe  Legends
Great tutorial
Can be added directly in router, or tv for instance?
HF Member Since 2010
(Jul 22, 2025 12:40 AM)Hopsin Wrote:  Can be added directly in router, or tv for instance?

Yes ofc. To any device that supports wireguard VPN.
I think on TV you could use an app. On the router a config file.

Im sure this could be used to unblock tv channels e.t.c also depending what IP the server has.
You could always add on a residential proxy to increase likely hood of success for TV or personal banking etc
[Image: vibesignature.gif]
The Brotherhood Vibe  Legends
nice man, honestly didn't know you could set up new clients like that, i did the old fashioned way of manually setting up each client on the server xd
thanks for the tutorial
Will this work for banking applications like Stripe?
thank you pro
Can you use Pritunl openvpn?
Very helpful man, thanks
(Apr 4, 2026 08:47 AM)Hackers Wrote:  Very helpful man, thanks

Thanks I think we should build a new protocol. Lets think about it. PQ-VPN - Blockchain decryption.
[Image: vibesignature.gif]
The Brotherhood Vibe  Legends
(Apr 4, 2026 09:49 AM)7 Wrote:  Thanks I think we should build a new protocol. Lets think about it. PQ-VPN - Blockchain decryption.

Yes, we need to be building good technology for the whole world, and these types of things are great for decentralized networking


Possibly Related Threads...
Thread / Author Replies Views Last Post
by hextra6May 4, 2025 07:55 PM 25 2,940 May 4, 2025 07:55 PM
Last Post: ginxforce
[VPN] by Blue Eye SamuraiJan 22, 2024 06:34 AM 3 215 Jan 22, 2024 06:34 AM
Last Post: track3r
by secret1337Jan 17, 2024 07:17 AM 7 621 Jan 17, 2024 07:17 AM
Last Post: flossmymonkey