How to Set Up a VPN Using Your VPS Server

5/5 - (1 vote)

Data privacy and secure internet access have become top priorities. While commercial VPN services are convenient, many tech-savvy users prefer to create their own self-hosted VPN server using a Virtual Private Server (VPS). This not only offers more control but also enhances security and trust. In this guide, you’ll learn exactly how to create a VPN on a VPS, from choosing your provider to securing your connection.


🔒 Why Set Up a VPN on a VPS?

Hosting your own VPN has several benefits over using third-party providers:

  • Increased Privacy: You control the server and logs.

  • Bypass Censorship: Access content freely from restricted regions.

  • Better Speeds: Avoid shared networks that slow down commercial VPNs.

  • Cost-Effective: Long-term savings over monthly VPN subscriptions.


🧰 What You Need for a VPS VPN Setup

Before jumping into the technical steps, ensure you have the following:

Requirement Description
VPS Plan Any basic VPS with 1 GB RAM & 1 CPU (Linux)
Root Access Needed for full VPN installation
Public IP Address Used for client connection
Linux OS Ubuntu 20.04 or later recommended
SSH Client To access your VPS remotely

💡 Tip: If your goal is VPN hosting with VPS for multiple users, choose a server with more RAM and bandwidth.


🚀 Step-by-Step: How to Create a VPN on VPS

We’ll use OpenVPN, one of the most popular open-source VPN solutions.

✅ Step 1: Choose a VPS Provider

Select a VPS provider that offers reliable uptime and data center locations near your audience. Look for plans with:

  • Root access

  • At least 1 GB RAM

  • IPv4 support

Some good providers include DigitalOcean, Linode, and BeStarHost.


✅ Step 2: Connect to Your VPS via SSH

ssh root@your_vps_ip

Update your packages:

apt update && apt upgrade -y

✅ Step 3: Install OpenVPN Using a Script (Fastest Method)

Use a community-tested script like this one from Angristan’s GitHub:

wget https://git.io/vpn -O openvpn-install.sh
chmod +x openvpn-install.sh
./openvpn-install.sh

You’ll be prompted to:

  • Set your VPN port and protocol

  • Choose DNS servers

  • Create a VPN user/client profile

Once complete, you’ll get a .ovpn config file to use on your device.


✅ Step 4: Download the .ovpn File

Use scp or any SFTP client to move the .ovpn file from your VPS to your local device:

scp root@your_vps_ip:/root/clientname.ovpn .

✅ Step 5: Connect to Your VPN

Use any OpenVPN-compatible client (Windows, macOS, Linux, Android, iOS) and import the .ovpn profile.


🔐 Optional: Secure Your VPS

After your VPS VPN setup, it’s smart to harden your server:

  • Enable UFW (Firewall):

ufw allow ssh
ufw allow 1194/udp # Default OpenVPN port
ufw enable
  • Disable root login via SSH after setup.

  • Install fail2ban to prevent brute-force attacks.


👥 Multi-User VPN Hosting with VPS

If you want to offer VPN access to friends, clients, or even customers:

  • Run ./openvpn-install.sh again to create more user profiles.

  • Each .ovpn file is unique per user.

  • Monitor usage using vnstat or iftop.


Setting up a self-hosted VPN server using a VPS is an affordable, flexible, and secure way to protect your online activity. Whether you’re bypassing geo-blocks, shielding yourself on public Wi-Fi, or offering VPN access to others, this solution puts you in full control.

A properly configured VPN hosting with VPS can rival even premium VPN services—especially when combined with good server security practices.


📌 Ready to Launch Your Private VPN?

Choose a VPS plan with root access, SSD storage, and fast bandwidth from providers like BeStarHost to start your private VPN journey today.

Leave a comment