VPN Setup Guide
Secure Connection Between OVH VPS & Old Laptop
30-Step Process
WireGuard & OpenVPN
Professional Setup
1
VPS Preparation
- Order VPS: OVH Manager → VPS SSD (1-2GB RAM)
- Select OS: Ubuntu 22.04 LTS or Debian 12
- Get Credentials: Save IP, root username/password
- Connect via SSH:
ssh root@YOUR_VPS_IP
Pro Tip: Choose a VPS location close to your physical location for better latency.
2
VPN Server Installation
WireGuard (Recommended)
- Update System:
sudo apt update && sudo apt upgrade -y - Download Installer:
wget https://git.io/wireguard -O wireguard-install.sh - Run Script:
chmod +x wireguard-install.sh && sudo ./wireguard-install.sh - Follow Prompts: Default IP, port 51820, DNS (1.1.1.1)
- Add Client: Name it
my_laptop - Download Config: Get
/root/my_laptop.conf
OpenVPN (Alternative)
- Update System: Same as above
- Download Installer:
wget https://git.io/vpn -O openvpn-install.sh - Run Script: Similar to WireGuard
- Select Port: Default 1194 (UDP) or 443 (TCP for restrictive networks)
- Generate Client: Name it
my_laptop - Get .ovpn File: Download
my_laptop.ovpn
3
Laptop Configuration
- Prepare OS: Update system; consider lightweight Linux (Lubuntu/Xubuntu)
- Install Client:
- WireGuard:
sudo apt install wireguard - OpenVPN:
sudo apt install openvpn openvpn-systemd-resolved
- WireGuard:
- Place Config File:
- WireGuard: Copy to
/etc/wireguard/wg0.conf - OpenVPN: Copy to
/etc/openvpn/client/
- WireGuard: Copy to
For Old Laptops: Use lightweight OS like Lubuntu for better performance on older hardware.
4
Connection & Testing
- Start VPN Connection:
- WireGuard:
sudo wg-quick up wg0 - OpenVPN:
sudo systemctl start openvpn-client@my_laptop
- WireGuard:
- Verify Connection:
ip addr show(look for wg0/tun0) - Test Tunnel: Visit https://whatismyipaddress.com
- Confirm Success: Should show VPS IP, not your home IP
- Test Connectivity: Browse web, ping 8.8.8.8
Auto-start: For OpenVPN:
sudo systemctl enable openvpn-client@my_laptop
5
Security & Management
- Harden SSH: Disable password login, use SSH keys only
- Configure Firewall: Allow only necessary ports (51820/UDP for WireGuard)
- Manage Clients: Re-run script to add more devices
- Revoke Access: Use script's "Revoke a user" for lost devices
- Auto-updates: Enable unattended security updates
- Monitor Logs: Check
journalctlfor issues
Critical: Never skip SSH hardening and firewall configuration!
+
Additional Considerations
- Port Forwarding: Advanced setup for hosting services on laptop
- Server vs Client: VPS = server/gateway; Laptop = client
- SSH Access: Scripts preserve access via real IP
- Learning Topics: IP routing, subnets, firewalls, public-key crypto
IP Routing
Subnets
Firewalls (UFW)
Public-Key Crypto
Protocol Choice Recommendation
WireGuard ⭐
- Faster performance
- Simpler setup
- Modern cryptography
- Less resource-intensive
- Better for old laptops
OpenVPN
- More mature
- Flexible configuration
- Port 443 TCP option
- Better for restrictive networks
- Widely supported
For most users, WireGuard is recommended due to its speed and simpler setup, especially on older hardware.