How to Set Up a VPN: A Beginner's Guide
A VPN (Virtual Private Network) encrypts your internet traffic and routes it through a remote server.
How a VPN Works
Without VPN:
Your device ──→ Your ISP ──→ Internet
(can see everything you do)
With VPN:
Your device ──→ Encrypted tunnel ──→ VPN server ──→ Internet
(ISP can't see your traffic) (websites see VPN's IP)Why Use a VPN
- Public WiFi security — encrypts traffic on coffee shop, hotel, and airport WiFi
- Privacy from your ISP — your ISP can’t see what sites you visit
- Bypass geo-restrictions — access content available in other countries
- Hide your IP address — websites see the VPN’s IP, not yours
When a VPN Doesn’t Help
- Malware protection — VPNs don’t block viruses
- Anonymity — the VPN provider can see your traffic
- Slow internet — VPNs usually make things slower
- Incognito mode — doesn’t replace clearing browser history
Choosing a VPN Provider
| Provider | Price | Logging Policy | Best For |
|---|---|---|---|
| Mullvad | €5/month | No logs | Privacy, simplicity |
| ProtonVPN | Free / $10/month | No logs | Free tier, privacy |
| IVPN | $6/month | No logs | Privacy, transparency |
| ExpressVPN | $13/month | No logs | Streaming, speed |
| WireGuard | Free (protocol) | Depends on provider | Technical users |
Avoid: Free VPNs that don’t have a transparent business model. If the service is free, you are the product.
Quick Setup
1. Install a VPN Client
Most providers offer apps for all platforms:
Your provider's website → Downloads → Install the app2. Log In
Enter your account credentials. Most providers assign you a random account number (Mullvad) or let you create a username/password.
3. Connect
Click the connect button. The app selects the best server automatically.
4. Verify
# Check your IP is different
# Before VPN: shows your real IP
# After VPN: shows VPN server's IP
curl ifconfig.meManual Setup (No App)
WireGuard (All Platforms)
# Generate keys
wg genkey | tee privatekey | wg pubkey > publickey
# Configuration file: /etc/wireguard/wg0.conf
[Interface]
PrivateKey = <your-private-key>
Address = 10.0.0.2/24
[Peer]
PublicKey = <vpn-server-public-key>
Endpoint = vpn.example.com:51820
AllowedIPs = 0.0.0.0/0
# Connect
sudo wg-quick up wg0OpenVPN
sudo openvpn --config /path/to/config.ovpnTesting Your VPN
# Check your public IP
curl https://ipinfo.io/json
# DNS leak test
curl https://dnsleaktest.com
# WebRTC leak test (browser)
Visit: https://browserleaks.com/webrtcKill Switch
A kill switch blocks all internet traffic if the VPN disconnects unexpectedly:
- ProtonVPN: Settings → Advanced → Kill Switch → On
- Mullvad: Settings → Kill switch → Always
- WireGuard: Use
Table = autoin configuration
Common Issues
VPN slows your internet
Try: Different server, different protocol (WireGuard > OpenVPN)
Expected: 20-30% speed loss is normal
Problematic: 80%+ speed loss (switch servers or providers)Sites block VPNs
Some streaming services block known VPN IP addresses. Try:
- A different server
- A different provider
- The provider’s “streaming-optimized” server
VPN disconnects frequently
Check:
- Router stability
- VPN protocol (WireGuard is more stable than OpenVPN)
- Server load (pick a less crowded server)Related: Learn about password managers and two-factor authentication.