skip to content
Slashism

How to Set Up Your Own VPN on Linux

/ 3 min read

Are you ready to take control of your online privacy? 🛡️ Want to set up your very own VPN server but don’t know where to start? Look no further! We’re about to dive into the world of openvpn-install, a nifty script that turns the complex process of setting up an OpenVPN server into a walk in the park. Let’s get started!

Setting Up Your VPN Server

openvpn-install is like your personal VPN wizard. It’s a script available on GitHub that automates the entire process of setting up an OpenVPN server. No more wrestling with complex configurations - this script does the heavy lifting for you!

Step 1: Summoning the Script

First things first, let’s get that script onto your server. Open up your terminal and type:

Terminal window
wget https://git.io/vpn -O openvpn-install.sh

This command is like ordering your VPN ingredients online - quick and easy!

Step 2: Giving the Script Superpowers

Now, let’s make the script executable:

Terminal window
chmod +x openvpn-install.sh

Think of this as unwrapping your new VPN tool and getting it ready for use.

Step 3: Running the Magic Script

Time to let the script work its magic:

Terminal window
sudo ./openvpn-install.sh

As the script runs, it’ll ask you about:

  • Your server’s public IP (it’s like your VPN’s home address)
  • The protocol to use (UDP is recommended - it’s like choosing the fastest delivery service for your data)
  • The port (think of it as choosing which door your VPN uses)
  • DNS resolver (this is like picking a map for your VPN to use)
  • Client name (naming your first VPN user)

Don’t stress if you’re not sure about some options - the default choices are usually spot on for most people.

Once the script finishes its magic, it’ll create a .ovpn file. This file is like a special key to your VPN castle, usually named after the client name you chose.

Setting Up Your VPN Client

Now that your VPN server is ready, let’s set up your device to use it!

Step 1: Transferring the Magic Key

You need to get that .ovpn file onto your device. If you’re feeling tech-savvy, use scp:

Terminal window
scp username@your_server_ip:/path/to/client1.ovpn /local/path/on/your/machine/

Step 2: Installing OpenVPN on Your Device

Run below command:

Terminal window
sudo apt update && sudo apt install openvpn

Step 3: Connecting to Your VPN

Navigate to where you saved the .ovpn file and run:

Terminal window
sudo openvpn --config client1.ovpn

Boom! You’re now connected to your very own VPN server. 🎉

Adding More VPN Users

Want to share your VPN with friends or family? Just run the openvpn-install.sh script again on your server. It’s like having a “Create New VPN User” button!

Pro Tips to Remember

  • Make sure your server’s door (UDP port, usually 1194) is open and your bouncer (firewall) knows to let VPN traffic through.
  • Keep your .ovpn files safe and secure - they’re the keys to your VPN kingdom!
  • While openvpn-install sets up a great basic server, for top-secret, high-security needs, you might want to add some extra fortifications.

And there you have it! You’re now the proud owner of your very own VPN server. Enjoy your newfound privacy and freedom online! 🌐🔒