Why WireGuard?
Most commercial VPNs use old protocols like OpenVPN, which can be slow. WireGuard is a modern, high-performance VPN protocol that runs directly inside the Linux kernel.
- Maximum Speed: Use your server's full Gigabit bandwidth.
- Total Privacy: You own the server, you own the logs.
- Ad-Blocking: Can be configured to block ads network-wide (See Step 2).
Step 1: Get the Magic Script
We will use a trusted automated installer script to handle keys and firewall rules instantly.
Login to your server (SSH) and run these commands:
curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh
chmod +x wireguard-install.sh
Step 2: Run & Enable Ad-Blocking
Run the script. This is where we enable the magic features.
π₯ Pro Tip: How to Block Ads
When the script asks for DNS resolvers, do not choose the default!
- For Max Speed: Choose Google (8.8.8.8) or Cloudflare (1.1.1.1).
- For Ad-Blocking: Choose AdGuard DNS. (If not listed, select "Custom" and type:
94.140.14.14).
This will automatically block ads on your phone/PC while connected to the VPN.
Step 3: Connect Your Phone (QR Code)
The script will generate a massive QR Code in your terminal.
- Download the WireGuard App (iOS/Android).
- Tap (+) -> Scan from QR code.
- Scan your screen. Connected!
Tip: Split Tunneling (Android/iOS)
Want to use VPN only for specific apps?
Open the WireGuard App -> Click your tunnel -> Edit -> Click "All Applications". Uncheck apps that you want to bypass the VPN.
Step 4: Connect Your PC / Laptop
To connect a computer, you need the config file generated by the script. Use the `cat` command to read it:
Copy the text output, open the WireGuard Desktop Client (Windows/Mac), click "Add Tunnel" -> "Add empty tunnel", and paste the text.
Step 5: Manage Users
To Add or Delete a user, simply run the script again:
Select Option 1 to Add User, or Option 2 to Revoke (Delete) a user immediately.
Final Thoughts
You now have a private VPN with Ad-Blocking capabilities. No monthly fees, no throttling.
Troubleshooting: If you can't connect, ensure UDP Port 51820 is allowed in your server's firewall (UFW/Firewalld).
Need a server with 1Gbps or 10Gbps Uplink? Check out ServerMO Network Speeds β