Skip to content

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

ProviderPriceLogging PolicyBest For
Mullvad€5/monthNo logsPrivacy, simplicity
ProtonVPNFree / $10/monthNo logsFree tier, privacy
IVPN$6/monthNo logsPrivacy, transparency
ExpressVPN$13/monthNo logsStreaming, speed
WireGuardFree (protocol)Depends on providerTechnical 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 app

2. 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.me

Manual 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 wg0

OpenVPN

sudo openvpn --config /path/to/config.ovpn

Testing 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/webrtc

Kill 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 = auto in 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.