On this pageStart from the problem you have
The two terms differ by one letter and describe different things. A VPS (virtual private server) is a computer you rent: it runs your software around the clock in a data center. A VPN (virtual private network) is a tunnel: an encrypted link that carries your device's traffic to another machine before it continues to the internet. They meet when that other machine is a VPS you run yourself.
Start from the problem you have
Most confusion disappears once you name the job. Find yours in the left column:
| You want to | Use | Why |
|---|---|---|
| Host a website, a bot or a game server | A VPS | It runs software around the clock on a public address |
| Use hotel or café Wi-Fi safely | A VPN | It encrypts everything between your device and the VPN server |
| Keep your browsing history from your ISP | A VPN | The ISP sees only the tunnel |
| Reach office servers from home | A remote-access VPN | It connects you into a private network |
| Get a fixed address to allowlist on admin panels | A VPN running on your own VPS | One exit address that only your devices use |
| Hide SSH and dashboards from the internet | A VPN on the same VPS | Admin services listen only on the tunnel |
| Stay anonymous online | Neither, on its own | Both tie your traffic to an account |
The rest of this guide explains the rows that need more than one line.
The VPN: protection with clear limits
A VPN encrypts traffic between your device and the VPN server, usually with WireGuard, OpenVPN or IPsec with IKEv2. That protects you in specific ways:
- On untrusted networks. On hotel or café Wi-Fi, other users and the network operator see only an encrypted stream.
- From your internet provider. Your ISP sees that you connect to a VPN server, not which sites you visit after it.
- Into private networks. The original use: a remote worker reaches office servers, or an admin reaches services that are not exposed to the internet.
- With a different exit address. Websites see the VPN server's IP instead of yours.
It does not do everything its marketing implies:
- It does not make you anonymous. Whoever runs the VPN server can see where your traffic goes, and the accounts you log into identify you regardless of your address.
- It does not stop malware or phishing. A malicious download arrives just as well through a tunnel.
- It ends at the VPN server. From there to the website, traffic crosses the internet as usual, where HTTPS, not the VPN, protects its content.
There are two families. A remote-access VPN connects you into a private network, such as an office or a group of servers. A privacy VPN sends all your traffic out through a provider's servers, shared with many other subscribers.
The VPS: a whole computer, not a connection
A VPS is a slice of a physical server. Software called a hypervisor, KVM for example, carves the host's CPUs, RAM and disks into isolated virtual machines; every one runs a separate operating system and gets a public IP address of its own. You install what you like, from a web server to a database to a VPN, and it keeps running when your laptop is closed. In exchange, you look after it: updates, firewall, backups. What a cloud server is follows one from deploy to delete.
When a VPS becomes your VPN
Running a VPN server on your own VPS gives you things a shared subscription cannot:
- A dedicated, fixed exit address. Only your devices use it, so you can allowlist it on admin panels, database firewalls and SSH. For a developer or a small team, this alone can justify the setup.
- Control of the logs. You are the operator, so you decide what is recorded and for how long.
- A location you choose, among your provider's regions.
The trade-offs are real:
- Less anonymity, not more. The server is rented on your account and its address is yours alone. A commercial VPN mixes your traffic with that of many users; a personal one does not.
- Data center addresses are treated differently. Some streaming and banking services block or challenge address ranges that belong to hosting providers.
- You maintain it: system updates, WireGuard keys, and the firewall.
- Your provider's rules apply. You answer for traffic leaving your server's address.
CloudSat's acceptable use summary allows VPNs and proxies for your own use, and you can place the exit address in any of its 13 regions.
A WireGuard server in four steps
WireGuard has been part of the Linux kernel since version 5.6, so on a current Debian or Ubuntu server the tools are one package away. First, install it, create the server keys, find the public interface and turn on forwarding:
sudo apt install -y wireguard iptables
wg genkey | sudo tee /etc/wireguard/server.key | wg pubkey | sudo tee /etc/wireguard/server.pub
sudo chmod 600 /etc/wireguard/server.key
ip route show default # "dev eth0" or similar: the public interface
echo 'net.ipv4.ip_forward = 1' | sudo tee /etc/sysctl.d/99-wireguard.conf
sudo sysctl --system
Second, write the server configuration. Create the laptop's key pair the same way, or let the WireGuard app generate it, and paste its public key into the [Peer] block. The PostUp rule masquerades tunnel traffic behind the server's public address; replace eth0 with your interface name:
# /etc/wireguard/wg0.conf on the VPS
[Interface]
Address = 10.8.0.1/24
ListenPort = 51820
PrivateKey = <contents of server.key>
PostUp = iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
PostDown = iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
[Peer]
# laptop
PublicKey = <laptop public key>
AllowedIPs = 10.8.0.2/32
Third, open the port and start the tunnel. If UFW is active, it also needs a rule to forward tunnel traffic:
sudo ufw allow 51820/udp
sudo ufw route allow in on wg0 out on eth0
sudo systemctl enable --now wg-quick@wg0
Fourth, configure the client. The official WireGuard apps for Windows, macOS, iOS and Android import a file like this one:
[Interface]
PrivateKey = <laptop private key>
Address = 10.8.0.2/32
DNS = 9.9.9.9 # or a resolver you run yourself
[Peer]
PublicKey = <contents of server.pub>
Endpoint = 203.0.113.50:51820
AllowedIPs = 0.0.0.0/0, ::/0 # ::/0 keeps IPv6 from bypassing the tunnel
PersistentKeepalive = 25
Connect, then run sudo wg show on the server: a recent handshake and growing transfer counters mean it works, and any "what is my IP" page should now show the server's address. Each new device is another [Peer] block with its own key and tunnel address. Never copy one client file to several devices.
Use the tunnel to hide your admin ports
The most useful trick is the reverse direction. Once your devices connect over WireGuard, admin services no longer need to face the internet at all. Allow SSH, dashboards and database ports only on the tunnel interface, and the public address shows nothing but your website and one silent UDP port:
sudo ufw allow in on wg0 to any port 22 proto tcp
sudo ufw delete allow 22/tcp # remove the public SSH rule, if you added one
Keep the provider's console access in mind before removing public SSH. It is your way back in if the tunnel breaks.
FAQ
Is a VPS more secure than a VPN?
They answer different questions. A VPS is a server whose security depends on how you configure it. A VPN protects traffic between your device and one server. Many setups use both: a VPN to reach the VPS, and the VPS to run the service.
Can a whole team share one VPS-based VPN?
Yes. Give every device its own key and tunnel address, and remove a peer when someone leaves. Remember that all of them exit through one address registered to your account, so you answer for what that traffic does.
Will a self-hosted VPN make me anonymous?
No. It hides your browsing from the local network and your ISP, but the exit address is unique to you and tied to your account. For anonymity you need different tools and habits, not a private server.
Do I need a VPN to connect to my VPS?
Not for security of the connection itself: SSH and RDP already encrypt their traffic. A VPN adds value by letting you close those ports to the internet entirely and reach them only through the tunnel.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




