VPS vs VPN: what is the difference?
A VPS (virtual private server) is a server you rent: a virtual machine in a data center with its own CPU, RAM, disk and IP address, where you run websites, apps or bots. A VPN (virtual private network) is an encrypted tunnel between your device and another network, so your traffic travels privately to that endpoint. One is a machine, the other is a connection. You can run your own VPN, such as WireGuard, on a VPS.
A RapidServer VPS is a KVM server in Mumbai (BOM1) or Delhi NCR (DEL1) with full root and a dedicated IPv4, and VPNs are welcome on it within our Acceptable Use Policy.
VPS vs VPN, side by side
| VPS | VPN | |
|---|---|---|
| What it is | A rented server (a virtual machine) | An encrypted tunnel between networks |
| Used for | Websites, apps, databases, bots, and VPN server software | Encrypting traffic on untrusted Wi-Fi and reaching private networks |
| IP that sites see | The server's own IP | The IP of the tunnel's exit point |
| Can it run the other? | Yes, a VPS can be a VPN server | No, a VPN is a connection and can't host anything |
Can I use a VPS as a VPN?
Yes. Install WireGuard on a Linux VPS and it becomes your own VPN server: your devices connect through an encrypted tunnel, and their traffic stops at the VPS or, if you choose, goes on to the internet from its IP address. WireGuard calls itself a simple, fast and modern VPN; it carries IP packets over UDP and ties each device's public key to the tunnel addresses it may use.
When your own VPN on a VPS makes sense
- A static Indian IP for your own logins. Home broadband and mobile data IPs usually change when the router restarts. A VPS has a dedicated IPv4 that stays with the server while you keep it, so through a full tunnel your traffic leaves from one fixed address you can allow in your own firewalls and admin panels. See IP address kya hai.
- Safer public Wi-Fi. On café, hotel or airport Wi-Fi, the tunnel encrypts traffic between your device and the VPS, so others on that network can't read it.
- Private access to your servers. Keep SSH, databases and admin dashboards closed to the internet and reach them only over WireGuard. Each teammate gets their own key.
How to set up WireGuard on an Ubuntu VPS
The outline on Ubuntu 24.04 LTS; for detail, read WireGuard's quick start and the wg-quick man page. Log in over SSH first (see SSH kya hai), then install WireGuard and create the server's key pair. The private key never leaves the server:
sudo apt update sudo apt install wireguard umask 077 wg genkey | tee private.key | wg pubkey > public.key cat private.key public.key
Next, create the server config with sudo and your editor. wg-quick reads /etc/wireguard/wg0.conf for an interface called wg0. Address is the server's address inside the tunnel, and each device gets its own [Peer] block with its own address:
[Interface] Address = 10.8.0.1/24 ListenPort = 51820 PrivateKey = paste-the-server-private-key [Peer] # your laptop PublicKey = paste-the-laptop-public-key AllowedIPs = 10.8.0.2/32
WireGuard uses UDP. Without ListenPort it picks a random port, so set one; 51820 is the port in WireGuard's examples. Open it in ufw, allowing SSH first (see our firewall guide), and in any client-area firewall rules, then start the tunnel at boot:
sudo ufw allow 22/tcp sudo ufw allow 51820/udp sudo ufw enable sudo systemctl enable --now wg-quick@wg0 sudo wg show
Sending all traffic through the VPS. For public Wi-Fi, the server must also forward your devices' traffic to the internet. Ubuntu's guide to WireGuard as the default gateway turns on net.ipv4.ip_forward and adds a NAT masquerade rule. With ufw on, also run sudo ufw route allow in on wg0 out on eth0 (check the interface name with ip route). If you only need to reach the VPS itself, skip this.
Connect a laptop or phone
Install the WireGuard app for your device from WireGuard's install page, give the device its own key pair, and paste its public key into the server's [Peer] block. The device's config looks like this:
[Interface] Address = 10.8.0.2/32 PrivateKey = paste-the-laptop-private-key [Peer] PublicKey = paste-the-server-public-key Endpoint = your-vps-ipv4:51820 AllowedIPs = 10.8.0.0/24
AllowedIPs = 10.8.0.0/24 sends only tunnel traffic to the VPS. Change it to 0.0.0.0/0 to send all IPv4 traffic through the server, as in wg-quick's own example, and add a DNS line to set the DNS server used while the tunnel is up. On Linux, save the file as /etc/wireguard/wg0.conf and run sudo wg-quick up wg0; on other devices, enter the same settings in the WireGuard app.
What a VPN on your VPS won't do
- It doesn't hide your identity from the provider. The VPS is rented in your name, and full-tunnel traffic leaves from its dedicated IPv4, so it leads back to your account. CERT-In's directions of 28 April 2022 require VPS providers and VPN service providers to register customers' validated names, addresses, contact numbers and allotted IPs, and keep them for 5 years or longer after the registration ends.
- It isn't a commercial VPN with many countries. You get one IPv4 in one city. Our VPS servers are only in Mumbai (BOM1) and Delhi NCR (DEL1); there is no separate Noida data center, and Noida is served from DEL1.
Our Acceptable Use Policy and Indian law
Our Acceptable Use Policy doesn't mention VPNs or proxies by name. It governs how our services are used and rules out illegal content, copyright infringement, malware, spam, DDoS attacks, scanning other networks without permission, botnets, IP spoofing and security breaches. Traffic from your tunnel leaves from our network, so the same rules apply, and breaking them can lead to suspension or termination.
Use your VPN for your own devices and your team, and follow Indian law and the terms of the sites and services you use. This guide is not legal advice.
Which VPS for WireGuard: plan and city
For yourself or a small team, start on the smallest plan: 2 dedicated vCPU, 4 GB RAM and 1 TB of monthly transfer for ₹581/mo plus 18% GST. Full-tunnel traffic passes through the VPS, so watch the bandwidth graph; we email you at 80% and 100% of the allowance.
Pick the city nearest you: Mumbai for western and southern India or Delhi NCR for the north. Both cost the same, and we move a VPS between them for free (see our data centers). Your VPS is ready a few minutes after payment, with daily backups kept for 7 days.
Full root, a dedicated IPv4 and always-on DDoS filtering in Mumbai or Delhi NCR, ready a few minutes after payment, from ₹581/mo.
See VPS plansQuestions
What is the difference between a VPS and a VPN?+
Can I use a VPS as a VPN?+
Which port does WireGuard need on a VPS?+
ListenPort in wg0.conf. Without it WireGuard picks a random port, so set one, such as 51820 from WireGuard's examples, and open it with sudo ufw allow 51820/udp and in any client-area firewall rules.Will a VPN on my VPS make me anonymous?+
Can I get an IP from another country?+
Can my team share one WireGuard VPS?+
[Peer] block with their own tunnel address. When someone leaves, delete their peer and restart the tunnel; nobody else needs new keys.