blog

Setting up a personal, private WireGuard VPN on VPS

Setup personal VPN

If you are looking to setup personal VPN server to reclaim your online privacy, you have come to the right place. In an era where commercial VPN providers are constantly getting hacked or caught selling user data, taking control of your own infrastructure is the only logical step.

Why did you buy an anonymous VPS from SarvHost? Probably because you value freedom. So why route your traffic through a third-party VPN service? When you setup personal VPN access on your own hardware, you become the administrator. No logs, no throttling, and no shared IP addresses.

In this guide, we are going to ditch the slow, outdated OpenVPN protocols. Instead, we will use WireGuard. It is modern, lean, and incredibly fast. By the end of this 5-minute tutorial, you will have a military-grade encrypted tunnel running on your Ubuntu VPS.


Why Choose WireGuard Over OpenVPN?

Before we start the installation, it is important to understand why we recommend WireGuard for your private server.


Prerequisites

To follow this guide, you will need:

Note: If you followed our previous guide on securing your VPS, ensure your firewall allows UDP traffic. The script we use will handle most of this automatically.


Step 1: Update and Prepare Your Server

Always start with a fresh system. Log into your server via SSH. If you want to setup personal VPN correctly, you need to ensure your dependencies are up to date.

Run these commands to update the package list and install curl:

apt update && apt upgrade -y
apt install curl -y

Step 2: Run the Automated Installer Script

We are not going to manually edit complex config files today. That is where mistakes happen. Instead, we will use the widely respected angristan/wireguard-install script from GitHub. It automates the entire process of setting up keys, interfaces, and routing tables.

Copy and paste this single command into your terminal and hit Enter:

curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh && chmod +x wireguard-install.sh && ./wireguard-install.sh
WireGuard VPS install
WireGuard VPS install

Step 3: Configure the Installation (Just Press Enter!)

The script will launch an interactive wizard in your terminal. It might look technical, but it is actually very smart at guessing the best settings for your specific server environment.

You will be asked a series of questions:

Pro Tip: For 99% of users, the default answers are perfect. Just keep pressing ENTER until it asks for a “Client Name”.

When prompted for a Client Name, type something descriptive like MyiPhone or HomeLaptop and press Enter.

The script will now install WireGuard, generate your private/public encryption keys, and configure the firewall rules.


Step 4: Connect Your Device (QR Code Method)

This is the magic moment. Once the installation finishes, the script will generate a configuration file. But you don’t need to download it manually.

The script will display a large QR Code directly inside your terminal window.

How to connect your phone:

Ubuntu WireGuard tutorial
Ubuntu WireGuard tutorial
  1. Download the official WireGuard App from the App Store (iOS) or Google Play (Android).
  2. Open the app and tap the “+” button.
  3. Select “Scan from QR code”.
  4. Point your camera at your computer screen (terminal).
  5. Name the tunnel (e.g., “SarvHost VPN”) and toggle the switch to ON.

Congratulations! Your traffic is now encrypted and exiting through your VPS in Germany or the Netherlands.


Troubleshooting Common Issues

Sometimes things don’t go 100% smoothly. Here are common fixes if you can’t connect:

1. Handshake Failed?

If the app shows the connection is active but you have no internet, it usually means the “Handshake” failed. Check your firewall. Ensure UDP port 51820 is open:

ufw allow 51820/udp

2. Adding a Second Device?

Do not scan the same QR code for two devices at the same time. It will cause conflicts. To add a second device (like your laptop), simply run the script again:

./wireguard-install.sh

Select option 1) Add a new client, give it a new name, and a new QR code will appear.


Final Thoughts: Privacy is a Choice

Learning to setup personal VPN infrastructure is a superpower in the digital age. You are no longer dependent on shady “free” VPN apps that sell your browsing history.

With SarvHost, you get the raw power and anonymity needed to run these services. Our “No KYC” policy ensures that even we don’t know who owns the VPN server.

Ready to build your tunnel? Grab a high-speed NVMe VPS today.

πŸš€ Get Your Private VPN VPS ($5.99)

admin

Content Writer

Writing about VPS hosting, server management, and web technologies.

Leave a Comment

Your email address will not be published. Required fields are marked *